[Freeswitch-svn] [commit] r5738 - in freeswitch/trunk: . docs libs/apr-iconv-1.1.1/ccs libs/apr-iconv-1.1.1/ces libs/apr-iconv-1.1.1/include libs/apr-iconv-1.1.1/lib libs/apr-iconv-1.1.1/util libs/apr-util/buckets libs/apr-util/crypto libs/apr-util/dbd libs/apr-util/dbm libs/apr-util/dbm/sdbm libs/apr-util/encoding libs/apr-util/hooks libs/apr-util/include libs/apr-util/include/private libs/apr-util/ldap libs/apr-util/misc libs/apr-util/strmatch libs/apr-util/test libs/apr-util/uri libs/apr-util/xlate libs/apr-util/xml libs/apr-util/xml/expat/lib libs/apr/atomic/netware libs/apr/atomic/os390 libs/apr/atomic/unix libs/apr/atomic/win32 libs/apr/build libs/apr/dso/aix libs/apr/dso/beos libs/apr/dso/netware libs/apr/dso/os2 libs/apr/dso/os390 libs/apr/dso/unix libs/apr/dso/win32 libs/apr/file_io/netware libs/apr/file_io/os2 libs/apr/file_io/unix libs/apr/file_io/win32 libs/apr/include libs/apr/include/arch libs/apr/include/arch/aix libs/apr/include/arch/beos libs/apr/include/arch/netware libs/apr/include/arch/os2 libs/apr/include/arch/os390 libs/apr/include/arch/unix libs/apr/include/arch/win32 libs/apr/locks/beos libs/apr/locks/netware libs/apr/locks/os2 libs/apr/locks/unix libs/apr/locks/win32 libs/apr/memory/unix libs/apr/misc/netware libs/apr/misc/unix libs/apr/misc/win32 libs/apr/mmap/unix libs/apr/mmap/win32 libs/apr/network_io/beos libs/apr/network_io/os2 libs/apr/network_io/unix libs/apr/network_io/win32 libs/apr/passwd libs/apr/poll/os2 libs/apr/poll/unix libs/apr/random/unix libs/apr/shmem/beos libs/apr/shmem/os2 libs/apr/shmem/unix libs/apr/shmem/win32 libs/apr/strings libs/apr/support/unix libs/apr/tables libs/apr/test libs/apr/test/internal libs/apr/threadproc/beos libs/apr/threadproc/netware libs/apr/threadproc/os2 libs/apr/threadproc/unix libs/apr/threadproc/win32 libs/apr/time/unix libs/apr/time/win32 libs/apr/user/netware libs/apr/user/unix libs/apr/user/win32 libs/codec/g726 libs/codec/g726/src libs/codec/g7xx libs/codec/g7xx/src libs/codec/g7xx/src/include/g7xx libs/codec/gsm libs/codec/gsm/inc libs/codec/gsm/src libs/codec/ilbc libs/codec/ilbc/src libs/codec/lpc10 libs/codec/lpc10/src libs/curl/include/curl libs/curl/lib libs/curl/packages/vms libs/curl/src libs/curl/src/macos/src libs/iax libs/iax/src libs/iksemel/include libs/iksemel/src libs/iksemel/test libs/iksemel/tools libs/js/nsprpub/config libs/js/nsprpub/lib/ds libs/js/nsprpub/lib/libc/include libs/js/nsprpub/lib/libc/src libs/js/nsprpub/lib/msgc/include libs/js/nsprpub/lib/msgc/src libs/js/nsprpub/lib/msgc/tests libs/js/nsprpub/lib/prstreams libs/js/nsprpub/lib/prstreams/tests/testprstrm libs/js/nsprpub/lib/tests libs/js/nsprpub/lib/tests/windows libs/js/nsprpub/pr/include libs/js/nsprpub/pr/include/md libs/js/nsprpub/pr/include/obsolete libs/js/nsprpub/pr/include/private libs/js/nsprpub/pr/src libs/js/nsprpub/pr/src/bthreads libs/js/nsprpub/pr/src/cplus libs/js/nsprpub/pr/src/cplus/tests libs/js/nsprpub/pr/src/io libs/js/nsprpub/pr/src/linking libs/js/nsprpub/pr/src/malloc libs/js/nsprpub/pr/src/md libs/js/nsprpub/pr/src/md/beos libs/js/nsprpub/pr/src/md/mac libs/js/nsprpub/pr/src/md/os2 libs/js/nsprpub/pr/src/md/unix libs/js/nsprpub/pr/src/md/windows libs/js/nsprpub/pr/src/memory libs/js/nsprpub/pr/src/misc libs/js/nsprpub/pr/src/pthreads libs/js/nsprpub/pr/src/threads libs/js/nsprpub/pr/src/threads/combined libs/js/nsprpub/pr/tests libs/js/nsprpub/pr/tests/dll libs/js/nsprpub/pr/tests/w16gui libs/js/nsprpub/tools libs/js/src libs/js/src/fdlibm libs/js/src/perlconnect libs/libdingaling libs/libdingaling/docs libs/libdingaling/src libs/libedit/examples libs/libedit/src libs/libedit/src/editline libs/libetpan/build-windows libs/libetpan/build-windows/libetpan libs/libetpan/build-windows/readmsg libs/libetpan/build-windows/smtpsend libs/libetpan/src/bsd libs/libetpan/src/data-types libs/libetpan/src/driver/implementation/data-message libs/libetpan/src/driver/implementation/db libs/libetpan/src/driver/implementation/hotmail libs/libetpan/src/driver/implementation/imap libs/libetpan/src/driver/implementation/maildir libs/libetpan/src/driver/implementation/mbox libs/libetpan/src/driver/implementation/mh libs/libetpan/src/driver/implementation/mime-message libs/libetpan/src/driver/implementation/nntp libs/libetpan/src/driver/implementation/pop3 libs/libetpan/src/driver/interface libs/libetpan/src/driver/tools libs/libetpan/src/engine libs/libetpan/src/low-level/imap libs/libetpan/src/low-level/imf libs/libetpan/src/low-level/maildir libs/libetpan/src/low-level/mbox libs/libetpan/src/low-level/mh libs/libetpan/src/low-level/mime libs/libetpan/src/low-level/nntp libs/libetpan/src/low-level/pop3 libs/libetpan/src/low-level/smtp libs/libetpan/src/main libs/libetpan/src/windows libs/libetpan/tests libs/libresample/include libs/libresample/src libs/libresample/tests libs/libsndfile/Win32 libs/libsndfile/examples libs/libsndfile/regtest libs/libsndfile/src libs/libsndfile/src/G72x libs/libsndfile/src/GSM610 libs/libsndfile/tests libs/libspeakup libs/libspeakup/src libs/libteletone libs/libteletone/src libs/pcre libs/portaudio/bindings/cpp/build/vc7_1 libs/portaudio/bindings/cpp/example libs/portaudio/bindings/cpp/source/portaudiocpp libs/portaudio/build/msvc libs/portaudio/include libs/portaudio/pablio libs/portaudio/src/common libs/portaudio/src/hostapi/alsa libs/portaudio/src/hostapi/asihpi libs/portaudio/src/hostapi/asio libs/portaudio/src/hostapi/coreaudio libs/portaudio/src/hostapi/dsound libs/portaudio/src/hostapi/jack libs/portaudio/src/hostapi/oss libs/portaudio/src/hostapi/wasapi libs/portaudio/src/hostapi/wdmks libs/portaudio/src/hostapi/wmme libs/portaudio/src/os/mac_osx libs/portaudio/src/os/unix libs/portaudio/src/os/win libs/portaudio/test libs/sofia-sip/libsofia-sip-ua-glib/su-glib libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip libs/sofia-sip/libsofia-sip-ua/bnf libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip libs/sofia-sip/libsofia-sip-ua/features libs/sofia-sip/libsofia-sip-ua/http libs/sofia-sip/libsofia-sip-ua/http/sofia-sip libs/sofia-sip/libsofia-sip-ua/ipt libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip libs/sofia-sip/libsofia-sip-ua/iptsec libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip libs/sofia-sip/libsofia-sip-ua/msg libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip libs/sofia-sip/libsofia-sip-ua/nea libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip libs/sofia-sip/libsofia-sip-ua/nta libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip libs/sofia-sip/libsofia-sip-ua/nth libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip libs/sofia-sip/libsofia-sip-ua/nua libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip libs/sofia-sip/libsofia-sip-ua/sdp libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip libs/sofia-sip/libsofia-sip-ua/sip libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip libs/sofia-sip/libsofia-sip-ua/soa libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip libs/sofia-sip/libsofia-sip-ua/sresolv libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip libs/sofia-sip/libsofia-sip-ua/stun libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip libs/sofia-sip/libsofia-sip-ua/su libs/sofia-sip/libsofia-sip-ua/su/sofia-sip libs/sofia-sip/libsofia-sip-ua/tport libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip libs/sofia-sip/libsofia-sip-ua/url libs/sofia-sip/libsofia-sip-ua/url/sofia-sip libs/sofia-sip/open_c/sofia-sip libs/sofia-sip/utils libs/sofia-sip/win32 libs/sofia-sip/win32/libsofia-sip-ua libs/sofia-sip/win32/libsofia-sip-ua-static libs/sofia-sip/win32/sofia-sip libs/sofia-sip/win32/tests/test_htable libs/sofia-sip/win32/tests/test_memmem libs/sofia-sip/win32/tests/test_nta libs/sofia-sip/win32/tests/test_nua libs/sofia-sip/win32/tests/test_su libs/sofia-sip/win32/tests/test_tport libs/sofia-sip/win32/tests/torture_rbtree libs/sofia-sip/win32/tests/torture_su libs/sofia-sip/win32/tests/torture_su_alloc libs/sofia-sip/win32/tests/torture_su_bm libs/sofia-sip/win32/tests/torture_su_port libs/sofia-sip/win32/tests/torture_su_root libs/sofia-sip/win32/tests/torture_su_tag libs/sofia-sip/win32/tests/torture_su_time libs/sofia-sip/win32/tests/torture_su_timer libs/sofia-sip/win32/utils/localinfo libs/sofia-sip/win32/utils/sip_dig libs/sofia-sip/win32/utils/sip_options libs/sofia-sip/win32/utils/sip_options_static libs/sofia-sip/win32/utils/stunc libs/speex/include/speex libs/speex/libspeex libs/speex/src libs/speex/symbian libs/speex/ti libs/speex/win32 libs/speex/win32/VS2003/libspeex libs/speex/win32/VS2003/speexdec libs/speex/win32/VS2003/speexenc libs/speex/win32/VS2005/libspeex libs/speex/win32/VS2005/speexdec libs/speex/win32/VS2005/speexenc libs/sqlite/ext/fts1 libs/sqlite/ext/fts2 libs/sqlite/src libs/sqlite/test libs/sqlite/tool libs/srtp libs/srtp/crypto/ae_xfm libs/srtp/crypto/cipher libs/srtp/crypto/hash libs/srtp/crypto/include libs/srtp/crypto/kernel libs/srtp/crypto/math libs/srtp/crypto/replay libs/srtp/crypto/rng libs/srtp/crypto/test libs/srtp/include libs/srtp/srtp libs/srtp/tables libs/srtp/test libs/stfu libs/udns libs/win32 libs/win32/apr libs/win32/apr-iconv libs/win32/apr-util libs/win32/curl libs/win32/etpan libs/win32/howl libs/win32/iksemel libs/win32/js libs/win32/libresample libs/win32/libsndfile libs/win32/pcre libs/win32/portaudio libs/win32/pthread libs/win32/sofia libs/win32/speex libs/win32/sqlite libs/win32/udns libs/win32/xmlrpc libs/xmlrpc-c libs/xmlrpc-c/Windows libs/xmlrpc-c/examples libs/xmlrpc-c/examples/cpp libs/xmlrpc-c/include/xmlrpc-c libs/xmlrpc-c/lib/abyss/src libs/xmlrpc-c/lib/curl_transport libs/xmlrpc-c/lib/expat/gennmtab libs/xmlrpc-c/lib/expat/sample libs/xmlrpc-c/lib/expat/xmlparse libs/xmlrpc-c/lib/expat/xmltok libs/xmlrpc-c/lib/expat/xmlwf libs/xmlrpc-c/lib/libwww_transport libs/xmlrpc-c/lib/util libs/xmlrpc-c/lib/util/include libs/xmlrpc-c/lib/wininet_transport libs/xmlrpc-c/src libs/xmlrpc-c/src/cpp libs/xmlrpc-c/src/test libs/xmlrpc-c/tools/interop-server libs/xmlrpc-c/tools/turbocharger libs/xmlrpc-c/tools/xml-rpc-api2cpp libs/xmlrpc-c/tools/xmlrpc libs/xmlrpc-c/tools/xmlrpc_transport scripts/contrib/vile scripts/socket/socket2me src src/include src/include/private src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_enum src/mod/applications/mod_esf src/mod/applications/mod_ivrtest src/mod/applications/mod_rss src/mod/applications/mod_skel src/mod/applications/mod_soundtouch src/mod/asr_tts/mod_cepstral src/mod/asr_tts/mod_lumenvox src/mod/asr_tts/mod_openmrcp src/mod/codecs/mod_amr src/mod/codecs/mod_g711 src/mod/codecs/mod_g722 src/mod/codecs/mod_g723_1 src/mod/codecs/mod_g726 src/mod/codecs/mod_g729 src/mod/codecs/mod_gsm src/mod/codecs/mod_h26x src/mod/codecs/mod_ilbc src/mod/codecs/mod_l16 src/mod/codecs/mod_lpc10 src/mod/codecs/mod_speex src/mod/dialplans/mod_dialplan_directory src/mod/dialplans/mod_dialplan_xml src/mod/directories/mod_ldap src/mod/endpoints/mod_alsa src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_iax src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_sofia src/mod/endpoints/mod_wanpipe src/mod/endpoints/mod_wanpipe/libsangoma src/mod/endpoints/mod_woomera src/mod/event_handlers/mod_cdr src/mod/event_handlers/mod_event_multicast src/mod/event_handlers/mod_event_socket src/mod/event_handlers/mod_event_test src/mod/event_handlers/mod_radius_cdr src/mod/event_handlers/mod_xmpp_event src/mod/event_handlers/mod_zeroconf src/mod/formats/mod_local_stream src/mod/formats/mod_native_file src/mod/formats/mod_shout src/mod/formats/mod_sndfile src/mod/languages/mod_mono src/mod/languages/mod_perl src/mod/languages/mod_python src/mod/languages/mod_spidermonkey src/mod/languages/mod_spidermonkey_core_db src/mod/languages/mod_spidermonkey_etpan src/mod/languages/mod_spidermonkey_odbc src/mod/languages/mod_spidermonkey_skel src/mod/languages/mod_spidermonkey_socket src/mod/languages/mod_spidermonkey_teletone src/mod/loggers/mod_console src/mod/loggers/mod_syslog src/mod/say/mod_say_en src/mod/timers/mod_softtimer src/mod/xml_int/mod_xml_cdr src/mod/xml_int/mod_xml_curl src/mod/xml_int/mod_xml_rpc w32/Console w32/Library

Freeswitch SVN mikej at freeswitch.org
Fri Sep 21 14:49:18 EDT 2007


Author: mikej
Date: Fri Sep 21 14:49:14 2007
New Revision: 5738

Modified:
   freeswitch/trunk/Freeswitch.sln   (contents, props changed)
   freeswitch/trunk/docs/docs.vcproj   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/adobe-stdenc.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/adobe-symbol.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/adobe-zdingbats.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/big5.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cns11643-plane1.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cns11643-plane14.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cns11643-plane2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp037.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp038.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp10000.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp10006.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp10007.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp10029.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp1006.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp10079.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp10081.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp1026.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp273.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp274.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp275.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp277.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp278.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp280.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp281.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp284.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp285.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp290.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp297.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp420.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp423.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp424.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp437.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp500.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp737.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp775.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp850.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp851.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp852.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp855.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp856.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp857.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp860.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp861.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp862.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp863.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp864.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp865.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp866.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp868.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp869.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp870.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp871.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp874.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp875.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp880.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp891.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp903.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp904.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp905.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp918.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp932.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp936.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp949.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/cp950.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/dec-mcs.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-at-de-a.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-at-de.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-ca-fr.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-dk-no-a.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-dk-no.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-es-a.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-es-s.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-es.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-fi-se-a.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-fi-se.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-fr.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-it.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-pt.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-uk.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ebcdic-us.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/gb12345.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/gb_2312-80.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/hp-roman8.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-1.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-10.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-13.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-14.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-15.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-3.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-4.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-5.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-6.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-7.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-8.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-8859-9.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-10.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-102.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-103.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-11.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-111.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-121.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-122.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-123.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-128.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-13.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-139.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-14.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-141.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-142.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-143.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-146.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-147.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-15.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-150.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-151.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-152.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-153.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-154.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-155.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-158.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-16.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-17.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-18.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-19.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-21.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-25.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-27.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-37.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-4.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-47.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-49.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-50.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-51.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-54.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-55.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-57.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-60.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-61.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-69.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-70.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-8-1.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-8-2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-84.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-85.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-86.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-88.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-89.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-9-1.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-9-2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-90.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-91.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-92.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-93.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-94.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-95.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-96.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-98.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso-ir-99.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso646-dk.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/iso646-kr.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/jis_x0201.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/jis_x0208-1983.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/jis_x0212-1990.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/johab.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/koi8-r.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/koi8-ru.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/koi8-u.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/ksx1001.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-ce.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-croatian.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-cyrillic.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-dingbats.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-greek.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-iceland.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-japan.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-roman.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-romania.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-thai.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-turkish.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/mac-ukraine.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/macintosh.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/osd_ebcdic_df04_1.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/osd_ebcdic_df04_15.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/shift_jis.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/us-ascii.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1250.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1251.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1252.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1253.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1254.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1255.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1256.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1257.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ccs/windows-1258.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/_tbl_simple.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/euc-jp.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/euc-kr.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/euc-tw.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/gb2312.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/iso-10646-ucs-2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/iso-10646-ucs-4.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/iso-2022-cn.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/iso-2022-jp-2.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/iso-2022-jp.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/iso-2022-kr.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/ucs2-internal.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/ucs4-internal.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/unicode-1-1-utf-7.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/utf-16.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/ces/utf-8.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/include/api_version.h   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/include/apr_iconv.h   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/api_version.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/charset_alias.h   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv.h   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_ccs.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_ces.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_ces_euc.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_ces_iso2022.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_int.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_module.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/lib/iconv_uc.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/util/iconv.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/util/iconv_stream.c   (props changed)
   freeswitch/trunk/libs/apr-iconv-1.1.1/util/iconv_stream.h   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_brigade.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_alloc.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_eos.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_file.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_flush.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_heap.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_mmap.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_pipe.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_pool.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_refcount.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_simple.c   (props changed)
   freeswitch/trunk/libs/apr-util/buckets/apr_buckets_socket.c   (props changed)
   freeswitch/trunk/libs/apr-util/crypto/apr_md4.c   (props changed)
   freeswitch/trunk/libs/apr-util/crypto/apr_md5.c   (props changed)
   freeswitch/trunk/libs/apr-util/crypto/apr_sha1.c   (props changed)
   freeswitch/trunk/libs/apr-util/crypto/getuuid.c   (props changed)
   freeswitch/trunk/libs/apr-util/crypto/uuid.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbd/apr_dbd.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbd/apr_dbd_pgsql.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbd/apr_dbd_sqlite2.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbd/apr_dbd_sqlite3.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/apr_dbm.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/apr_dbm_berkeleydb.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/apr_dbm_gdbm.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/apr_dbm_ndbm.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/apr_dbm_sdbm.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm_hash.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm_lock.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm_pair.c   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm_pair.h   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm_private.h   (props changed)
   freeswitch/trunk/libs/apr-util/dbm/sdbm/sdbm_tune.h   (props changed)
   freeswitch/trunk/libs/apr-util/encoding/apr_base64.c   (props changed)
   freeswitch/trunk/libs/apr-util/hooks/apr_hooks.c   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_anylock.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_base64.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_buckets.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_date.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_dbd.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_dbm.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_hooks.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_ldap_init.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_ldap_option.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_ldap_url.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_md4.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_md5.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_optional.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_optional_hooks.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_queue.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_reslist.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_rmm.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_sdbm.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_sha1.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_strmatch.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_uri.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_uuid.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_xlate.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apr_xml.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/apu_version.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/private/apr_dbd_internal.h   (props changed)
   freeswitch/trunk/libs/apr-util/include/private/apr_dbm_private.h   (props changed)
   freeswitch/trunk/libs/apr-util/ldap/apr_ldap_init.c   (props changed)
   freeswitch/trunk/libs/apr-util/ldap/apr_ldap_option.c   (props changed)
   freeswitch/trunk/libs/apr-util/ldap/apr_ldap_url.c   (props changed)
   freeswitch/trunk/libs/apr-util/misc/apr_date.c   (props changed)
   freeswitch/trunk/libs/apr-util/misc/apr_queue.c   (props changed)
   freeswitch/trunk/libs/apr-util/misc/apr_reslist.c   (props changed)
   freeswitch/trunk/libs/apr-util/misc/apr_rmm.c   (props changed)
   freeswitch/trunk/libs/apr-util/misc/apu_version.c   (props changed)
   freeswitch/trunk/libs/apr-util/strmatch/apr_strmatch.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/abts.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/abts.h   (props changed)
   freeswitch/trunk/libs/apr-util/test/abts_tests.h   (props changed)
   freeswitch/trunk/libs/apr-util/test/dbd.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/nw_misc.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/test_apu.h   (props changed)
   freeswitch/trunk/libs/apr-util/test/testbuckets.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testdate.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testdbd.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testdbm.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testldap.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testmd4.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testmd5.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testpass.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testqueue.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testreslist.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testrmm.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/teststrmatch.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testuri.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testutil.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testutil.h   (props changed)
   freeswitch/trunk/libs/apr-util/test/testuuid.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testxlate.c   (props changed)
   freeswitch/trunk/libs/apr-util/test/testxml.c   (props changed)
   freeswitch/trunk/libs/apr-util/uri/apr_uri.c   (props changed)
   freeswitch/trunk/libs/apr-util/xlate/xlate.c   (props changed)
   freeswitch/trunk/libs/apr-util/xml/apr_xml.c   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/ascii.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/asciitab.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/iasciitab.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/latin1tab.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/map_osd_ebcdic_df04_1.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/nametab.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/osd_ebcdic_df04_1.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/utf8tab.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/winconfig.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmlparse.c   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmlrole.c   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmlrole.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmltok.c   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmltok.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmltok_impl.c   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmltok_impl.h   (props changed)
   freeswitch/trunk/libs/apr-util/xml/expat/lib/xmltok_ns.c   (props changed)
   freeswitch/trunk/libs/apr/atomic/netware/apr_atomic.c   (props changed)
   freeswitch/trunk/libs/apr/atomic/os390/atomic.c   (props changed)
   freeswitch/trunk/libs/apr/atomic/unix/apr_atomic.c   (props changed)
   freeswitch/trunk/libs/apr/atomic/win32/apr_atomic.c   (props changed)
   freeswitch/trunk/libs/apr/build/aplibtool.c   (props changed)
   freeswitch/trunk/libs/apr/build/jlibtool.c   (props changed)
   freeswitch/trunk/libs/apr/dso/aix/dso.c   (props changed)
   freeswitch/trunk/libs/apr/dso/beos/dso.c   (props changed)
   freeswitch/trunk/libs/apr/dso/netware/dso.c   (props changed)
   freeswitch/trunk/libs/apr/dso/os2/dso.c   (props changed)
   freeswitch/trunk/libs/apr/dso/os390/dso.c   (props changed)
   freeswitch/trunk/libs/apr/dso/unix/dso.c   (props changed)
   freeswitch/trunk/libs/apr/dso/win32/dso.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/netware/filepath.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/netware/filestat.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/netware/filesys.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/netware/flock.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/netware/mktemp.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/netware/pipe.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/copy.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/dir.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/dir_make_recurse.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/fileacc.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/filedup.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/filepath.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/filepath_util.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/filestat.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/filesys.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/flock.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/fullrw.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/maperrorcode.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/mktemp.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/open.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/pipe.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/readwrite.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/seek.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/os2/tempdir.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/copy.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/dir.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/fileacc.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/filedup.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/filepath.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/filepath_util.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/filestat.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/flock.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/fullrw.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/mktemp.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/open.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/pipe.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/readwrite.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/seek.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/unix/tempdir.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/dir.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/filedup.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/filepath.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/filestat.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/filesys.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/flock.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/open.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/pipe.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/readwrite.c   (props changed)
   freeswitch/trunk/libs/apr/file_io/win32/seek.c   (props changed)
   freeswitch/trunk/libs/apr/include/apr_allocator.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_atomic.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_env.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_errno.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_file_info.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_file_io.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_fnmatch.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_general.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_getopt.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_global_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_hash.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_inherit.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_lib.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_mmap.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_network_io.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_poll.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_pools.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_portable.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_proc_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_random.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_ring.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_shm.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_signal.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_strings.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_support.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_tables.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_thread_cond.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_thread_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_thread_proc.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_thread_rwlock.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_time.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_user.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_version.h   (props changed)
   freeswitch/trunk/libs/apr/include/apr_want.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/aix/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/apr_private_common.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/beos/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/beos/apr_arch_proc_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/beos/apr_arch_thread_cond.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/beos/apr_arch_thread_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/beos/apr_arch_thread_rwlock.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/beos/apr_arch_threadproc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_file_io.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_global_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_internal_time.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_networkio.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_pre_nw.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_proc_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_thread_cond.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_thread_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_thread_rwlock.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_arch_threadproc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/netware/apr_private.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_file_io.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_networkio.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_os2calls.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_proc_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_thread_cond.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_thread_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_thread_rwlock.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os2/apr_arch_threadproc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/os390/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_file_io.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_global_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_inherit.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_internal_time.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_misc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_networkio.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_poll_private.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_shm.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_cond.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_rwlock.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_threadproc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_atime.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_dso.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_file_io.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_inherit.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_misc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_networkio.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_proc_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_thread_cond.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_thread_mutex.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_thread_rwlock.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_threadproc.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_arch_utf8.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_dbg_win32_handles.h   (props changed)
   freeswitch/trunk/libs/apr/include/arch/win32/apr_private.h   (props changed)
   freeswitch/trunk/libs/apr/locks/beos/proc_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/beos/thread_cond.c   (props changed)
   freeswitch/trunk/libs/apr/locks/beos/thread_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/beos/thread_rwlock.c   (props changed)
   freeswitch/trunk/libs/apr/locks/netware/proc_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/netware/thread_cond.c   (props changed)
   freeswitch/trunk/libs/apr/locks/netware/thread_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/netware/thread_rwlock.c   (props changed)
   freeswitch/trunk/libs/apr/locks/os2/proc_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/os2/thread_cond.c   (props changed)
   freeswitch/trunk/libs/apr/locks/os2/thread_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/os2/thread_rwlock.c   (props changed)
   freeswitch/trunk/libs/apr/locks/unix/global_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/unix/proc_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/unix/thread_cond.c   (props changed)
   freeswitch/trunk/libs/apr/locks/unix/thread_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/unix/thread_rwlock.c   (props changed)
   freeswitch/trunk/libs/apr/locks/win32/proc_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/win32/thread_cond.c   (props changed)
   freeswitch/trunk/libs/apr/locks/win32/thread_mutex.c   (props changed)
   freeswitch/trunk/libs/apr/locks/win32/thread_rwlock.c   (props changed)
   freeswitch/trunk/libs/apr/memory/unix/apr_pools.c   (props changed)
   freeswitch/trunk/libs/apr/misc/netware/charset.c   (props changed)
   freeswitch/trunk/libs/apr/misc/netware/libprews.c   (props changed)
   freeswitch/trunk/libs/apr/misc/netware/rand.c   (props changed)
   freeswitch/trunk/libs/apr/misc/netware/start.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/charset.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/env.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/errorcodes.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/getopt.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/otherchild.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/rand.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/start.c   (props changed)
   freeswitch/trunk/libs/apr/misc/unix/version.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/apr_app.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/charset.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/env.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/internal.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/misc.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/rand.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/start.c   (props changed)
   freeswitch/trunk/libs/apr/misc/win32/utf8.c   (props changed)
   freeswitch/trunk/libs/apr/mmap/unix/common.c   (props changed)
   freeswitch/trunk/libs/apr/mmap/unix/mmap.c   (props changed)
   freeswitch/trunk/libs/apr/mmap/win32/mmap.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/beos/sendrecv.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/beos/socketcommon.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/inet_ntop.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/inet_pton.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/os2calls.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/sendrecv.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/sendrecv_udp.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/sockaddr.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/sockets.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/os2/sockopt.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/inet_ntop.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/inet_pton.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/multicast.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/sendrecv.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/sockaddr.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/sockets.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/unix/sockopt.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/win32/sendrecv.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/win32/sockets.c   (props changed)
   freeswitch/trunk/libs/apr/network_io/win32/sockopt.c   (props changed)
   freeswitch/trunk/libs/apr/passwd/apr_getpass.c   (props changed)
   freeswitch/trunk/libs/apr/poll/os2/poll.c   (props changed)
   freeswitch/trunk/libs/apr/poll/os2/pollset.c   (props changed)
   freeswitch/trunk/libs/apr/poll/unix/epoll.c   (props changed)
   freeswitch/trunk/libs/apr/poll/unix/kqueue.c   (props changed)
   freeswitch/trunk/libs/apr/poll/unix/poll.c   (props changed)
   freeswitch/trunk/libs/apr/poll/unix/port.c   (props changed)
   freeswitch/trunk/libs/apr/poll/unix/select.c   (props changed)
   freeswitch/trunk/libs/apr/random/unix/apr_random.c   (props changed)
   freeswitch/trunk/libs/apr/random/unix/sha2.c   (props changed)
   freeswitch/trunk/libs/apr/random/unix/sha2.h   (props changed)
   freeswitch/trunk/libs/apr/random/unix/sha2_glue.c   (props changed)
   freeswitch/trunk/libs/apr/shmem/beos/shm.c   (props changed)
   freeswitch/trunk/libs/apr/shmem/os2/shm.c   (props changed)
   freeswitch/trunk/libs/apr/shmem/unix/shm.c   (props changed)
   freeswitch/trunk/libs/apr/shmem/win32/shm.c   (props changed)
   freeswitch/trunk/libs/apr/strings/apr_cpystrn.c   (props changed)
   freeswitch/trunk/libs/apr/strings/apr_fnmatch.c   (props changed)
   freeswitch/trunk/libs/apr/strings/apr_snprintf.c   (props changed)
   freeswitch/trunk/libs/apr/strings/apr_strings.c   (props changed)
   freeswitch/trunk/libs/apr/strings/apr_strnatcmp.c   (props changed)
   freeswitch/trunk/libs/apr/strings/apr_strtok.c   (props changed)
   freeswitch/trunk/libs/apr/support/unix/waitio.c   (props changed)
   freeswitch/trunk/libs/apr/tables/apr_hash.c   (props changed)
   freeswitch/trunk/libs/apr/tables/apr_tables.c   (props changed)
   freeswitch/trunk/libs/apr/test/abts.c   (props changed)
   freeswitch/trunk/libs/apr/test/abts.h   (props changed)
   freeswitch/trunk/libs/apr/test/abts_tests.h   (props changed)
   freeswitch/trunk/libs/apr/test/globalmutexchild.c   (props changed)
   freeswitch/trunk/libs/apr/test/internal/testregex.c   (props changed)
   freeswitch/trunk/libs/apr/test/internal/testucs.c   (props changed)
   freeswitch/trunk/libs/apr/test/mod_test.c   (props changed)
   freeswitch/trunk/libs/apr/test/nw_misc.c   (props changed)
   freeswitch/trunk/libs/apr/test/occhild.c   (props changed)
   freeswitch/trunk/libs/apr/test/proc_child.c   (props changed)
   freeswitch/trunk/libs/apr/test/readchild.c   (props changed)
   freeswitch/trunk/libs/apr/test/sendfile.c   (props changed)
   freeswitch/trunk/libs/apr/test/sockchild.c   (props changed)
   freeswitch/trunk/libs/apr/test/testapp.c   (props changed)
   freeswitch/trunk/libs/apr/test/testargs.c   (props changed)
   freeswitch/trunk/libs/apr/test/testatomic.c   (props changed)
   freeswitch/trunk/libs/apr/test/testdir.c   (props changed)
   freeswitch/trunk/libs/apr/test/testdso.c   (props changed)
   freeswitch/trunk/libs/apr/test/testdup.c   (props changed)
   freeswitch/trunk/libs/apr/test/testenv.c   (props changed)
   freeswitch/trunk/libs/apr/test/testfile.c   (props changed)
   freeswitch/trunk/libs/apr/test/testfilecopy.c   (props changed)
   freeswitch/trunk/libs/apr/test/testfileinfo.c   (props changed)
   freeswitch/trunk/libs/apr/test/testflock.c   (props changed)
   freeswitch/trunk/libs/apr/test/testflock.h   (props changed)
   freeswitch/trunk/libs/apr/test/testfmt.c   (props changed)
   freeswitch/trunk/libs/apr/test/testfnmatch.c   (props changed)
   freeswitch/trunk/libs/apr/test/testglobalmutex.c   (props changed)
   freeswitch/trunk/libs/apr/test/testglobalmutex.h   (props changed)
   freeswitch/trunk/libs/apr/test/testhash.c   (props changed)
   freeswitch/trunk/libs/apr/test/testipsub.c   (props changed)
   freeswitch/trunk/libs/apr/test/testlfs.c   (props changed)
   freeswitch/trunk/libs/apr/test/testlock.c   (props changed)
   freeswitch/trunk/libs/apr/test/testlockperf.c   (props changed)
   freeswitch/trunk/libs/apr/test/testmmap.c   (props changed)
   freeswitch/trunk/libs/apr/test/testmutexscope.c   (props changed)
   freeswitch/trunk/libs/apr/test/testnames.c   (props changed)
   freeswitch/trunk/libs/apr/test/testoc.c   (props changed)
   freeswitch/trunk/libs/apr/test/testpath.c   (props changed)
   freeswitch/trunk/libs/apr/test/testpipe.c   (props changed)
   freeswitch/trunk/libs/apr/test/testpoll.c   (props changed)
   freeswitch/trunk/libs/apr/test/testpools.c   (props changed)
   freeswitch/trunk/libs/apr/test/testproc.c   (props changed)
   freeswitch/trunk/libs/apr/test/testprocmutex.c   (props changed)
   freeswitch/trunk/libs/apr/test/testrand.c   (props changed)
   freeswitch/trunk/libs/apr/test/testrand2.c   (props changed)
   freeswitch/trunk/libs/apr/test/testshm.c   (props changed)
   freeswitch/trunk/libs/apr/test/testshm.h   (props changed)
   freeswitch/trunk/libs/apr/test/testshmconsumer.c   (props changed)
   freeswitch/trunk/libs/apr/test/testshmproducer.c   (props changed)
   freeswitch/trunk/libs/apr/test/testsleep.c   (props changed)
   freeswitch/trunk/libs/apr/test/testsock.c   (props changed)
   freeswitch/trunk/libs/apr/test/testsock.h   (props changed)
   freeswitch/trunk/libs/apr/test/testsockets.c   (props changed)
   freeswitch/trunk/libs/apr/test/testsockopt.c   (props changed)
   freeswitch/trunk/libs/apr/test/teststr.c   (props changed)
   freeswitch/trunk/libs/apr/test/teststrnatcmp.c   (props changed)
   freeswitch/trunk/libs/apr/test/testtable.c   (props changed)
   freeswitch/trunk/libs/apr/test/testtemp.c   (props changed)
   freeswitch/trunk/libs/apr/test/testthread.c   (props changed)
   freeswitch/trunk/libs/apr/test/testtime.c   (props changed)
   freeswitch/trunk/libs/apr/test/testud.c   (props changed)
   freeswitch/trunk/libs/apr/test/testuser.c   (props changed)
   freeswitch/trunk/libs/apr/test/testutil.c   (props changed)
   freeswitch/trunk/libs/apr/test/testutil.h   (props changed)
   freeswitch/trunk/libs/apr/test/testvsn.c   (props changed)
   freeswitch/trunk/libs/apr/test/tryread.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/beos/apr_proc_stub.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/beos/proc.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/beos/thread.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/beos/threadpriv.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/beos/threadproc_common.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/netware/proc.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/netware/procsup.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/netware/signals.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/netware/thread.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/netware/threadpriv.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/os2/proc.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/os2/signals.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/os2/thread.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/os2/threadpriv.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/unix/proc.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/unix/procsup.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/unix/signals.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/unix/thread.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/unix/threadpriv.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/win32/proc.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/win32/signals.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/win32/thread.c   (props changed)
   freeswitch/trunk/libs/apr/threadproc/win32/threadpriv.c   (props changed)
   freeswitch/trunk/libs/apr/time/unix/time.c   (props changed)
   freeswitch/trunk/libs/apr/time/unix/timestr.c   (props changed)
   freeswitch/trunk/libs/apr/time/win32/access.c   (props changed)
   freeswitch/trunk/libs/apr/time/win32/time.c   (props changed)
   freeswitch/trunk/libs/apr/time/win32/timestr.c   (props changed)
   freeswitch/trunk/libs/apr/user/netware/groupinfo.c   (props changed)
   freeswitch/trunk/libs/apr/user/netware/userinfo.c   (props changed)
   freeswitch/trunk/libs/apr/user/unix/groupinfo.c   (props changed)
   freeswitch/trunk/libs/apr/user/unix/userinfo.c   (props changed)
   freeswitch/trunk/libs/apr/user/win32/groupinfo.c   (props changed)
   freeswitch/trunk/libs/apr/user/win32/userinfo.c   (props changed)
   freeswitch/trunk/libs/codec/g726/libg726.vcproj   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g711.c   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g711.h   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g726_16.c   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g726_24.c   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g726_32.c   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g726_40.c   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g72x.c   (props changed)
   freeswitch/trunk/libs/codec/g726/src/g72x.h   (props changed)
   freeswitch/trunk/libs/codec/g726/src/private.h   (props changed)
   freeswitch/trunk/libs/codec/g7xx/libg7xx.vcproj   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/g711.c   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/g722_decode.c   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/g722_encode.c   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/g726.c   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/include/g7xx/g711.h   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/include/g7xx/g722.h   (props changed)
   freeswitch/trunk/libs/codec/g7xx/src/include/g7xx/g726.h   (props changed)
   freeswitch/trunk/libs/codec/gsm/inc/config.h   (props changed)
   freeswitch/trunk/libs/codec/gsm/inc/gsm.h   (props changed)
   freeswitch/trunk/libs/codec/gsm/inc/private.h   (props changed)
   freeswitch/trunk/libs/codec/gsm/inc/proto.h   (props changed)
   freeswitch/trunk/libs/codec/gsm/inc/unproto.h   (props changed)
   freeswitch/trunk/libs/codec/gsm/libgsm.vcproj   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/add.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/code.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/decode.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/gsm_create.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/gsm_decode.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/gsm_destroy.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/gsm_encode.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/gsm_lpc.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/gsm_option.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/long_term.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/preprocess.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/rpe.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/short_term.c   (props changed)
   freeswitch/trunk/libs/codec/gsm/src/table.c   (props changed)
   freeswitch/trunk/libs/codec/ilbc/libilbc.vcproj   (props changed)
   freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/LPCencode.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/LPCencode.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/anaFilter.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/anaFilter.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/constants.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/constants.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/createCB.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/createCB.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/doCPLC.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/doCPLC.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/enhancer.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/enhancer.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/filter.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/filter.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/gainquant.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/gainquant.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/getCBvec.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/getCBvec.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/helpfun.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/helpfun.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/hpInput.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/hpInput.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/hpOutput.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/hpOutput.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iLBC_define.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/lsf.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/lsf.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/packing.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/packing.h   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/syntFilter.c   (contents, props changed)
   freeswitch/trunk/libs/codec/ilbc/src/syntFilter.h   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/liblpc10.vcproj   (props changed)
   freeswitch/trunk/libs/codec/lpc10/src/analys.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/bsynz.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/chanwr.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/dcbias.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/decode.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/deemp.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/difmag.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/dyptrk.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/encode.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/energy.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/f2c.h   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/f2clib.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/ham84.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/hp100.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/invert.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/irc2pc.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/ivfilt.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/lpc10.h   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/lpcdec.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/lpcenc.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/lpcini.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/lpfilt.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/median.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/mload.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/onset.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/pitsyn.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/placea.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/placev.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/preemp.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/prepro.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/random.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/rcchk.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/synths.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/tbdm.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/voicin.c   (contents, props changed)
   freeswitch/trunk/libs/codec/lpc10/src/vparms.c   (contents, props changed)
   freeswitch/trunk/libs/curl/include/curl/curl.h   (props changed)
   freeswitch/trunk/libs/curl/include/curl/curlver.h   (props changed)
   freeswitch/trunk/libs/curl/include/curl/easy.h   (props changed)
   freeswitch/trunk/libs/curl/include/curl/mprintf.h   (props changed)
   freeswitch/trunk/libs/curl/include/curl/multi.h   (props changed)
   freeswitch/trunk/libs/curl/include/curl/stdcheaders.h   (props changed)
   freeswitch/trunk/libs/curl/include/curl/types.h   (props changed)
   freeswitch/trunk/libs/curl/lib/amigaos.c   (props changed)
   freeswitch/trunk/libs/curl/lib/amigaos.h   (props changed)
   freeswitch/trunk/libs/curl/lib/arpa_telnet.h   (props changed)
   freeswitch/trunk/libs/curl/lib/base64.c   (props changed)
   freeswitch/trunk/libs/curl/lib/base64.h   (props changed)
   freeswitch/trunk/libs/curl/lib/config-amigaos.h   (props changed)
   freeswitch/trunk/libs/curl/lib/config-mac.h   (props changed)
   freeswitch/trunk/libs/curl/lib/config-riscos.h   (props changed)
   freeswitch/trunk/libs/curl/lib/config-tpf.h   (props changed)
   freeswitch/trunk/libs/curl/lib/config-win32.h   (props changed)
   freeswitch/trunk/libs/curl/lib/config-win32ce.h   (props changed)
   freeswitch/trunk/libs/curl/lib/connect.c   (props changed)
   freeswitch/trunk/libs/curl/lib/connect.h   (props changed)
   freeswitch/trunk/libs/curl/lib/content_encoding.c   (props changed)
   freeswitch/trunk/libs/curl/lib/content_encoding.h   (props changed)
   freeswitch/trunk/libs/curl/lib/cookie.c   (props changed)
   freeswitch/trunk/libs/curl/lib/cookie.h   (props changed)
   freeswitch/trunk/libs/curl/lib/curllib.vcproj   (contents, props changed)
   freeswitch/trunk/libs/curl/lib/curlx.h   (props changed)
   freeswitch/trunk/libs/curl/lib/dict.c   (props changed)
   freeswitch/trunk/libs/curl/lib/dict.h   (props changed)
   freeswitch/trunk/libs/curl/lib/easy.c   (props changed)
   freeswitch/trunk/libs/curl/lib/easyif.h   (props changed)
   freeswitch/trunk/libs/curl/lib/escape.c   (props changed)
   freeswitch/trunk/libs/curl/lib/escape.h   (props changed)
   freeswitch/trunk/libs/curl/lib/file.c   (props changed)
   freeswitch/trunk/libs/curl/lib/file.h   (props changed)
   freeswitch/trunk/libs/curl/lib/formdata.c   (props changed)
   freeswitch/trunk/libs/curl/lib/formdata.h   (props changed)
   freeswitch/trunk/libs/curl/lib/ftp.c   (props changed)
   freeswitch/trunk/libs/curl/lib/ftp.h   (props changed)
   freeswitch/trunk/libs/curl/lib/getenv.c   (props changed)
   freeswitch/trunk/libs/curl/lib/getinfo.c   (props changed)
   freeswitch/trunk/libs/curl/lib/getinfo.h   (props changed)
   freeswitch/trunk/libs/curl/lib/gtls.c   (props changed)
   freeswitch/trunk/libs/curl/lib/gtls.h   (props changed)
   freeswitch/trunk/libs/curl/lib/hash.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hash.h   (props changed)
   freeswitch/trunk/libs/curl/lib/hostares.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hostasyn.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hostip.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hostip.h   (props changed)
   freeswitch/trunk/libs/curl/lib/hostip4.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hostip6.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hostsyn.c   (props changed)
   freeswitch/trunk/libs/curl/lib/hostthre.c   (props changed)
   freeswitch/trunk/libs/curl/lib/http.c   (props changed)
   freeswitch/trunk/libs/curl/lib/http.h   (props changed)
   freeswitch/trunk/libs/curl/lib/http_chunks.c   (props changed)
   freeswitch/trunk/libs/curl/lib/http_chunks.h   (props changed)
   freeswitch/trunk/libs/curl/lib/http_digest.c   (props changed)
   freeswitch/trunk/libs/curl/lib/http_digest.h   (props changed)
   freeswitch/trunk/libs/curl/lib/http_negotiate.c   (props changed)
   freeswitch/trunk/libs/curl/lib/http_negotiate.h   (props changed)
   freeswitch/trunk/libs/curl/lib/http_ntlm.c   (props changed)
   freeswitch/trunk/libs/curl/lib/http_ntlm.h   (props changed)
   freeswitch/trunk/libs/curl/lib/if2ip.c   (props changed)
   freeswitch/trunk/libs/curl/lib/if2ip.h   (props changed)
   freeswitch/trunk/libs/curl/lib/inet_ntoa_r.h   (props changed)
   freeswitch/trunk/libs/curl/lib/inet_ntop.c   (props changed)
   freeswitch/trunk/libs/curl/lib/inet_ntop.h   (props changed)
   freeswitch/trunk/libs/curl/lib/inet_pton.c   (props changed)
   freeswitch/trunk/libs/curl/lib/inet_pton.h   (props changed)
   freeswitch/trunk/libs/curl/lib/krb4.c   (props changed)
   freeswitch/trunk/libs/curl/lib/krb4.h   (props changed)
   freeswitch/trunk/libs/curl/lib/ldap.c   (props changed)
   freeswitch/trunk/libs/curl/lib/ldap.h   (props changed)
   freeswitch/trunk/libs/curl/lib/llist.c   (props changed)
   freeswitch/trunk/libs/curl/lib/llist.h   (props changed)
   freeswitch/trunk/libs/curl/lib/md5.c   (props changed)
   freeswitch/trunk/libs/curl/lib/md5.h   (props changed)
   freeswitch/trunk/libs/curl/lib/memdebug.c   (props changed)
   freeswitch/trunk/libs/curl/lib/memdebug.h   (props changed)
   freeswitch/trunk/libs/curl/lib/memory.h   (props changed)
   freeswitch/trunk/libs/curl/lib/mprintf.c   (props changed)
   freeswitch/trunk/libs/curl/lib/multi.c   (props changed)
   freeswitch/trunk/libs/curl/lib/multiif.h   (props changed)
   freeswitch/trunk/libs/curl/lib/netrc.c   (props changed)
   freeswitch/trunk/libs/curl/lib/netrc.h   (props changed)
   freeswitch/trunk/libs/curl/lib/nwlib.c   (props changed)
   freeswitch/trunk/libs/curl/lib/parsedate.c   (props changed)
   freeswitch/trunk/libs/curl/lib/parsedate.h   (props changed)
   freeswitch/trunk/libs/curl/lib/progress.c   (props changed)
   freeswitch/trunk/libs/curl/lib/progress.h   (props changed)
   freeswitch/trunk/libs/curl/lib/security.c   (props changed)
   freeswitch/trunk/libs/curl/lib/select.c   (props changed)
   freeswitch/trunk/libs/curl/lib/select.h   (props changed)
   freeswitch/trunk/libs/curl/lib/sendf.c   (props changed)
   freeswitch/trunk/libs/curl/lib/sendf.h   (props changed)
   freeswitch/trunk/libs/curl/lib/setup.h   (props changed)
   freeswitch/trunk/libs/curl/lib/setup_once.h   (props changed)
   freeswitch/trunk/libs/curl/lib/share.c   (props changed)
   freeswitch/trunk/libs/curl/lib/share.h   (props changed)
   freeswitch/trunk/libs/curl/lib/sockaddr.h   (props changed)
   freeswitch/trunk/libs/curl/lib/socks.c   (props changed)
   freeswitch/trunk/libs/curl/lib/socks.h   (props changed)
   freeswitch/trunk/libs/curl/lib/speedcheck.c   (props changed)
   freeswitch/trunk/libs/curl/lib/speedcheck.h   (props changed)
   freeswitch/trunk/libs/curl/lib/splay.c   (props changed)
   freeswitch/trunk/libs/curl/lib/splay.h   (props changed)
   freeswitch/trunk/libs/curl/lib/sslgen.c   (props changed)
   freeswitch/trunk/libs/curl/lib/sslgen.h   (props changed)
   freeswitch/trunk/libs/curl/lib/ssluse.c   (props changed)
   freeswitch/trunk/libs/curl/lib/ssluse.h   (props changed)
   freeswitch/trunk/libs/curl/lib/strdup.c   (props changed)
   freeswitch/trunk/libs/curl/lib/strdup.h   (props changed)
   freeswitch/trunk/libs/curl/lib/strequal.c   (props changed)
   freeswitch/trunk/libs/curl/lib/strequal.h   (props changed)
   freeswitch/trunk/libs/curl/lib/strerror.c   (props changed)
   freeswitch/trunk/libs/curl/lib/strerror.h   (props changed)
   freeswitch/trunk/libs/curl/lib/strtok.c   (props changed)
   freeswitch/trunk/libs/curl/lib/strtok.h   (props changed)
   freeswitch/trunk/libs/curl/lib/strtoofft.c   (props changed)
   freeswitch/trunk/libs/curl/lib/strtoofft.h   (props changed)
   freeswitch/trunk/libs/curl/lib/telnet.c   (props changed)
   freeswitch/trunk/libs/curl/lib/telnet.h   (props changed)
   freeswitch/trunk/libs/curl/lib/tftp.c   (props changed)
   freeswitch/trunk/libs/curl/lib/tftp.h   (props changed)
   freeswitch/trunk/libs/curl/lib/timeval.c   (props changed)
   freeswitch/trunk/libs/curl/lib/timeval.h   (props changed)
   freeswitch/trunk/libs/curl/lib/transfer.c   (props changed)
   freeswitch/trunk/libs/curl/lib/transfer.h   (props changed)
   freeswitch/trunk/libs/curl/lib/url.c   (props changed)
   freeswitch/trunk/libs/curl/lib/url.h   (props changed)
   freeswitch/trunk/libs/curl/lib/urldata.h   (props changed)
   freeswitch/trunk/libs/curl/lib/version.c   (props changed)
   freeswitch/trunk/libs/curl/packages/vms/config-vms.h   (props changed)
   freeswitch/trunk/libs/curl/packages/vms/curlmsg.h   (props changed)
   freeswitch/trunk/libs/curl/packages/vms/curlmsg_vms.h   (props changed)
   freeswitch/trunk/libs/curl/src/config-amigaos.h   (props changed)
   freeswitch/trunk/libs/curl/src/config-mac.h   (props changed)
   freeswitch/trunk/libs/curl/src/config-riscos.h   (props changed)
   freeswitch/trunk/libs/curl/src/config-win32.h   (props changed)
   freeswitch/trunk/libs/curl/src/getpass.c   (props changed)
   freeswitch/trunk/libs/curl/src/getpass.h   (props changed)
   freeswitch/trunk/libs/curl/src/homedir.c   (props changed)
   freeswitch/trunk/libs/curl/src/homedir.h   (props changed)
   freeswitch/trunk/libs/curl/src/hugehelp.h   (props changed)
   freeswitch/trunk/libs/curl/src/macos/src/curl_GUSIConfig.cpp   (contents, props changed)
   freeswitch/trunk/libs/curl/src/macos/src/macos_main.cpp   (contents, props changed)
   freeswitch/trunk/libs/curl/src/main.c   (props changed)
   freeswitch/trunk/libs/curl/src/setup.h   (props changed)
   freeswitch/trunk/libs/curl/src/urlglob.c   (props changed)
   freeswitch/trunk/libs/curl/src/urlglob.h   (props changed)
   freeswitch/trunk/libs/curl/src/version.h   (props changed)
   freeswitch/trunk/libs/curl/src/writeenv.c   (props changed)
   freeswitch/trunk/libs/curl/src/writeenv.h   (props changed)
   freeswitch/trunk/libs/curl/src/writeout.c   (props changed)
   freeswitch/trunk/libs/curl/src/writeout.h   (props changed)
   freeswitch/trunk/libs/iax/libiax2.vcproj   (props changed)
   freeswitch/trunk/libs/iax/src/answer.h   (props changed)
   freeswitch/trunk/libs/iax/src/busy.h   (props changed)
   freeswitch/trunk/libs/iax/src/dialtone.h   (props changed)
   freeswitch/trunk/libs/iax/src/frame.h   (props changed)
   freeswitch/trunk/libs/iax/src/iax-client.h   (contents, props changed)
   freeswitch/trunk/libs/iax/src/iax-mutex.c   (props changed)
   freeswitch/trunk/libs/iax/src/iax-mutex.h   (props changed)
   freeswitch/trunk/libs/iax/src/iax.c   (props changed)
   freeswitch/trunk/libs/iax/src/iax.h   (contents, props changed)
   freeswitch/trunk/libs/iax/src/iax2-parser.c   (props changed)
   freeswitch/trunk/libs/iax/src/iax2-parser.h   (contents, props changed)
   freeswitch/trunk/libs/iax/src/iax2.h   (contents, props changed)
   freeswitch/trunk/libs/iax/src/jitterbuf.c   (contents, props changed)
   freeswitch/trunk/libs/iax/src/jitterbuf.h   (contents, props changed)
   freeswitch/trunk/libs/iax/src/md5.c   (props changed)
   freeswitch/trunk/libs/iax/src/md5.h   (props changed)
   freeswitch/trunk/libs/iax/src/miniphone.c   (props changed)
   freeswitch/trunk/libs/iax/src/miniphone.h   (props changed)
   freeswitch/trunk/libs/iax/src/options.c   (props changed)
   freeswitch/trunk/libs/iax/src/options.h   (props changed)
   freeswitch/trunk/libs/iax/src/ring10.h   (props changed)
   freeswitch/trunk/libs/iax/src/ringtone.h   (props changed)
   freeswitch/trunk/libs/iax/src/winiphone.c   (props changed)
   freeswitch/trunk/libs/iax/src/winpoop.h   (props changed)
   freeswitch/trunk/libs/iksemel/include/common.h   (props changed)
   freeswitch/trunk/libs/iksemel/include/finetune.h   (props changed)
   freeswitch/trunk/libs/iksemel/include/iksemel.h   (props changed)
   freeswitch/trunk/libs/iksemel/src/base64.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/dom.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/filter.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/iks.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/ikstack.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/io-posix.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/jabber.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/md5.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/sax.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/sha.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/stream.c   (props changed)
   freeswitch/trunk/libs/iksemel/src/utility.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-dom.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-filter.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-iks.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-ikstack.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-jid.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-md5.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-sax.c   (props changed)
   freeswitch/trunk/libs/iksemel/test/tst-sha.c   (props changed)
   freeswitch/trunk/libs/iksemel/tools/hash.c   (props changed)
   freeswitch/trunk/libs/iksemel/tools/ikslint.c   (props changed)
   freeswitch/trunk/libs/iksemel/tools/iksperf.c   (props changed)
   freeswitch/trunk/libs/iksemel/tools/iksroster.c   (props changed)
   freeswitch/trunk/libs/iksemel/tools/perf.c   (props changed)
   freeswitch/trunk/libs/iksemel/tools/perf.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/config/gcc_hidden.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/config/libc_r.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/config/now.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/config/nsinstall.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/config/pathsub.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/config/prdepend.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/ds/plarena.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/ds/plarena.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/ds/plarenas.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/ds/plhash.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/ds/plhash.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/ds/plvrsion.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/include/plbase64.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/include/plerror.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/include/plgetopt.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/include/plresolv.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/include/plstr.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/base64.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/plerror.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/plgetopt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/plvrsion.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strcat.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strccmp.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strchr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strcmp.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strcpy.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strcstr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strdup.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strlen.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strpbrk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strstr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/libc/src/strtok.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/include/gcint.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/include/prgc.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/macgc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/os2gc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/prgcapi.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/prmsgc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/unixgc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/win16gc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/src/win32gc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/tests/gc1.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/msgc/tests/thrashgc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/prstreams/plvrsion.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/prstreams/prstrms.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/prstreams/prstrms.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/prstreams/tests/testprstrm/testprstrm.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/tests/arena.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/tests/base64t.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/tests/string.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/lib/tests/windows/winevent.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/gencfg.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_aix.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_beos.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_bsdi.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_darwin.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_dgux.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_freebsd.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_hpux.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_irix.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_linux.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_macos.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_ncr.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_nec.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_netbsd.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_nextstep.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_nspr_pthread.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_nto.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_openbsd.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_openvms.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_os2.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_os2_errors.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_osf1.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_pcos.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_pth.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_qnx.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_reliantunix.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_rhapsody.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_riscos.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_scoos.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_solaris.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_sony.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_sunos4.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_unix_errors.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_unixos.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_unixware.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_win16.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_win32_errors.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_win95.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/_winnt.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/prosdep.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/md/sunos4.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/nspr.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/obsolete/pralarm.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/obsolete/probslet.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/obsolete/protypes.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/obsolete/prsem.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/pratom.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prbit.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prclist.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prcmon.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prcountr.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prcvar.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prdtoa.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prenv.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prerr.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prerror.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prinet.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prinit.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prinrval.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prio.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/pripcsem.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/private/pprio.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/private/pprmwait.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/private/pprthred.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/private/primpl.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/private/prpriv.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prlink.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prlock.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prlog.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prlong.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prmem.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prmon.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prmwait.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prnetdb.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prolock.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prpdce.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prprf.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prproces.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prrng.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prrwlock.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prshm.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prshma.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prsystem.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prthread.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prtime.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prtpool.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prtrace.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prtypes.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prvrsion.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/include/prwin16.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/bthreads/btcvar.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/bthreads/btlocks.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/bthreads/btmisc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/bthreads/btmon.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/bthreads/btsem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/bthreads/btthread.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcascii.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcbase.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcbase.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rccv.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rccv.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcfileio.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcfileio.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcinrval.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcinrval.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcio.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcio.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rclock.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rclock.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcmon.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcnetdb.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcnetdb.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcnetio.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcnetio.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcthread.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rcthread.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rctime.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/rctime.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/fileio.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/interval.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/ranfile.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/switch.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/thread.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/time.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/cplus/tests/tpd.cpp   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prdir.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prfdcach.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/priometh.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/pripv6.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prlayer.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prlog.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prmapopt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prmmap.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prmwait.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prpolevt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prprf.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prscanf.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prsocket.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/io/prstdio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/linking/prlink.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/malloc/prmalloc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/malloc/prmem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bcpu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/beos.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/beos_errors.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bmemory.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bmisc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bmmap.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bnet.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bproc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/brng.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/bseg.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/beos/btime.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/MacErrorHandling.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macdll.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macdll.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macio.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macrng.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macsocket.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macsockotpt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/macthr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/mactime.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/mactime.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/mdcriticalregion.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/mdcriticalregion.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/mdmac.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/mdmac.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/mac/prcpucfg.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2_errors.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2cv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2gc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2inrval.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2io.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2misc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2poll.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2rng.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2sem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2sock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/os2/os2thred.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/prosdep.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/aix.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/aixwrap.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/bsdi.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/darwin.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/dgux.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/freebsd.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/hpux.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/irix.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/linux.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/ncr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/nec.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/netbsd.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/nextstep.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/nto.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/openbsd.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/openvms.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/osf1.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/pthreads_user.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/qnx.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/reliantunix.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/rhapsody.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/riscos.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/scoos.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/solaris.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/sony.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/sunos4.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/unix.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/unix_errors.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/unixware.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/uxpoll.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/uxproces.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/uxrng.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/uxshm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/unix/uxwrap.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntdllmn.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntgc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntinrval.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntmisc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntsec.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntsem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/ntthread.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16callb.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16error.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16fmem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16gc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16io.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16mem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16null.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16proc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16sock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16stdio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w16thred.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w32ipcsem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w32poll.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w32rng.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w32shm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w95cv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w95dllmain.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w95io.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w95sock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/w95thred.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/md/windows/win32_errors.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/memory/prgcleak.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/memory/prseg.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/memory/prshm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/memory/prshma.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/pralarm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/pratom.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prcountr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prdtoa.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prenv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prerr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prerror.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prerrortable.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prinit.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prinrval.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/pripc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/pripcsem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prlog2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prlong.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prnetdb.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prolock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prrng.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prsystem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prthinfo.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prtime.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prtpool.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/misc/prtrace.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/prvrsion.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/pthreads/ptio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/pthreads/ptmisc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/pthreads/ptsynch.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/pthreads/ptthread.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/combined/prucpu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/combined/prucv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/combined/prulock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/combined/prustack.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/combined/pruthr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prcmon.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prcthr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prdump.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prmon.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prrwlock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prsem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/src/threads/prtpd.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/accept.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/acceptread.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/acceptreademu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/addrstr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/affinity.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/alarm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/anonfm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/append.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/atomic.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/attach.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/bigfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/bigfile2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/bigfile3.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/bug1test.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/cleanup.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/cltsrv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/concur.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/cvar.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/cvar2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dbmalloc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dbmalloc1.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dceemu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/depend.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dll/mygetval.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dll/mysetval.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dlltest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/dtoa.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/env.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/errcodes.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/errset.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/exit.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/fdcach.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/fileio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/foreign.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/forktest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/formattm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/freeif.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/fsync.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/getai.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/gethost.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/getproto.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/i2l.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/initclk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/inrval.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/instrumt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/intrio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/intrupt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/io_timeout.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/io_timeoutk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/io_timeoutu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/ioconthr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/ipv6.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/join.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/joinkk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/joinku.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/joinuk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/joinuu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/layer.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/lazyinit.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/libfilename.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/lltest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/lock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/lockfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/logger.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/makedir.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/many_cv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/mbcs.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/multiacc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/multiwait.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/nameshm1.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/nbconn.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/nblayer.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/nonblock.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/ntioto.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/ntoh.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/obsints.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/op_2long.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/op_excl.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/op_filnf.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/op_filok.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/op_noacc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/op_nofil.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/openfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/parent.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/peek.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/perf.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/pipeping.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/pipeping2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/pipepong.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/pipepong2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/pipeself.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/poll_er.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/poll_nm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/poll_to.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/pollable.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/prftest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/prftest1.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/prftest2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/primblok.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/priotest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/provider.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/prpoll.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/prpollml.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/prselect.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/randseed.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/ranfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/rmdir.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/rwlocktest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sel_spd.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/selct_er.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/selct_nm.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/selct_to.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/select2.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/selintr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sem.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sema.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/semaerr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/semaerr1.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/semaping.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/semapong.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sendzlf.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/server_test.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/servr_kk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/servr_ku.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/servr_uk.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/servr_uu.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/short_thread.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sigpipe.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sleep.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/socket.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sockopt.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sockping.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sockpong.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sprintf.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sproc_ch.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/sproc_p.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/stack.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/stat.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/stdio.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/str2addr.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/strod.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/suspend.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/switch.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/system.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/testbit.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/testfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/threads.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/thrpool_client.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/thrpool_server.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/thruput.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/time.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/timemac.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/timetest.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/tmoacc.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/tmocon.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/tpd.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/udpsrv.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/ut_ttools.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/vercheck.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/version.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/w16gui/popfile.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/w16gui/popfind.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/w16gui/popfont.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/w16gui/poppad.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/w16gui/poppad.h   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/w16gui/popprnt0.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/writev.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/xnotify.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/y2k.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/y2ktmo.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/yield.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/pr/tests/zerolen.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/tools/httpget.c   (props changed)
   freeswitch/trunk/libs/js/nsprpub/tools/tail.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_acos.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_acosh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_asin.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_atan2.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_atanh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_cosh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_exp.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_fmod.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_gamma.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_gamma_r.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_hypot.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_j0.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_j1.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_jn.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_lgamma.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_lgamma_r.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_log.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_log10.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_pow.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_rem_pio2.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_remainder.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_scalb.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_sinh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/e_sqrt.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/fdlibm.h   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/k_cos.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/k_rem_pio2.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/k_sin.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/k_standard.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/k_tan.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_asinh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_atan.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_cbrt.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_ceil.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_copysign.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_cos.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_erf.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_expm1.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_fabs.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_finite.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_floor.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_frexp.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_ilogb.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_isnan.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_ldexp.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_lib_version.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_log1p.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_logb.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_matherr.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_modf.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_nextafter.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_rint.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_scalbn.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_signgam.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_significand.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_sin.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_tan.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/s_tanh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_acos.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_acosh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_asin.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_atan2.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_atanh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_cosh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_exp.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_fmod.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_gamma.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_gamma_r.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_hypot.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_j0.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_j1.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_jn.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_lgamma.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_lgamma_r.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_log.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_log10.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_pow.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_remainder.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_scalb.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_sinh.c   (props changed)
   freeswitch/trunk/libs/js/src/fdlibm/w_sqrt.c   (props changed)
   freeswitch/trunk/libs/js/src/js.c   (props changed)
   freeswitch/trunk/libs/js/src/jsapi.c   (props changed)
   freeswitch/trunk/libs/js/src/jsapi.h   (props changed)
   freeswitch/trunk/libs/js/src/jsarena.c   (props changed)
   freeswitch/trunk/libs/js/src/jsarena.h   (props changed)
   freeswitch/trunk/libs/js/src/jsarray.c   (props changed)
   freeswitch/trunk/libs/js/src/jsarray.h   (props changed)
   freeswitch/trunk/libs/js/src/jsatom.c   (props changed)
   freeswitch/trunk/libs/js/src/jsatom.h   (props changed)
   freeswitch/trunk/libs/js/src/jsbit.h   (props changed)
   freeswitch/trunk/libs/js/src/jsbool.c   (props changed)
   freeswitch/trunk/libs/js/src/jsbool.h   (props changed)
   freeswitch/trunk/libs/js/src/jsclist.h   (props changed)
   freeswitch/trunk/libs/js/src/jscntxt.c   (props changed)
   freeswitch/trunk/libs/js/src/jscntxt.h   (props changed)
   freeswitch/trunk/libs/js/src/jscompat.h   (props changed)
   freeswitch/trunk/libs/js/src/jsconfig.h   (props changed)
   freeswitch/trunk/libs/js/src/jscpucfg.c   (props changed)
   freeswitch/trunk/libs/js/src/jscpucfg.h   (props changed)
   freeswitch/trunk/libs/js/src/jsdate.c   (props changed)
   freeswitch/trunk/libs/js/src/jsdate.h   (props changed)
   freeswitch/trunk/libs/js/src/jsdbgapi.c   (props changed)
   freeswitch/trunk/libs/js/src/jsdbgapi.h   (props changed)
   freeswitch/trunk/libs/js/src/jsdhash.c   (props changed)
   freeswitch/trunk/libs/js/src/jsdhash.h   (props changed)
   freeswitch/trunk/libs/js/src/jsdso.c   (props changed)
   freeswitch/trunk/libs/js/src/jsdso.h   (props changed)
   freeswitch/trunk/libs/js/src/jsdtoa.c   (props changed)
   freeswitch/trunk/libs/js/src/jsdtoa.h   (props changed)
   freeswitch/trunk/libs/js/src/jsemit.c   (props changed)
   freeswitch/trunk/libs/js/src/jsemit.h   (props changed)
   freeswitch/trunk/libs/js/src/jsexn.c   (props changed)
   freeswitch/trunk/libs/js/src/jsexn.h   (props changed)
   freeswitch/trunk/libs/js/src/jsfile.c   (props changed)
   freeswitch/trunk/libs/js/src/jsfile.h   (props changed)
   freeswitch/trunk/libs/js/src/jsfun.c   (props changed)
   freeswitch/trunk/libs/js/src/jsfun.h   (props changed)
   freeswitch/trunk/libs/js/src/jsgc.c   (props changed)
   freeswitch/trunk/libs/js/src/jsgc.h   (props changed)
   freeswitch/trunk/libs/js/src/jshash.c   (props changed)
   freeswitch/trunk/libs/js/src/jshash.h   (props changed)
   freeswitch/trunk/libs/js/src/jsinterp.c   (props changed)
   freeswitch/trunk/libs/js/src/jsinterp.h   (props changed)
   freeswitch/trunk/libs/js/src/jslibmath.h   (props changed)
   freeswitch/trunk/libs/js/src/jslock.c   (props changed)
   freeswitch/trunk/libs/js/src/jslock.h   (props changed)
   freeswitch/trunk/libs/js/src/jslog2.c   (props changed)
   freeswitch/trunk/libs/js/src/jslong.c   (props changed)
   freeswitch/trunk/libs/js/src/jslong.h   (props changed)
   freeswitch/trunk/libs/js/src/jsmath.c   (props changed)
   freeswitch/trunk/libs/js/src/jsmath.h   (props changed)
   freeswitch/trunk/libs/js/src/jsnum.c   (props changed)
   freeswitch/trunk/libs/js/src/jsnum.h   (props changed)
   freeswitch/trunk/libs/js/src/jsobj.c   (props changed)
   freeswitch/trunk/libs/js/src/jsobj.h   (props changed)
   freeswitch/trunk/libs/js/src/jsopcode.c   (props changed)
   freeswitch/trunk/libs/js/src/jsopcode.h   (props changed)
   freeswitch/trunk/libs/js/src/jsosdep.h   (props changed)
   freeswitch/trunk/libs/js/src/jsotypes.h   (props changed)
   freeswitch/trunk/libs/js/src/jsparse.c   (props changed)
   freeswitch/trunk/libs/js/src/jsparse.h   (props changed)
   freeswitch/trunk/libs/js/src/jsprf.c   (props changed)
   freeswitch/trunk/libs/js/src/jsprf.h   (props changed)
   freeswitch/trunk/libs/js/src/jsprvtd.h   (props changed)
   freeswitch/trunk/libs/js/src/jspubtd.h   (props changed)
   freeswitch/trunk/libs/js/src/jsregexp.c   (props changed)
   freeswitch/trunk/libs/js/src/jsregexp.h   (props changed)
   freeswitch/trunk/libs/js/src/jsscan.c   (props changed)
   freeswitch/trunk/libs/js/src/jsscan.h   (props changed)
   freeswitch/trunk/libs/js/src/jsscope.c   (props changed)
   freeswitch/trunk/libs/js/src/jsscope.h   (props changed)
   freeswitch/trunk/libs/js/src/jsscript.c   (props changed)
   freeswitch/trunk/libs/js/src/jsscript.h   (props changed)
   freeswitch/trunk/libs/js/src/jsstddef.h   (props changed)
   freeswitch/trunk/libs/js/src/jsstr.c   (props changed)
   freeswitch/trunk/libs/js/src/jsstr.h   (props changed)
   freeswitch/trunk/libs/js/src/jstypes.h   (props changed)
   freeswitch/trunk/libs/js/src/jsutil.c   (props changed)
   freeswitch/trunk/libs/js/src/jsutil.h   (props changed)
   freeswitch/trunk/libs/js/src/jsxdrapi.c   (props changed)
   freeswitch/trunk/libs/js/src/jsxdrapi.h   (props changed)
   freeswitch/trunk/libs/js/src/jsxml.c   (props changed)
   freeswitch/trunk/libs/js/src/jsxml.h   (props changed)
   freeswitch/trunk/libs/js/src/perlconnect/jsperl.c   (props changed)
   freeswitch/trunk/libs/js/src/perlconnect/jsperl.h   (props changed)
   freeswitch/trunk/libs/js/src/perlconnect/jsperlpvt.h   (props changed)
   freeswitch/trunk/libs/js/src/prmjtime.c   (props changed)
   freeswitch/trunk/libs/js/src/prmjtime.h   (props changed)
   freeswitch/trunk/libs/libdingaling/docs/docs.vcproj   (props changed)
   freeswitch/trunk/libs/libdingaling/libdingaling.vcproj   (props changed)
   freeswitch/trunk/libs/libdingaling/src/ldl_compat.h   (props changed)
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c   (props changed)
   freeswitch/trunk/libs/libdingaling/src/libdingaling.h   (props changed)
   freeswitch/trunk/libs/libdingaling/src/sha1.c   (props changed)
   freeswitch/trunk/libs/libdingaling/src/sha1.h   (contents, props changed)
   freeswitch/trunk/libs/libedit/examples/fileman.c   (props changed)
   freeswitch/trunk/libs/libedit/examples/test.c   (props changed)
   freeswitch/trunk/libs/libedit/src/chared.c   (props changed)
   freeswitch/trunk/libs/libedit/src/chared.h   (props changed)
   freeswitch/trunk/libs/libedit/src/common.c   (props changed)
   freeswitch/trunk/libs/libedit/src/editline/readline.h   (props changed)
   freeswitch/trunk/libs/libedit/src/el.c   (props changed)
   freeswitch/trunk/libs/libedit/src/el.h   (props changed)
   freeswitch/trunk/libs/libedit/src/el_term.h   (props changed)
   freeswitch/trunk/libs/libedit/src/emacs.c   (props changed)
   freeswitch/trunk/libs/libedit/src/fgetln.c   (props changed)
   freeswitch/trunk/libs/libedit/src/filecomplete.c   (props changed)
   freeswitch/trunk/libs/libedit/src/filecomplete.h   (props changed)
   freeswitch/trunk/libs/libedit/src/hist.c   (props changed)
   freeswitch/trunk/libs/libedit/src/hist.h   (props changed)
   freeswitch/trunk/libs/libedit/src/histedit.h   (props changed)
   freeswitch/trunk/libs/libedit/src/history.c   (props changed)
   freeswitch/trunk/libs/libedit/src/key.c   (props changed)
   freeswitch/trunk/libs/libedit/src/key.h   (props changed)
   freeswitch/trunk/libs/libedit/src/map.c   (props changed)
   freeswitch/trunk/libs/libedit/src/map.h   (props changed)
   freeswitch/trunk/libs/libedit/src/parse.c   (props changed)
   freeswitch/trunk/libs/libedit/src/parse.h   (props changed)
   freeswitch/trunk/libs/libedit/src/prompt.c   (props changed)
   freeswitch/trunk/libs/libedit/src/prompt.h   (props changed)
   freeswitch/trunk/libs/libedit/src/read.c   (props changed)
   freeswitch/trunk/libs/libedit/src/read.h   (props changed)
   freeswitch/trunk/libs/libedit/src/readline.c   (props changed)
   freeswitch/trunk/libs/libedit/src/refresh.c   (props changed)
   freeswitch/trunk/libs/libedit/src/refresh.h   (props changed)
   freeswitch/trunk/libs/libedit/src/search.c   (props changed)
   freeswitch/trunk/libs/libedit/src/search.h   (props changed)
   freeswitch/trunk/libs/libedit/src/sig.c   (props changed)
   freeswitch/trunk/libs/libedit/src/sig.h   (props changed)
   freeswitch/trunk/libs/libedit/src/strlcat.c   (props changed)
   freeswitch/trunk/libs/libedit/src/strlcpy.c   (props changed)
   freeswitch/trunk/libs/libedit/src/sys.h   (props changed)
   freeswitch/trunk/libs/libedit/src/term.c   (props changed)
   freeswitch/trunk/libs/libedit/src/tokenizer.c   (props changed)
   freeswitch/trunk/libs/libedit/src/tty.c   (props changed)
   freeswitch/trunk/libs/libedit/src/tty.h   (props changed)
   freeswitch/trunk/libs/libedit/src/unvis.c   (props changed)
   freeswitch/trunk/libs/libedit/src/vi.c   (props changed)
   freeswitch/trunk/libs/libedit/src/vis.c   (props changed)
   freeswitch/trunk/libs/libedit/src/vis.h   (props changed)
   freeswitch/trunk/libs/libetpan/build-windows/StdAfx.h   (props changed)
   freeswitch/trunk/libs/libetpan/build-windows/libetpan-config.h   (props changed)
   freeswitch/trunk/libs/libetpan/build-windows/libetpan/libetpan.vcproj   (contents, props changed)
   freeswitch/trunk/libs/libetpan/build-windows/libetpan_version.h   (props changed)
   freeswitch/trunk/libs/libetpan/build-windows/readmsg/readmsg.vcproj   (contents, props changed)
   freeswitch/trunk/libs/libetpan/build-windows/smtpsend/smtpsend.vcproj   (contents, props changed)
   freeswitch/trunk/libs/libetpan/src/bsd/getopt.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/bsd/getopt.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/bsd/getopt_long.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/base64.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/base64.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/carray.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/carray.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/charconv.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/charconv.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/chash.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/chash.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/cinthash.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/cinthash.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/clist.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/clist.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/connect.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/connect.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/hmac-md5.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mail.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mail_cache_db.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mail_cache_db.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mail_cache_db_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/maillock.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/maillock.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailsasl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailsasl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailsem.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailsem.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_low.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_low.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_socket.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_socket.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_ssl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_ssl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mailstream_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mapping.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mapping.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/md5.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/md5.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/md5global.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mmapstring.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/data-types/mmapstring.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/data-message/data_message_driver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/data-message/data_message_driver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbdriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbdriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbdriver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbdriver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbdriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/db/dbstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/hotmail/hotmailstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/hotmail/hotmailstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_cached.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_cached.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_cached_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_cached_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapdriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/imap/imapstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_cached.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_cached.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_cached_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_cached_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirdriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/maildir/maildirstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_cached.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_cached.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_cached_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_cached_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxdriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mbox/mboxstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_cached.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_cached.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_cached_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_cached_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhdriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mh/mhstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mime-message/mime_message_driver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/mime-message/mime_message_driver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_cached.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_cached.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_cached_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_cached_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpdriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/nntp/nntpstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_cached.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_cached.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_cached_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_cached_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_message.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_message.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3driver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3storage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/implementation/pop3/pop3storage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_errors.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_types_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/maildriver_types_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailfolder.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailfolder.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailmessage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailmessage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailmessage_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailmessage_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailmessage_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailmessage_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailstorage.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailstorage.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailstorage_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailstorage_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/interface/mailstorage_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/generic_cache.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/generic_cache.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/generic_cache_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/imfcache.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/imfcache.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/mailthread.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/mailthread.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/mailthread_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/driver/tools/mailthread_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailengine.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailengine.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_gnupg.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_gnupg.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_smime.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_smime.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_tools.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_tools.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/engine/mailprivacy_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl_parser.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl_parser.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl_sender.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl_sender.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/acl_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore_parser.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore_parser.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore_sender.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore_sender.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/annotatemore_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_extension.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_extension.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_extension_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_keywords.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_keywords.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_parser.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_parser.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_print.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_print.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_sender.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_sender.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_socket.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_socket.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_ssl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_ssl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_types_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/mailimap_types_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus_parser.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus_parser.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus_sender.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus_sender.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imap/uidplus_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_types_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_types_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write_file.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write_file.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write_generic.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write_generic.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write_mem.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/imf/mailimf_write_mem.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/maildir/maildir.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/maildir/maildir.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/maildir/maildir_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mbox/mailmbox.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mbox/mailmbox.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mbox/mailmbox_parse.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mbox/mailmbox_parse.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mbox/mailmbox_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mbox/mailmbox_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mh/mailmh.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mh/mailmh.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_content.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_content.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_decode.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_decode.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_disposition.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_disposition.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_types.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_types_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_types_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write_file.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write_file.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write_generic.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write_generic.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write_mem.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/mime/mailmime_write_mem.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp_socket.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp_socket.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp_ssl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp_ssl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/nntp/newsnntp_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_socket.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_socket.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_ssl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_ssl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/pop3/mailpop3_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_helper.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_helper.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_socket.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_socket.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_ssl.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_ssl.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/low-level/smtp/mailsmtp_types.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/main/libetpan.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/main/libetpan_version.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/windows/dirent.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/windows/misc.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/windows/mmap.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/windows/time_r.c   (props changed)
   freeswitch/trunk/libs/libetpan/src/windows/win_etpan.h   (props changed)
   freeswitch/trunk/libs/libetpan/src/windows/wsocket.cpp   (props changed)
   freeswitch/trunk/libs/libetpan/tests/compose-msg.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/decrypt.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/fetch-attachment.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/frm-common.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/frm-common.h   (props changed)
   freeswitch/trunk/libs/libetpan/tests/frm-simple.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/frm-tree.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/frm.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/option-parser.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/option-parser.h   (props changed)
   freeswitch/trunk/libs/libetpan/tests/pgp.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/readmsg-common.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/readmsg-common.h   (props changed)
   freeswitch/trunk/libs/libetpan/tests/readmsg-simple.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/readmsg-uid.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/readmsg.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/smime.c   (props changed)
   freeswitch/trunk/libs/libetpan/tests/smtpsend.c   (props changed)
   freeswitch/trunk/libs/libresample/include/libresample.h   (props changed)
   freeswitch/trunk/libs/libresample/src/filterkit.c   (props changed)
   freeswitch/trunk/libs/libresample/src/filterkit.h   (props changed)
   freeswitch/trunk/libs/libresample/src/resample.c   (props changed)
   freeswitch/trunk/libs/libresample/src/resample_defs.h   (props changed)
   freeswitch/trunk/libs/libresample/src/resamplesubs.c   (props changed)
   freeswitch/trunk/libs/libresample/tests/compareresample.c   (props changed)
   freeswitch/trunk/libs/libresample/tests/resample-sndfile.c   (props changed)
   freeswitch/trunk/libs/libresample/tests/testresample.c   (props changed)
   freeswitch/trunk/libs/libsndfile/Win32/testprog.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/cooledit-fixer.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/generate.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/list_formats.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/make_sine.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/sfprocess.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/sndfile-convert.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/sndfile-info.c   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/sndfile-play-beos.cpp   (props changed)
   freeswitch/trunk/libs/libsndfile/examples/sndfile-play.c   (props changed)
   freeswitch/trunk/libs/libsndfile/regtest/checksum.c   (props changed)
   freeswitch/trunk/libs/libsndfile/regtest/database.c   (props changed)
   freeswitch/trunk/libs/libsndfile/regtest/regtest.h   (props changed)
   freeswitch/trunk/libs/libsndfile/regtest/sndfile-regtest.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g721.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g723_16.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g723_24.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g723_40.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g72x.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g72x.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g72x_priv.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/G72x/g72x_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/add.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/code.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/config.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/decode.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm610_priv.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_create.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_decode.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_destroy.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_encode.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_option.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/long_term.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/lpc.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/preprocess.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/rpe.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/short_term.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/GSM610/table.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/aiff.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/alaw.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/au.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/avr.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/broadcast.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/caf.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/command.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/common.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/common.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/dither.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/double64.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/dwd.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/dwvw.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/file_io.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/flac.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/float32.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/float_cast.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/g72x.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/gsm610.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/htk.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/ima_adpcm.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/interleave.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/ircam.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/macbinary3.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/macos.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/mat4.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/mat5.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/ms_adpcm.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/nist.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/ogg.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/paf.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/pcm.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/pvf.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/raw.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/rx2.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/sd2.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/sds.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/sf_unistd.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/sfconfig.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/sfendian.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/sndfile.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/strings.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/svx.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/test_endswap.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/test_file_io.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/test_log_printf.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/txw.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/ulaw.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/voc.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/vox_adpcm.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/w64.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/wav.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/wav_w64.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/wav_w64.h   (props changed)
   freeswitch/trunk/libs/libsndfile/src/wve.c   (props changed)
   freeswitch/trunk/libs/libsndfile/src/xi.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/aiff_rw_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/alaw_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/benchmark.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/command_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/dft_cmp.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/dft_cmp.h   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/dither_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/dwvw_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/error_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/fix_this.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/floating_point_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/header_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/headerless_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/largefile_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/locale_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/lossy_comp_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/misc_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/multi_file_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/open_fail_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/pcm_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/peak_chunk_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/pipe_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/raw_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/scale_clip_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/sfversion.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/stdin_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/stdio_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/stdout_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/string_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/ulaw_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/utils.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/utils.h   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/virtual_io_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/win32_ordinal_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/win32_test.c   (props changed)
   freeswitch/trunk/libs/libsndfile/tests/write_read_test.c   (props changed)
   freeswitch/trunk/libs/libspeakup/jitterbuffer.vcproj   (props changed)
   freeswitch/trunk/libs/libspeakup/src/jb_speakup.c   (props changed)
   freeswitch/trunk/libs/libspeakup/src/jb_speakup.h   (props changed)
   freeswitch/trunk/libs/libteletone/libteletone.vcproj   (props changed)
   freeswitch/trunk/libs/libteletone/src/libteletone.h   (props changed)
   freeswitch/trunk/libs/libteletone/src/libteletone_detect.c   (props changed)
   freeswitch/trunk/libs/libteletone/src/libteletone_detect.h   (props changed)
   freeswitch/trunk/libs/libteletone/src/libteletone_generate.c   (props changed)
   freeswitch/trunk/libs/libteletone/src/libteletone_generate.h   (props changed)
   freeswitch/trunk/libs/pcre/dftables.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre.h   (props changed)
   freeswitch/trunk/libs/pcre/pcre_compile.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_config.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_dfa_exec.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_exec.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_fullinfo.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_get.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_globals.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_info.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_internal.h   (props changed)
   freeswitch/trunk/libs/pcre/pcre_maketables.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_ord2utf8.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_refcount.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_scanner.h   (props changed)
   freeswitch/trunk/libs/pcre/pcre_study.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_tables.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_try_flipped.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_ucp_searchfuncs.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_valid_utf8.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_version.c   (props changed)
   freeswitch/trunk/libs/pcre/pcre_xclass.c   (props changed)
   freeswitch/trunk/libs/pcre/pcrecpp.h   (props changed)
   freeswitch/trunk/libs/pcre/pcredemo.c   (props changed)
   freeswitch/trunk/libs/pcre/pcregrep.c   (props changed)
   freeswitch/trunk/libs/pcre/pcreposix.c   (props changed)
   freeswitch/trunk/libs/pcre/pcreposix.h   (props changed)
   freeswitch/trunk/libs/pcre/pcretest.c   (props changed)
   freeswitch/trunk/libs/pcre/ucp.h   (props changed)
   freeswitch/trunk/libs/pcre/ucpinternal.h   (props changed)
   freeswitch/trunk/libs/pcre/ucptable.c   (props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/build/vc7_1/devs_example.vcproj   (props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/build/vc7_1/sine_example.vcproj   (props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/build/vc7_1/static_library.vcproj   (props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/example/devs.cxx   (props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/example/sine.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/BlockingStream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackStream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Device.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Exception.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/HostApi.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Stream.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/StreamParameters.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/System.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx   (contents, props changed)
   freeswitch/trunk/libs/portaudio/build/msvc/portaudio.vcproj   (props changed)
   freeswitch/trunk/libs/portaudio/include/pa_asio.h   (props changed)
   freeswitch/trunk/libs/portaudio/include/pa_linux_alsa.h   (props changed)
   freeswitch/trunk/libs/portaudio/include/pa_mac_core.h   (props changed)
   freeswitch/trunk/libs/portaudio/include/pa_win_wmme.h   (props changed)
   freeswitch/trunk/libs/portaudio/include/portaudio.h   (props changed)
   freeswitch/trunk/libs/portaudio/pablio/pablio.c   (props changed)
   freeswitch/trunk/libs/portaudio/pablio/pablio.h   (props changed)
   freeswitch/trunk/libs/portaudio/pablio/test_rw.c   (props changed)
   freeswitch/trunk/libs/portaudio/pablio/test_rw_echo.c   (props changed)
   freeswitch/trunk/libs/portaudio/pablio/test_w_saw.c   (props changed)
   freeswitch/trunk/libs/portaudio/pablio/test_w_saw8.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_allocation.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_allocation.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_converters.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_converters.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_cpuload.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_cpuload.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.c   (contents, props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.h   (contents, props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_dither.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_dither.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_endianness.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_front.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_hostapi.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_process.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_process.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_ringbuffer.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_ringbuffer.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_skeleton.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_stream.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_stream.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_trace.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_trace.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_types.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/common/pa_util.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/alsa/pa_linux_alsa.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/asio/iasiothiscallresolver.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/asio/pa_asio.cpp   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c   (contents, props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h   (contents, props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/dsound/pa_win_ds.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/jack/pa_jack.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/oss/pa_unix_oss.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/oss/recplay.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp   (contents, props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/wdmks/pa_win_wdmks.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/hostapi/wmme/pa_win_wmme.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/mac_osx/pa_mac_hostapis.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/unix/pa_unix_hostapis.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/unix/pa_unix_util.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/unix/pa_unix_util.h   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/win/pa_win_hostapis.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/win/pa_win_util.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/win/pa_x86_plain_converters.c   (props changed)
   freeswitch/trunk/libs/portaudio/src/os/win/pa_x86_plain_converters.h   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_convert.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_dither_calc.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_dual.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_multi_in.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_multi_out.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_record.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_record_reuse.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_sine.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_sine_amp.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_sine_formats.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_srate.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/debug_test1.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/pa_devs.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/pa_fuzz.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/pa_minlat.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/paqa_devs.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/paqa_errs.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest1.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_buffer.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_callbackstop.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_clip.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_dither.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_hang.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_in_overflow.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_latency.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_leftright.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_longsine.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_many.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_maxsines.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_mono.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_mono_asio_channel_select.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_multi_sine.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_out_underflow.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_pink.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_prime.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_read_record.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_read_write_wire.c   (contents, props changed)
   freeswitch/trunk/libs/portaudio/test/patest_record.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_ringmix.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_saw.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_sine.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_sine8.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_sine_formats.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_sine_time.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_start_stop.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_stop.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_stop_playout.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_sync.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_timing.c   (contents, props changed)
   freeswitch/trunk/libs/portaudio/test/patest_toomanysines.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_two_rates.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_underflow.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_wire.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_write_sine.c   (props changed)
   freeswitch/trunk/libs/portaudio/test/patest_write_stop.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_glib.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/sofia-sip/su_source.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source_test.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/torture_su_glib_timer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/bnf.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/hostdomain.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/bnf/torture_bnf.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/features/features.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_extra.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_header.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_inlined.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_parser.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_status.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/http_tag_class.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_hclasses.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_header.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_parser.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_status.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http_tag_class.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/http/test_http.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/base64.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/rc4.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/base64.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/rc4.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/token64.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/uniqueid.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/sofia-sip/utf8.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/token64.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/torture_base64.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/ucs2.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/ucs4.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/utf8.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/utf8internal.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/ipt/utf8test.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client_ntlm.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_digest.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_http.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module_sip.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_ntlm.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_delayed.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_plugin_ntlm.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/iptsec_debug.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_client_plugin.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_common.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_digest.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_module.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_ntlm.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/sofia-sip/auth_plugin.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/test_auth_digest.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_date.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_make.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_inlined.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_internal.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_name_hash.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_addr.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_buffer.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_date.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mclass_hash.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_tag_class.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_types.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_class.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_class.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_inlined.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_debug.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_debug.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_event.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip/nea.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/sofia-sip/nea_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_check.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_compat.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_compat.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_internal.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/portbind.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sl_read_payload.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_log.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sl_utils_print.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_stateless.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta_tport.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/sl_utils.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/test_nta.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/http-client.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/http-server.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/nth_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/sofia-sip/nth_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nth/test_nth.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_extension.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_message.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_options.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_registrar.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_100rel.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_basic_call.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_call_hold.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_call_reject.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_cancel_bye.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_extension.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_init.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nat.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nat.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nat_tags.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_api.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_nua_params.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_offer_answer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_ops.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_proxy.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_refer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_register.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_session_timer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_simple.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/test_sip_events.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sofia-sip/sdp_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/test_sdp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/torture_sdp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_basic.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_caller_prefs.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_event.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_extra.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_feature.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_header.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_inlined.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_mime.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_prack.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_pref_util.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_reason.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_refer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_security.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_session.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_status.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_tag_class.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_time.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_util.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_header.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_status.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_tag_class.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_util.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/test_date.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/test_sip_msg.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/torture_sip.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/validator.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_asynch.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_add.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_session.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/sofia-sip/soa_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/resolve_sip.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_async.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_cache.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_config.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-resolv/sres_record.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sofia-sip/sresolv.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_blocking.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_cache.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sresolv.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/test_sresolv.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/torture_sresolv.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/lookup_stun_server.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun_common.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/sofia-sip/stun_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_common.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_internal.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_mini.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stun_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/stun/stunc.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/addrinfo.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/getopt.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c   (contents, props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/inet_pton.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/localinfo.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memccpy.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memcspn.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memmem.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/memspn.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/poll.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/heap.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/htable2.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/rbtree.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/string0.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_addrinfo.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_alloc_stat.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_bm.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_config.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_debug.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_errno.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_localinfo.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_log.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_md5.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_os_nw.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_osx_runloop.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_strlst.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_class.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_inline.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tag_io.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_tagarg.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_time.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_types.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_uniqueid.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_vector.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/su_wait.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/sofia-sip/tstdef.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/strcasestr.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/string0.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_addrinfo.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc_lock.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_base_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_bm.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_default_log.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_devpoll_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_epoll_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_errno.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_global_log.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_log.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_md5.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_module_debug.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp   (contents, props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_os_nw.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_osx_runloop.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_perf.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_poll_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_proxy.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_select_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_sprintf.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_strdup.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_strlst.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_tag_io.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_time.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_time0.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_vector.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_wait.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_win32_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_htable.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_memmem.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_poll.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_su.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/test_su_osx.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_heap.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_rbtree.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_alloc.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_bm.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_port.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_root_osx.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_time.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/torture_su_timer.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_plugins.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/sofia-sip/tport_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/test_tport.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_client.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tls_test_server.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_logging.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_rand.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_sigcomp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_sigcomp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_stub_stun.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tls.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/sofia-sip/url_tag_class.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/torture_url.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url_tag.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/urlmap.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/urlmap.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/open_c/sofia-sip/su_configure.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/utils/apps_utils.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/utils/sip-date.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/utils/sip-options.c   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/libsofia-sip-ua-static/libsofia_sip_ua_static.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/libsofia-sip-ua/libsofia_sip_ua.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/sofia-sip/su_configure.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_htable/test_htable.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_memmem/test_memmem.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_nta/test_nta.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_nua/test_nat_tags.cpp   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_nua/test_nua.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_su/test_su.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_tport/test_class.cpp   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_tport/test_table.cpp   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/test_tport/test_tport.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_rbtree/torture_rbtree.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su/torture_su.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_alloc/torture_su_alloc.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_bm/torture_su_bm.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_port/torture_su_port.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_root/torture_su_root.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_tag/torture_su_tag.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_time/torture_su_time.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/tests/torture_su_timer/torture_su_timer.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/unistd.h   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/utils/localinfo/localinfo.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/utils/sip_dig/sip_dig.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/utils/sip_options/sip_options.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/utils/sip_options_static/sip_options_static.vcproj   (props changed)
   freeswitch/trunk/libs/sofia-sip/win32/utils/stunc/stunc.vcproj   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_bits.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_callbacks.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_echo.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_header.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_jitter.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_preprocess.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_stereo.h   (props changed)
   freeswitch/trunk/libs/speex/include/speex/speex_types.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/_kiss_fft_guts.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/arch.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/bits.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/cb_search.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/cb_search.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/cb_search_arm4.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/cb_search_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/cb_search_sse.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/exc_10_16_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/exc_10_32_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/exc_20_32_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/exc_5_256_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/exc_5_64_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/exc_8_128_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fftwrap.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fftwrap.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/filters.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/filters.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/filters_arm4.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/filters_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/filters_sse.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fixed_arm4.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fixed_arm5e.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fixed_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fixed_debug.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/fixed_generic.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/gain_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/gain_table_lbr.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/hexc_10_32_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/hexc_table.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/high_lsp_tables.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/jitter.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/kiss_fft.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/kiss_fft.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/kiss_fftr.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/kiss_fftr.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lbr_48k_tables.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lpc.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lpc.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lpc_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lsp.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lsp.h   (contents, props changed)
   freeswitch/trunk/libs/speex/libspeex/lsp_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/lsp_tables_nb.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/ltp.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/ltp.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/ltp_arm4.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/ltp_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/ltp_sse.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/math_approx.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/math_approx.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/mdf.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/misc.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/misc.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/misc_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/modes.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/modes.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/nb_celp.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/nb_celp.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/preprocess.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/pseudofloat.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/quant_lsp.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/quant_lsp.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/quant_lsp_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/sb_celp.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/sb_celp.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/smallft.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/smallft.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/speex.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/speex_callbacks.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/speex_header.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/stack_alloc.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/stereo.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/testdenoise.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/testecho.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/testenc.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/testenc_uwb.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/testenc_wb.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vbr.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vbr.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vorbis_psy.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vorbis_psy.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vq.c   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vq.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vq_arm4.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vq_bfin.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/vq_sse.h   (props changed)
   freeswitch/trunk/libs/speex/libspeex/window.c   (props changed)
   freeswitch/trunk/libs/speex/src/getopt.c   (contents, props changed)
   freeswitch/trunk/libs/speex/src/getopt1.c   (contents, props changed)
   freeswitch/trunk/libs/speex/src/getopt_win.h   (contents, props changed)
   freeswitch/trunk/libs/speex/src/skeleton.c   (props changed)
   freeswitch/trunk/libs/speex/src/skeleton.h   (props changed)
   freeswitch/trunk/libs/speex/src/speexdec.c   (props changed)
   freeswitch/trunk/libs/speex/src/speexenc.c   (props changed)
   freeswitch/trunk/libs/speex/src/wav_io.c   (props changed)
   freeswitch/trunk/libs/speex/src/wav_io.h   (props changed)
   freeswitch/trunk/libs/speex/src/wave_out.c   (contents, props changed)
   freeswitch/trunk/libs/speex/src/wave_out.h   (contents, props changed)
   freeswitch/trunk/libs/speex/symbian/config.h   (contents, props changed)
   freeswitch/trunk/libs/speex/ti/Makefile.am   (props changed)
   freeswitch/trunk/libs/speex/ti/config.h   (contents, props changed)
   freeswitch/trunk/libs/speex/ti/testenc-TI-C5x.c   (contents, props changed)
   freeswitch/trunk/libs/speex/ti/testenc-TI-C64x.c   (contents, props changed)
   freeswitch/trunk/libs/speex/ti/user_misc.h   (contents, props changed)
   freeswitch/trunk/libs/speex/win32/VS2003/libspeex/libspeex.vcproj   (props changed)
   freeswitch/trunk/libs/speex/win32/VS2003/speexdec/speexdec.vcproj   (props changed)
   freeswitch/trunk/libs/speex/win32/VS2003/speexenc/speexenc.vcproj   (props changed)
   freeswitch/trunk/libs/speex/win32/VS2005/libspeex/libspeex.vcproj   (props changed)
   freeswitch/trunk/libs/speex/win32/VS2005/speexdec/speexdec.vcproj   (props changed)
   freeswitch/trunk/libs/speex/win32/VS2005/speexenc/speexenc.vcproj   (props changed)
   freeswitch/trunk/libs/speex/win32/config.h   (contents, props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1.h   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1_hash.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1_hash.h   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1_porter.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1_tokenizer.h   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts1/fts1_tokenizer1.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2.h   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2_hash.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2_hash.h   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2_porter.c   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2_tokenizer.h   (props changed)
   freeswitch/trunk/libs/sqlite/ext/fts2/fts2_tokenizer1.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/alter.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/analyze.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/attach.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/auth.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/btree.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/btree.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/build.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/callback.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/complete.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/date.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/delete.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/expr.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/func.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/hash.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/hash.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/insert.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/legacy.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/loadext.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/main.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/os.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/os.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/os_common.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/os_os2.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/os_os2.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/os_unix.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/os_win.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/pager.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/pager.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/pragma.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/prepare.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/printf.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/random.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/select.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/shell.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/sqlite3ext.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/sqliteInt.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/table.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/tclsqlite.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test1.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test2.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test3.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test4.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test5.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test6.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test7.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test8.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_async.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_autoext.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_loadext.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_md5.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_schema.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_server.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/test_tclvar.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/tokenize.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/trigger.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/update.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/utf.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/util.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vacuum.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbe.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbe.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbeInt.h   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbeapi.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbeaux.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbefifo.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vdbemem.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/vtab.c   (props changed)
   freeswitch/trunk/libs/sqlite/src/where.c   (props changed)
   freeswitch/trunk/libs/sqlite/test/threadtest1.c   (props changed)
   freeswitch/trunk/libs/sqlite/test/threadtest2.c   (props changed)
   freeswitch/trunk/libs/sqlite/tool/diffdb.c   (props changed)
   freeswitch/trunk/libs/sqlite/tool/lemon.c   (props changed)
   freeswitch/trunk/libs/sqlite/tool/lempar.c   (props changed)
   freeswitch/trunk/libs/sqlite/tool/mkkeywordhash.c   (props changed)
   freeswitch/trunk/libs/sqlite/tool/showdb.c   (props changed)
   freeswitch/trunk/libs/sqlite/tool/showjournal.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/ae_xfm/xfm.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/cipher/aes.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/cipher/aes_cbc.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/cipher/aes_icm.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/cipher/cipher.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/cipher/null_cipher.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/hash/auth.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/hash/hmac.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/hash/null_auth.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/hash/sha1.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/aes.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/aes_cbc.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/aes_icm.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/alloc.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/auth.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/cipher.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/crypto.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/crypto_kernel.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/crypto_math.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/crypto_types.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/cryptoalg.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/datatypes.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/err.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/gf2_8.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/hmac.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/integers.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/kernel_compat.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/key.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/null_auth.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/null_cipher.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/prng.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/rand_source.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/rdb.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/rdbx.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/sha1.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/stat.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/include/xfm.h   (props changed)
   freeswitch/trunk/libs/srtp/crypto/kernel/alloc.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/kernel/crypto_kernel.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/kernel/err.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/kernel/key.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/math/datatypes.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/math/gf2_8.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/math/math.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/math/stat.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/replay/rdb.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/replay/rdbx.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/replay/ut_sim.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/rng/ctr_prng.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/rng/prng.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/rng/rand_linux_kernel.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/rng/rand_source.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/aes_calc.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/auth_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/cipher_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/datatypes_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/env.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/kernel_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/rand_gen.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/sha1_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/crypto/test/stat_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/include/rtp.h   (props changed)
   freeswitch/trunk/libs/srtp/include/srtp.h   (props changed)
   freeswitch/trunk/libs/srtp/include/ut_sim.h   (props changed)
   freeswitch/trunk/libs/srtp/libsrtp.vcproj   (props changed)
   freeswitch/trunk/libs/srtp/srtp.vcproj   (props changed)
   freeswitch/trunk/libs/srtp/srtp/srtp.c   (props changed)
   freeswitch/trunk/libs/srtp/tables/aes_tables.c   (props changed)
   freeswitch/trunk/libs/srtp/test/lfsr.c   (props changed)
   freeswitch/trunk/libs/srtp/test/rdbx_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/test/replay_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/test/roc_driver.c   (props changed)
   freeswitch/trunk/libs/srtp/test/rtp.c   (props changed)
   freeswitch/trunk/libs/srtp/test/rtpw.c   (props changed)
   freeswitch/trunk/libs/srtp/test/srtp_driver.c   (props changed)
   freeswitch/trunk/libs/stfu/stfu.c   (props changed)
   freeswitch/trunk/libs/stfu/stfu.h   (props changed)
   freeswitch/trunk/libs/udns/dnsget.c   (props changed)
   freeswitch/trunk/libs/udns/ex-rdns.c   (props changed)
   freeswitch/trunk/libs/udns/inet_pton.c   (props changed)
   freeswitch/trunk/libs/udns/inet_pton.h   (props changed)
   freeswitch/trunk/libs/udns/rblcheck.c   (props changed)
   freeswitch/trunk/libs/udns/udns.h   (props changed)
   freeswitch/trunk/libs/udns/udns_bl.c   (props changed)
   freeswitch/trunk/libs/udns/udns_codes.c   (props changed)
   freeswitch/trunk/libs/udns/udns_dn.c   (props changed)
   freeswitch/trunk/libs/udns/udns_dntosp.c   (props changed)
   freeswitch/trunk/libs/udns/udns_misc.c   (props changed)
   freeswitch/trunk/libs/udns/udns_parse.c   (props changed)
   freeswitch/trunk/libs/udns/udns_resolver.c   (props changed)
   freeswitch/trunk/libs/udns/udns_rr_a.c   (props changed)
   freeswitch/trunk/libs/udns/udns_rr_mx.c   (props changed)
   freeswitch/trunk/libs/udns/udns_rr_naptr.c   (props changed)
   freeswitch/trunk/libs/udns/udns_rr_ptr.c   (props changed)
   freeswitch/trunk/libs/udns/udns_rr_srv.c   (props changed)
   freeswitch/trunk/libs/udns/udns_rr_txt.c   (props changed)
   freeswitch/trunk/libs/win32/Download APR-Iconv.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download APR-Util.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download APR.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download CURL.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download ETPAN.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download HOWL.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download IKSEMEL.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download LIBRESAMPLE.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download LIBSNDFILE.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download PCRE.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download PORTAUDIO.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download PTHREAD.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download SOFIA.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download SPEEX.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download SPIDERMONKEY.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download SQLITE.vcproj   (props changed)
   freeswitch/trunk/libs/win32/Download XMLRPC.vcproj   (props changed)
   freeswitch/trunk/libs/win32/apr-iconv/libapriconv.vcproj   (props changed)
   freeswitch/trunk/libs/win32/apr-util/libaprutil.vcproj   (props changed)
   freeswitch/trunk/libs/win32/apr-util/xml.vcproj   (props changed)
   freeswitch/trunk/libs/win32/apr/libapr.vcproj   (props changed)
   freeswitch/trunk/libs/win32/curl/ca-bundle.h   (props changed)
   freeswitch/trunk/libs/win32/curl/curllib.vcproj   (props changed)
   freeswitch/trunk/libs/win32/etpan/libetpan.vcproj   (props changed)
   freeswitch/trunk/libs/win32/howl/libhowl.vcproj   (props changed)
   freeswitch/trunk/libs/win32/howl/libmDNSResponder.vcproj   (props changed)
   freeswitch/trunk/libs/win32/iksemel/config.h   (props changed)
   freeswitch/trunk/libs/win32/iksemel/iksemel.vcproj   (props changed)
   freeswitch/trunk/libs/win32/js/fdlibm.vcproj   (props changed)
   freeswitch/trunk/libs/win32/js/js.vcproj   (props changed)
   freeswitch/trunk/libs/win32/libresample/libresample.vcproj   (props changed)
   freeswitch/trunk/libs/win32/libsndfile/common.c   (props changed)
   freeswitch/trunk/libs/win32/libsndfile/config.h   (props changed)
   freeswitch/trunk/libs/win32/libsndfile/libsndfile.vcproj   (props changed)
   freeswitch/trunk/libs/win32/libsndfile/sndfile.h   (props changed)
   freeswitch/trunk/libs/win32/pcre/config.h   (props changed)
   freeswitch/trunk/libs/win32/pcre/dftables.c   (props changed)
   freeswitch/trunk/libs/win32/pcre/libpcre.vcproj   (props changed)
   freeswitch/trunk/libs/win32/pcre/pcre_chartables.c.vcproj   (props changed)
   freeswitch/trunk/libs/win32/portaudio/PAStaticWMME.vcproj   (props changed)
   freeswitch/trunk/libs/win32/pthread/pthread.vcproj   (props changed)
   freeswitch/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj   (props changed)
   freeswitch/trunk/libs/win32/speex/libspeex.vcproj   (props changed)
   freeswitch/trunk/libs/win32/sqlite/keywordhash.h   (props changed)
   freeswitch/trunk/libs/win32/sqlite/opcodes.c   (props changed)
   freeswitch/trunk/libs/win32/sqlite/opcodes.h   (props changed)
   freeswitch/trunk/libs/win32/sqlite/parse.c   (props changed)
   freeswitch/trunk/libs/win32/sqlite/parse.h   (props changed)
   freeswitch/trunk/libs/win32/sqlite/sqlite.vcproj   (props changed)
   freeswitch/trunk/libs/win32/sqlite/sqlite3.h   (props changed)
   freeswitch/trunk/libs/win32/udns/libudns.vcproj   (props changed)
   freeswitch/trunk/libs/win32/xmlrpc/Abyss.vcproj   (props changed)
   freeswitch/trunk/libs/win32/xmlrpc/xmlrpc.vcproj   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/Windows/transport_config_win32.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/Windows/xmlrpc_win32_config.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/auth_client.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/cpp/meerkat-app-list.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/cpp/sample_add_client_complex.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_client.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/gen_sample_add_xml.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/query-meerkat.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/synch_client.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_asynch_client.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_loop_server.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_sample_add_client.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_sample_add_server.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_sample_add_server_cgi.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_sample_add_server_w32httpsys.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/examples/xmlrpc_server_validatee.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/abyss.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/base.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/base_int.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/client.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/client_int.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/oldxmlrpc.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/server.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/server_abyss.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/server_cgi.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/server_w32httpsys.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/transport.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/transport_int.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/include/xmlrpc-c/xmlparser.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/conf.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/conn.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/data.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/file.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/http.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/main.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/server.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/socket.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/thread.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/token.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/token.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/abyss/src/trace.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/curl_transport/xmlrpc_curl_transport.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/curl_transport/xmlrpc_curl_transport.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/gennmtab/gennmtab.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/sample/elements.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlparse/xmlparse.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlparse/xmlparse.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/ascii.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/asciitab.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/dllmain.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/iasciitab.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/latin1tab.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/utf8tab.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmldef.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmlrole.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmlrole.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmltok.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmltok.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmltok_impl.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmltok_impl.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmltok/xmltok_ns.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/codepage.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/codepage.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/filemap.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/readfilemap.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/unixfilemap.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/win32filemap.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/xmlfile.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/xmlfile.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/xmltchar.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/expat/xmlwf/xmlwf.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/libwww_transport/xmlrpc_libwww_transport.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/libwww_transport/xmlrpc_libwww_transport.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/casprintf.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/cmdline_parser.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/getoptx.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/getoptx.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/bool.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/casprintf.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/cmdline_parser.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/inline.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/linklist.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/mallocvar.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/pthreadx.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/include/sstring.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/util/pthreadx_win32.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/wininet_transport/xmlrpc_wininet_transport.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/lib/wininet_transport/xmlrpc_wininet_transport.h   (contents, props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/XmlRpcCpp.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/client.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/client_simple.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/cpptest.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/fault.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/girmem.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/outcome.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/param_list.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/registry.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/server_abyss.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/value.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/cpp/xml.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/cgi.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/cgi.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/cgitest1.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/client.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/client.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/parse_xml.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/parse_xml.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/serialize.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/serialize.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/server_abyss.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/server_abyss.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/test.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/test.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/value.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/value.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/xml_data.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/test/xml_data.h   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_array.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_authcookie.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_base64.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_builddecomp.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_client.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_data.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_datetime.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_expat.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_libxml2.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_parse.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_registry.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_serialize.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_server_abyss.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_server_cgi.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_server_w32httpsys.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_struct.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_strutil.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_support.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_transport.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/src/xmlrpc_utf8.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/interop-server/interop-cgi.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/turbocharger/mod_gzip.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xml-rpc-api2cpp/DataType.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xml-rpc-api2cpp/SystemProxy.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xml-rpc-api2cpp/XmlRpcClass.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xml-rpc-api2cpp/XmlRpcFunction.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xml-rpc-api2cpp/xml-rpc-api2cpp.cpp   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xmlrpc/xmlrpc.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/tools/xmlrpc_transport/xmlrpc_transport.c   (props changed)
   freeswitch/trunk/libs/xmlrpc-c/version.h   (props changed)
   freeswitch/trunk/scripts/contrib/vile/fsconsole.c   (props changed)
   freeswitch/trunk/scripts/socket/socket2me/socket2me.c   (props changed)
   freeswitch/trunk/src/Makefile.am   (props changed)
   freeswitch/trunk/src/include/private/switch_core_pvt.h   (props changed)
   freeswitch/trunk/src/include/switch.h   (props changed)
   freeswitch/trunk/src/include/switch_am_config.h.in   (props changed)
   freeswitch/trunk/src/include/switch_apr.h   (props changed)
   freeswitch/trunk/src/include/switch_bitpack.h   (props changed)
   freeswitch/trunk/src/include/switch_buffer.h   (props changed)
   freeswitch/trunk/src/include/switch_caller.h   (props changed)
   freeswitch/trunk/src/include/switch_channel.h   (props changed)
   freeswitch/trunk/src/include/switch_config.h   (props changed)
   freeswitch/trunk/src/include/switch_console.h   (props changed)
   freeswitch/trunk/src/include/switch_core.h   (props changed)
   freeswitch/trunk/src/include/switch_core_db.h   (props changed)
   freeswitch/trunk/src/include/switch_core_event_hook.h   (props changed)
   freeswitch/trunk/src/include/switch_cpp.h   (props changed)
   freeswitch/trunk/src/include/switch_event.h   (props changed)
   freeswitch/trunk/src/include/switch_frame.h   (props changed)
   freeswitch/trunk/src/include/switch_ivr.h   (props changed)
   freeswitch/trunk/src/include/switch_loadable_module.h   (props changed)
   freeswitch/trunk/src/include/switch_log.h   (props changed)
   freeswitch/trunk/src/include/switch_module_interfaces.h   (props changed)
   freeswitch/trunk/src/include/switch_odbc.h   (props changed)
   freeswitch/trunk/src/include/switch_platform.h   (props changed)
   freeswitch/trunk/src/include/switch_regex.h   (props changed)
   freeswitch/trunk/src/include/switch_resample.h   (props changed)
   freeswitch/trunk/src/include/switch_rtp.h   (props changed)
   freeswitch/trunk/src/include/switch_scheduler.h   (props changed)
   freeswitch/trunk/src/include/switch_stun.h   (props changed)
   freeswitch/trunk/src/include/switch_types.h   (props changed)
   freeswitch/trunk/src/include/switch_utils.h   (props changed)
   freeswitch/trunk/src/include/switch_version.h.template   (props changed)
   freeswitch/trunk/src/include/switch_xml.h   (props changed)
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.vcproj   (props changed)
   freeswitch/trunk/src/mod/applications/mod_skel/mod_skel.c   (props changed)
   freeswitch/trunk/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp   (props changed)
   freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c   (props changed)
   freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.vcproj   (props changed)
   freeswitch/trunk/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp   (props changed)
   freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c   (contents, props changed)
   freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g711/mod_g711.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g711/mod_g711.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g723_1/mod_g723_1.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g723_1/mod_g723_1.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g729/mod_g729.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_g729/mod_g729.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_gsm/mod_gsm.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_gsm/mod_gsm.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_h26x/mod_h26x.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_h26x/mod_h26x.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_l16/mod_l16.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_l16/mod_l16.vcproj   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_lpc10/mod_lpc10.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c   (props changed)
   freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.vcproj   (props changed)
   freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c   (props changed)
   freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.vcproj   (props changed)
   freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c   (props changed)
   freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.vcproj   (props changed)
   freeswitch/trunk/src/mod/directories/mod_ldap/mod_ldap.c   (props changed)
   freeswitch/trunk/src/mod/directories/mod_ldap/mod_ldap.vcproj   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.vcproj   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.vcproj   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_PortAudio.vcproj   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/pa_ringbuffer.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/pa_ringbuffer.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/pablio.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/pablio.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.vcproj   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/lib_api.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/g711.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.vcproj   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/sangoma_pri.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/sangoma_pri.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/win_api_common.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/sigboost.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/ss7boost_client.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/ss7boost_client.h   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/testapp.c   (contents, props changed)
   freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c   (props changed)
   freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.vcproj   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/baseregistry.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/baseregistry.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/cdrcontainer.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/csvcdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/curlcdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/curlcdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/mod_cdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/mod_cdr.vcproj   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/mysqlcdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/odbccdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/odbccdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/pddcdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/sqlitecdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/xmlcdr.cpp   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_cdr/xmlcdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.vcproj   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.vcproj   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.vcproj   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.h   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.vcproj   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c   (props changed)
   freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.vcproj   (props changed)
   freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.vcproj   (props changed)
   freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.vcproj   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/common.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/dct64_i386.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/decode_i386.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/decode_ntom.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/huffman.h   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/interface.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/layer3.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/mpg123.h   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/mpglib.h   (props changed)
   freeswitch/trunk/src/mod/formats/mod_shout/tabinit.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c   (props changed)
   freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_mono/mod_mono.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_perl/fs_perl.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_perl/perlibs.h   (contents, props changed)
   freeswitch/trunk/src/mod/languages/mod_perl/perlxsi.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_perl/switch_swig_wrap.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp   (props changed)
   freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h   (props changed)
   freeswitch/trunk/src/mod/languages/mod_python/mod_python.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp   (props changed)
   freeswitch/trunk/src/mod/languages/mod_python/switch_swig_wrap.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.vcproj   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_skel/mod_spidermonkey_skel.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.vcproj   (contents, props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c   (props changed)
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.vcproj   (props changed)
   freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c   (props changed)
   freeswitch/trunk/src/mod/loggers/mod_console/mod_console.vcproj   (props changed)
   freeswitch/trunk/src/mod/loggers/mod_syslog/mod_syslog.c   (props changed)
   freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c   (props changed)
   freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.vcproj   (props changed)
   freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c   (props changed)
   freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.vcproj   (props changed)
   freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c   (props changed)
   freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.vcproj   (props changed)
   freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c   (props changed)
   freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.vcproj   (props changed)
   freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c   (props changed)
   freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.vcproj   (props changed)
   freeswitch/trunk/src/switch.c   (props changed)
   freeswitch/trunk/src/switch_apr.c   (props changed)
   freeswitch/trunk/src/switch_buffer.c   (props changed)
   freeswitch/trunk/src/switch_caller.c   (props changed)
   freeswitch/trunk/src/switch_channel.c   (props changed)
   freeswitch/trunk/src/switch_config.c   (props changed)
   freeswitch/trunk/src/switch_console.c   (props changed)
   freeswitch/trunk/src/switch_core.c   (contents, props changed)
   freeswitch/trunk/src/switch_core_asr.c   (props changed)
   freeswitch/trunk/src/switch_core_codec.c   (props changed)
   freeswitch/trunk/src/switch_core_db.c   (props changed)
   freeswitch/trunk/src/switch_core_directory.c   (props changed)
   freeswitch/trunk/src/switch_core_event_hook.c   (props changed)
   freeswitch/trunk/src/switch_core_file.c   (props changed)
   freeswitch/trunk/src/switch_core_hash.c   (props changed)
   freeswitch/trunk/src/switch_core_io.c   (props changed)
   freeswitch/trunk/src/switch_core_media_bug.c   (props changed)
   freeswitch/trunk/src/switch_core_memory.c   (props changed)
   freeswitch/trunk/src/switch_core_port_allocator.c   (props changed)
   freeswitch/trunk/src/switch_core_rwlock.c   (props changed)
   freeswitch/trunk/src/switch_core_session.c   (props changed)
   freeswitch/trunk/src/switch_core_speech.c   (props changed)
   freeswitch/trunk/src/switch_core_sqldb.c   (props changed)
   freeswitch/trunk/src/switch_core_state_machine.c   (props changed)
   freeswitch/trunk/src/switch_core_timer.c   (props changed)
   freeswitch/trunk/src/switch_cpp.cpp   (props changed)
   freeswitch/trunk/src/switch_event.c   (props changed)
   freeswitch/trunk/src/switch_ivr.c   (contents, props changed)
   freeswitch/trunk/src/switch_ivr_async.c   (props changed)
   freeswitch/trunk/src/switch_ivr_bridge.c   (props changed)
   freeswitch/trunk/src/switch_ivr_menu.c   (props changed)
   freeswitch/trunk/src/switch_ivr_originate.c   (props changed)
   freeswitch/trunk/src/switch_ivr_play_say.c   (props changed)
   freeswitch/trunk/src/switch_loadable_module.c   (props changed)
   freeswitch/trunk/src/switch_log.c   (props changed)
   freeswitch/trunk/src/switch_odbc.c   (props changed)
   freeswitch/trunk/src/switch_regex.c   (props changed)
   freeswitch/trunk/src/switch_resample.c   (props changed)
   freeswitch/trunk/src/switch_rtp.c   (props changed)
   freeswitch/trunk/src/switch_scheduler.c   (props changed)
   freeswitch/trunk/src/switch_stun.c   (props changed)
   freeswitch/trunk/src/switch_swig.c   (props changed)
   freeswitch/trunk/src/switch_swig.i   (props changed)
   freeswitch/trunk/src/switch_utils.c   (props changed)
   freeswitch/trunk/src/switch_xml.c   (props changed)
   freeswitch/trunk/w32/Console/FreeSwitchConsole.vcproj   (props changed)
   freeswitch/trunk/w32/Library/FreeSwitchCore.vcproj   (props changed)

Log:
svn:eol-style properties, and make eol-style consistent in some files.

Modified: freeswitch/trunk/Freeswitch.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.sln	(original)
+++ freeswitch/trunk/Freeswitch.sln	Fri Sep 21 14:49:14 2007
@@ -1,1319 +1,1319 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.vcproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.vcproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.vcproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsm", "src\mod\codecs\mod_gsm\mod_gsm.vcproj", "{4926323F-4EA8-4B7D-A3D3-65488725988F}"
-	ProjectSection(ProjectDependencies) = postProject
-		{8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xmpp_event", "src\mod\event_handlers\mod_xmpp_event\mod_xmpp_event.vcproj", "{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}"
-	ProjectSection(ProjectDependencies) = postProject
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.vcproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_test", "src\mod\event_handlers\mod_event_test\mod_event_test.vcproj", "{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g711", "src\mod\codecs\mod_g711\mod_g711.vcproj", "{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iax", "src\mod\endpoints\mod_iax\mod_iax.vcproj", "{3A5B9131-F20C-4A85-9447-6C1610941CEE}"
-	ProjectSection(ProjectDependencies) = postProject
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.vcproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_l16", "src\mod\codecs\mod_l16\mod_l16.vcproj", "{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_softtimer", "src\mod\timers\mod_softtimer\mod_softtimer.vcproj", "{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_speex", "src\mod\codecs\mod_speex\mod_speex.vcproj", "{5580D60E-0F77-4716-9CD4-B8E5986FA375}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_woomera", "src\mod\endpoints\mod_woomera\mod_woomera.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dialplans", "Dialplans", "{C5F182F9-754A-4EC5-B50F-76ED02BE13F4}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Event Handlers", "Event Handlers", "{9ADF1E48-2F5C-4ED7-A893-596259FABFE0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formats", "Formats", "{A5A27244-AD24-46E5-B01B-840CD296C91D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Timers", "Timers", "{2D57D093-3F8D-4729-AD9A-68E945C200A5}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{CBD81696-EFB4-4D2F-8451-1B8DAA86155A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "docs", "docs\docs.vcproj", "{1A1FF289-4FD6-4285-A422-D31DD67A4723}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.vcproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Directories", "Directories", "{B8F5B47B-8568-46EB-B320-64C17D2A98BC}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ldap", "src\mod\directories\mod_ldap\mod_ldap.vcproj", "{EC3E5C7F-EE09-47E2-80FE-546363D14A98}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.vcproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_zeroconf", "src\mod\event_handlers\mod_zeroconf\mod_zeroconf.vcproj", "{C7705DC4-2088-493E-AF8D-65BC6D65C125}"
-	ProjectSection(ProjectDependencies) = postProject
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.vcproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.vcproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Languages", "Languages", "{0C808854-54D1-4230-BFF5-77B5FD905000}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "src\mod\languages\mod_spidermonkey\mod_spidermonkey.vcproj", "{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}"
-	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cepstral", "src\mod\asr_tts\mod_cepstral\mod_cepstral.vcproj", "{692F6330-4D87-4C82-81DF-40DB5892636E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_perl", "src\mod\languages\mod_perl\fs_perl.vcproj", "{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_perl", "src\mod\languages\mod_perl\mod_perl.vcproj", "{7B077E7F-1BE7-4291-AB86-55E527B25CAC}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.vcproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{1906D736-08BD-4EE1-924F-B536249B9A54} = {1906D736-08BD-4EE1-924F-B536249B9A54}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.vcproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_console", "src\mod\loggers\mod_console\mod_console.vcproj", "{1C453396-D912-4213-89FD-9B489162B7B5}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XML Interfaces", "XML Interfaces", "{F69A4A6B-9360-4EBB-A280-22AA3C455AC5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.vcproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
-	ProjectSection(ProjectDependencies) = postProject
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.vcproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.vcproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.vcproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.vcproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr", "src\mod\event_handlers\mod_cdr\mod_cdr.vcproj", "{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgsm", "libs\codec\gsm\libgsm.vcproj", "{8FD2E297-4096-47E5-9258-C48FF1841523}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libilbc", "libs\codec\ilbc\libilbc.vcproj", "{989BB874-7AF1-44CB-8E5C-CC8113D267E8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiax2", "libs\iax\libiax2.vcproj", "{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.vcproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
-	ProjectSection(ProjectDependencies) = postProject
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "libs\srtp\libsrtp.vcproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsqlite", "libs\win32\sqlite\sqlite.vcproj", "{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "libs\win32\pcre\libpcre.vcproj", "{8D04B550-D240-4A44-8A18-35DA3F7038D9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {1CED5987-A529-46DC-B30F-870D85FF9C94}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre Generate pcre_chartables.c", "libs\win32\pcre\pcre_chartables.c.vcproj", "{1CED5987-A529-46DC-B30F-870D85FF9C94}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample", "libs\win32\libresample\libresample.vcproj", "{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapr", "libs\win32\apr\libapr.vcproj", "{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapriconv", "libs\win32\apr-iconv\libapriconv.vcproj", "{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "libs\win32\speex\libspeex.vcproj", "{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.vcproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download HOWL", "libs\win32\Download HOWL.vcproj", "{5927104D-C14C-4AC8-925C-4AB681762E75}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "howl static library", "libs\win32\howl\libhowl.vcproj", "{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}"
-	ProjectSection(ProjectDependencies) = postProject
-		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder static library", "libs\win32\howl\libmDNSResponder.vcproj", "{49C34584-B6DA-448F-83CF-27584DC9FC90}"
-	ProjectSection(ProjectDependencies) = postProject
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
-		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.vcproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "libs\win32\curl\curllib.vcproj", "{87EE9DA4-DE1E-4448-8324-183C98DCA588}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlrpc", "libs\win32\xmlrpc\xmlrpc.vcproj", "{A3FE0076-B366-429D-A238-D7304DA7D3C1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Abyss", "libs\win32\xmlrpc\Abyss.vcproj", "{356EC96D-4C9F-47B5-9083-FC328B87BA94}"
-	ProjectSection(ProjectDependencies) = postProject
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.vcproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "js", "libs\win32\js\js.vcproj", "{204FA0DE-305D-4414-AE2E-F195A23F390D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.vcproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg726", "libs\codec\g726\libg726.vcproj", "{5A6A281A-AA50-470A-8305-202BDA1CD1BF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g726", "src\mod\codecs\mod_g726\mod_g726.vcproj", "{486369EB-F150-4B56-BCC8-77B9E18FF5F5}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {5A6A281A-AA50-470A-8305-202BDA1CD1BF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg7xx", "libs\codec\g7xx\libg7xx.vcproj", "{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g722", "src\mod\codecs\mod_g722\mod_g722.vcproj", "{D42518CC-7475-454D-B392-0E132C07D761}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.vcproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pthread", "libs\win32\pthread\pthread.vcproj", "{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}"
-	ProjectSection(ProjectDependencies) = postProject
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.vcproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.vcproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSwitch.NET", "src\dotnet\FreeSwitch.NET.csproj", "{251CAABC-16C3-4593-A491-603B908094E0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_core_db", "src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.vcproj", "{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_teletone", "src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.vcproj", "{8F992C49-6C51-412F-B2A3-34EAB708EB65}"
-	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libudns", "libs\win32\udns\libudns.vcproj", "{4043FC6A-9A30-4577-8AD5-9B233C9575D8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applications\mod_enum\mod_enum.vcproj", "{71A967D5-0E99-4CEF-A587-98836EE6F2EF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_etpan", "src\mod\languages\mod_spidermonkey_etpan\mod_spidermonkey_etpan.vcproj", "{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_odbc", "src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.vcproj", "{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libs\win32\etpan\libetpan.vcproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.vcproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "say", "say", "{6CD61A1D-797C-470A-BE08-8C31B68BB336}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\mod_say_en\mod_say_en.vcproj", "{988CACF7-3FCB-4992-BE69-77872AE67DC8}"
-	ProjectSection(ProjectDependencies) = postProject
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\portaudio\build\msvc\portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.vcproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amr", "src\mod\codecs\mod_amr\mod_amr.vcproj", "{8DEB383C-4091-4F42-A56F-C9E46D552D79}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Config", "_Config", "{57D119DC-484F-420F-B9E9-8589FD9A8DF8}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default", "Default", "{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}"
-	ProjectSection(SolutionItems) = preProject
-		conf\conference.conf.xml = conf\conference.conf.xml
-		conf\console.conf.xml = conf\console.conf.xml
-		conf\default_context.xml = conf\default_context.xml
-		conf\dialplan_directory.conf.xml = conf\dialplan_directory.conf.xml
-		conf\dingaling.conf.xml = conf\dingaling.conf.xml
-		conf\directory.xml = conf\directory.xml
-		conf\enum.conf.xml = conf\enum.conf.xml
-		conf\event_multicast.conf.xml = conf\event_multicast.conf.xml
-		conf\event_socket.conf.xml = conf\event_socket.conf.xml
-		conf\freeswitch.xml = conf\freeswitch.xml
-		conf\iax.conf.xml = conf\iax.conf.xml
-		conf\ivr.conf.xml = conf\ivr.conf.xml
-		conf\lang_en.xml = conf\lang_en.xml
-		conf\lang_fr.xml = conf\lang_fr.xml
-		conf\mod_cdr.conf.xml = conf\mod_cdr.conf.xml
-		conf\modules.conf.xml = conf\modules.conf.xml
-		conf\portaudio.conf.xml = conf\portaudio.conf.xml
-		conf\rss.conf.xml = conf\rss.conf.xml
-		conf\sofia.conf.xml = conf\sofia.conf.xml
-		conf\spidermonkey.conf.xml = conf\spidermonkey.conf.xml
-		conf\switch.conf.xml = conf\switch.conf.xml
-		conf\syslog.conf.xml = conf\syslog.conf.xml
-		conf\wanpipe.conf.xml = conf\wanpipe.conf.xml
-		conf\woomera.conf.xml = conf\woomera.conf.xml
-		conf\xml_cdr.conf.xml = conf\xml_cdr.conf.xml
-		conf\xml_curl.conf.xml = conf\xml_curl.conf.xml
-		conf\xml_rpc.conf.xml = conf\xml_rpc.conf.xml
-		conf\xmpp_event.conf.xml = conf\xmpp_event.conf.xml
-		conf\zeroconf.conf.xml = conf\zeroconf.conf.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Release", "Release", "{7BFD517E-7F8F-4A40-A78E-8D3632738227}"
-	ProjectSection(SolutionItems) = preProject
-		release\conf\conference.conf.xml = release\conf\conference.conf.xml
-		release\conf\console.conf.xml = release\conf\console.conf.xml
-		release\conf\default_context.xml = release\conf\default_context.xml
-		release\conf\dialplan_directory.conf.xml = release\conf\dialplan_directory.conf.xml
-		release\conf\dingaling.conf.xml = release\conf\dingaling.conf.xml
-		release\conf\directory.xml = release\conf\directory.xml
-		release\conf\enum.conf.xml = release\conf\enum.conf.xml
-		release\conf\event_multicast.conf.xml = release\conf\event_multicast.conf.xml
-		release\conf\event_socket.conf.xml = release\conf\event_socket.conf.xml
-		release\conf\freeswitch.xml = release\conf\freeswitch.xml
-		release\conf\freeswitch_combined.xml = release\conf\freeswitch_combined.xml
-		release\conf\iax.conf.xml = release\conf\iax.conf.xml
-		release\conf\ivr.conf.xml = release\conf\ivr.conf.xml
-		release\conf\lang_en.xml = release\conf\lang_en.xml
-		release\conf\lang_fr.xml = release\conf\lang_fr.xml
-		release\conf\mod_cdr.conf.xml = release\conf\mod_cdr.conf.xml
-		release\conf\modules.conf.xml = release\conf\modules.conf.xml
-		release\conf\portaudio.conf.xml = release\conf\portaudio.conf.xml
-		release\conf\rss.conf.xml = release\conf\rss.conf.xml
-		release\conf\sofia.conf.xml = release\conf\sofia.conf.xml
-		release\conf\spidermonkey.conf.xml = release\conf\spidermonkey.conf.xml
-		release\conf\switch.conf.xml = release\conf\switch.conf.xml
-		release\conf\syslog.conf.xml = release\conf\syslog.conf.xml
-		release\conf\wanpipe.conf.xml = release\conf\wanpipe.conf.xml
-		release\conf\woomera.conf.xml = release\conf\woomera.conf.xml
-		release\conf\xml_cdr.conf.xml = release\conf\xml_cdr.conf.xml
-		release\conf\xml_curl.conf.xml = release\conf\xml_curl.conf.xml
-		release\conf\xml_rpc.conf.xml = release\conf\xml_rpc.conf.xml
-		release\conf\xmpp_event.conf.xml = release\conf\xmpp_event.conf.xml
-		release\conf\zeroconf.conf.xml = release\conf\zeroconf.conf.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug", "Debug", "{6374D55C-FABE-4A02-9CF1-4145308A56C5}"
-	ProjectSection(SolutionItems) = preProject
-		debug\conf\conference.conf.xml = debug\conf\conference.conf.xml
-		debug\conf\console.conf.xml = debug\conf\console.conf.xml
-		debug\conf\default_context.xml = debug\conf\default_context.xml
-		debug\conf\dialplan_directory.conf.xml = debug\conf\dialplan_directory.conf.xml
-		debug\conf\dingaling.conf.xml = debug\conf\dingaling.conf.xml
-		debug\conf\directory.xml = debug\conf\directory.xml
-		debug\conf\enum.conf.xml = debug\conf\enum.conf.xml
-		debug\conf\event_multicast.conf.xml = debug\conf\event_multicast.conf.xml
-		debug\conf\event_socket.conf.xml = debug\conf\event_socket.conf.xml
-		debug\conf\freeswitch.xml = debug\conf\freeswitch.xml
-		debug\conf\freeswitch_combined.xml = debug\conf\freeswitch_combined.xml
-		debug\conf\iax.conf.xml = debug\conf\iax.conf.xml
-		debug\conf\ivr.conf.xml = debug\conf\ivr.conf.xml
-		debug\conf\lang_en.xml = debug\conf\lang_en.xml
-		debug\conf\lang_fr.xml = debug\conf\lang_fr.xml
-		debug\conf\mod_cdr.conf.xml = debug\conf\mod_cdr.conf.xml
-		debug\conf\modules.conf.xml = debug\conf\modules.conf.xml
-		debug\conf\portaudio.conf.xml = debug\conf\portaudio.conf.xml
-		debug\conf\rss.conf.xml = debug\conf\rss.conf.xml
-		debug\conf\sofia.conf.xml = debug\conf\sofia.conf.xml
-		debug\conf\spidermonkey.conf.xml = debug\conf\spidermonkey.conf.xml
-		debug\conf\switch.conf.xml = debug\conf\switch.conf.xml
-		debug\conf\syslog.conf.xml = debug\conf\syslog.conf.xml
-		debug\conf\wanpipe.conf.xml = debug\conf\wanpipe.conf.xml
-		debug\conf\woomera.conf.xml = debug\conf\woomera.conf.xml
-		debug\conf\xml_cdr.conf.xml = debug\conf\xml_cdr.conf.xml
-		debug\conf\xml_curl.conf.xml = debug\conf\xml_curl.conf.xml
-		debug\conf\xml_rpc.conf.xml = debug\conf\xml_rpc.conf.xml
-		debug\conf\xmpp_event.conf.xml = debug\conf\xmpp_event.conf.xml
-		debug\conf\zeroconf.conf.xml = debug\conf\zeroconf.conf.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build System", "{DB1024A8-41BF-4AD7-9AE6-13202230D1F3}"
-	ProjectSection(SolutionItems) = preProject
-		acsite.m4 = acsite.m4
-		build\buildlib.sh = build\buildlib.sh
-		configure.in = configure.in
-		Makefile.am = Makefile.am
-		build\modules.conf.in = build\modules.conf.in
-		libs\win32\util.vbs = libs\win32\util.vbs
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "m4", "m4", "{CDE9B06A-3C27-4987-8FAE-DF1006BC705D}"
-	ProjectSection(SolutionItems) = preProject
-		build\config\ac_cflags_gcc_option.m4 = build\config\ac_cflags_gcc_option.m4
-		build\config\ac_cflags_sun_option.m4 = build\config\ac_cflags_sun_option.m4
-		build\config\ac_gcc_archflag.m4 = build\config\ac_gcc_archflag.m4
-		build\config\ac_gcc_x86_cpuid.m4 = build\config\ac_gcc_x86_cpuid.m4
-		build\config\ac_prog_gzip.m4 = build\config\ac_prog_gzip.m4
-		build\config\ac_prog_wget.m4 = build\config\ac_prog_wget.m4
-		build\config\ax_cc_maxopt.m4 = build\config\ax_cc_maxopt.m4
-		build\config\ax_cflags_warn_all_ansi.m4 = build\config\ax_cflags_warn_all_ansi.m4
-		build\config\ax_check_compiler_flags.m4 = build\config\ax_check_compiler_flags.m4
-		build\config\ax_compiler_vendor.m4 = build\config\ax_compiler_vendor.m4
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h26x", "src\mod\codecs\mod_h26x\mod_h26x.vcproj", "{2C3C2423-234B-4772-8899-D3B137E5CA35}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_esf", "src\mod\applications\mod_esf\mod_esf.vcproj", "{3850D93A-5F24-4922-BC1C-74D08C37C256}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_local_stream", "src\mod\formats\mod_local_stream\mod_local_stream.vcproj", "{2CA40887-1622-46A1-A7F9-17FD7E7E545B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mediaframe", "libs\openmrcp\mediaframe\mediaframe.vcproj", "{AA91F0AC-6562-435E-814C-5C94689FEFA2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpcore", "libs\openmrcp\mrcpcore\mrcpcore.vcproj", "{829A9309-3B94-43C0-846B-7EC9D6D35F8B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2} = {AA91F0AC-6562-435E-814C-5C94689FEFA2}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtspcore", "libs\openmrcp\rtspcore\rtspcore.vcproj", "{EB751DC4-87BD-4766-B78D-DFB64BA9F988}"
-	ProjectSection(ProjectDependencies) = postProject
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpmediaframe", "libs\openmrcp\module\mrcpmediaframe\mrcpmediaframe.vcproj", "{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcprtsp", "libs\openmrcp\module\mrcprtsp\mrcprtsp.vcproj", "{CF78E84D-8456-44F2-8197-0E0E88D30A3C}"
-	ProjectSection(ProjectDependencies) = postProject
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988} = {EB751DC4-87BD-4766-B78D-DFB64BA9F988}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "openmrcp", "openmrcp", "{ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpsofiasip", "libs\openmrcp\module\mrcpsofiasip\mrcpsofiasip.vcproj", "{819C7242-6184-46FE-BC7B-C7E25C0581EE}"
-	ProjectSection(ProjectDependencies) = postProject
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpv2agent", "libs\openmrcp\module\mrcpv2agent\mrcpv2agent.vcproj", "{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopenmrcpclient", "libs\openmrcp\platform\openmrcpclient\libopenmrcpclient.vcproj", "{A407B661-D7DC-4E30-B268-FFF3296C35E6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E} = {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6} = {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE} = {819C7242-6184-46FE-BC7B-C7E25C0581EE}
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C} = {CF78E84D-8456-44F2-8197-0E0E88D30A3C}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_openmrcp", "src\mod\asr_tts\mod_openmrcp\mod_openmrcp.vcproj", "{E7116F50-2B10-472F-92BD-C8667AA9C1AE}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6} = {A407B661-D7DC-4E30-B268-FFF3296C35E6}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_socket", "src\mod\languages\mod_spidermonkey_socket\mod_spidermonkey_socket.vcproj", "{028C7278-05D7-4E18-82FE-BE231B844F41}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release|Win32
-		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|Win32.Build.0 = Debug|Win32
-		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|x64.ActiveCfg = Debug|Win32
-		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|Win32.ActiveCfg = Release|Win32
-		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|Win32.Build.0 = Release|Win32
-		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|x64.ActiveCfg = Release|Win32
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|Win32.ActiveCfg = Debug|Win32
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|Win32.Build.0 = Debug|Win32
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|x64.ActiveCfg = Debug|Win32
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|Win32.ActiveCfg = Release|Win32
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|Win32.Build.0 = Release|Win32
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|x64.ActiveCfg = Release|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.Build.0 = Debug|Win32
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|x64.ActiveCfg = Debug|Win32
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Release|Win32.ActiveCfg = Release|Win32
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Release|Win32.Build.0 = Release|Win32
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Release|x64.ActiveCfg = Release|Win32
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Debug|Win32.Build.0 = Debug|Win32
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Debug|x64.ActiveCfg = Debug|Win32
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Release|Win32.ActiveCfg = Release|Win32
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Release|Win32.Build.0 = Release|Win32
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Release|x64.ActiveCfg = Release|Win32
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.Build.0 = Debug|Win32
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|x64.ActiveCfg = Debug|Win32
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|Win32
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Debug|Win32.Build.0 = Debug|Win32
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Debug|x64.ActiveCfg = Debug|Win32
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Release|Win32.ActiveCfg = Release|Win32
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Release|Win32.Build.0 = Release|Win32
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Release|x64.ActiveCfg = Release|Win32
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Debug|Win32.Build.0 = Debug|Win32
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Debug|x64.ActiveCfg = Debug|Win32
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Release|Win32.ActiveCfg = Release|Win32
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Release|Win32.Build.0 = Release|Win32
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Release|x64.ActiveCfg = Release|Win32
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.Build.0 = Debug|Win32
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|x64.ActiveCfg = Debug|Win32
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.ActiveCfg = Release|Win32
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.Build.0 = Release|Win32
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|x64.ActiveCfg = Release|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.ActiveCfg = Debug|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32
-		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.ActiveCfg = Release|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32
-		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|Win32.ActiveCfg = Debug
-		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.ActiveCfg = Debug with MySql
-		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.Build.0 = Debug with MySql
-		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|Win32.ActiveCfg = Release
-		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|x64.ActiveCfg = Release with MySql
-		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|x64.Build.0 = Release with MySql
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|Win32
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.Build.0 = Debug|Win32
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|x64.ActiveCfg = Debug|Win32
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.ActiveCfg = Release|Win32
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.Build.0 = Release|Win32
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|x64.ActiveCfg = Release|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|Win32
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.ActiveCfg = Debug|Win32
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.ActiveCfg = Release|Win32
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|Win32
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|Win32
-		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Debug|x64.ActiveCfg = Debug|Win32
-		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Release|Win32.ActiveCfg = Release|Win32
-		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Release|x64.ActiveCfg = Release|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|Win32
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|Win32.Build.0 = Debug|Win32
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|x64.ActiveCfg = Debug|Win32
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|Win32.ActiveCfg = Release|Win32
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|Win32.Build.0 = Release|Win32
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|x64.ActiveCfg = Release|Win32
-		{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|Win32.Build.0 = Debug|Win32
-		{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|x64.ActiveCfg = Debug|Win32
-		{8FD2E297-4096-47E5-9258-C48FF1841523}.Release|Win32.ActiveCfg = Release|Win32
-		{8FD2E297-4096-47E5-9258-C48FF1841523}.Release|Win32.Build.0 = Release|Win32
-		{8FD2E297-4096-47E5-9258-C48FF1841523}.Release|x64.ActiveCfg = Release|Win32
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.Build.0 = Debug|Win32
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|x64.ActiveCfg = Debug|Win32
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.ActiveCfg = Release|Win32
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.Build.0 = Release|Win32
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|x64.ActiveCfg = Release|Win32
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Debug|Win32.Build.0 = Debug|Win32
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Debug|x64.ActiveCfg = Debug|Win32
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Release|Win32.ActiveCfg = Release|Win32
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Release|Win32.Build.0 = Release|Win32
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Release|x64.ActiveCfg = Release|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|x64.ActiveCfg = Debug|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release|Win32
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|x64.ActiveCfg = Release|Win32
-		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.Build.0 = Debug|Win32
-		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|x64.ActiveCfg = Debug|Win32
-		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.ActiveCfg = Release|Win32
-		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.Build.0 = Release|Win32
-		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|x64.ActiveCfg = Release|Win32
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.ActiveCfg = Debug|Win32
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.Build.0 = Debug|Win32
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|x64.ActiveCfg = Debug|Win32
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.ActiveCfg = Release|Win32
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.Build.0 = Release|Win32
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|x64.ActiveCfg = Release|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|Win32
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Debug|Win32.ActiveCfg = Debug|Win32
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Debug|Win32.Build.0 = Debug|Win32
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Debug|x64.ActiveCfg = Debug|Win32
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Release|Win32.ActiveCfg = Release|Win32
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Release|Win32.Build.0 = Release|Win32
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Release|x64.ActiveCfg = Release|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|Win32
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.Build.0 = Debug|Win32
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|x64.ActiveCfg = Debug|Win32
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.ActiveCfg = Release|Win32
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.Build.0 = Release|Win32
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|x64.ActiveCfg = Release|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|Win32
-		{5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.Build.0 = Debug|Win32
-		{5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|x64.ActiveCfg = Debug|Win32
-		{5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.ActiveCfg = Release|Win32
-		{5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.Build.0 = Release|Win32
-		{5927104D-C14C-4AC8-925C-4AB681762E75}.Release|x64.ActiveCfg = Release|Win32
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.Build.0 = Debug|Win32
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|x64.ActiveCfg = Debug|Win32
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.ActiveCfg = Release|Win32
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.Build.0 = Release|Win32
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|x64.ActiveCfg = Release|Win32
-		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.ActiveCfg = Debug|Win32
-		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.Build.0 = Debug|Win32
-		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|x64.ActiveCfg = Debug|Win32
-		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.ActiveCfg = Release|Win32
-		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.Build.0 = Release|Win32
-		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|x64.ActiveCfg = Release|Win32
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|Win32
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|Win32
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.ActiveCfg = Debug|Win32
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.ActiveCfg = Release|Win32
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Debug|Win32.Build.0 = Debug|Win32
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Debug|x64.ActiveCfg = Debug|Win32
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Release|Win32.ActiveCfg = Release|Win32
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Release|Win32.Build.0 = Release|Win32
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Release|x64.ActiveCfg = Release|Win32
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Debug|Win32.ActiveCfg = Debug|Win32
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Debug|Win32.Build.0 = Debug|Win32
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Debug|x64.ActiveCfg = Debug|Win32
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Release|Win32.ActiveCfg = Release|Win32
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Release|Win32.Build.0 = Release|Win32
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Release|x64.ActiveCfg = Release|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|Win32
-		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.ActiveCfg = Debug|Win32
-		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.Build.0 = Debug|Win32
-		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|x64.ActiveCfg = Debug|Win32
-		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.ActiveCfg = Release|Win32
-		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.Build.0 = Release|Win32
-		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|x64.ActiveCfg = Release|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|Win32
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|Win32.Build.0 = Debug|Win32
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|x64.ActiveCfg = Debug|Win32
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|Win32.ActiveCfg = Release|Win32
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|Win32.Build.0 = Release|Win32
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|x64.ActiveCfg = Release|Win32
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Debug|Win32.Build.0 = Debug|Win32
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Debug|x64.ActiveCfg = Debug|Win32
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Release|Win32.ActiveCfg = Release|Win32
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Release|Win32.Build.0 = Release|Win32
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Release|x64.ActiveCfg = Release|Win32
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Debug|Win32.Build.0 = Debug|Win32
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Debug|x64.ActiveCfg = Debug|Win32
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Release|Win32.ActiveCfg = Release|Win32
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Release|Win32.Build.0 = Release|Win32
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Release|x64.ActiveCfg = Release|Win32
-		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|Win32.Build.0 = Debug|Win32
-		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|x64.ActiveCfg = Debug|Win32
-		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.ActiveCfg = Release|Win32
-		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.Build.0 = Release|Win32
-		{D42518CC-7475-454D-B392-0E132C07D761}.Release|x64.ActiveCfg = Release|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|Win32
-		{251CAABC-16C3-4593-A491-603B908094E0}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{251CAABC-16C3-4593-A491-603B908094E0}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{251CAABC-16C3-4593-A491-603B908094E0}.Release|Win32.ActiveCfg = Release|Any CPU
-		{251CAABC-16C3-4593-A491-603B908094E0}.Release|x64.ActiveCfg = Release|Any CPU
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.Build.0 = Debug|Win32
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.ActiveCfg = Debug|Win32
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.ActiveCfg = Release|Win32
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.Build.0 = Release|Win32
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.ActiveCfg = Release|Win32
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.Build.0 = Debug|Win32
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.ActiveCfg = Debug|Win32
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.ActiveCfg = Release|Win32
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.Build.0 = Release|Win32
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.ActiveCfg = Release|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.Build.0 = Debug|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.Build.0 = Release|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|Win32
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|Win32.Build.0 = Debug|Win32
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|x64.ActiveCfg = Debug|Win32
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|Win32.ActiveCfg = Release|Win32
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|Win32.Build.0 = Release|Win32
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|x64.ActiveCfg = Release|Win32
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|Win32
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|Win32
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|Win32.ActiveCfg = Debug|Win32
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|Win32.Build.0 = Debug|Win32
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|x64.ActiveCfg = Debug|Win32
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|Win32.ActiveCfg = Release|Win32
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|Win32.Build.0 = Release|Win32
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|x64.ActiveCfg = Release|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|Win32
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.Build.0 = Debug|Win32
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|x64.ActiveCfg = Debug|Win32
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.ActiveCfg = Release|Win32
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.Build.0 = Release|Win32
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|x64.ActiveCfg = Release|Win32
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.Build.0 = Debug|Win32
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|x64.ActiveCfg = Debug|Win32
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.ActiveCfg = Release|Win32
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.Build.0 = Release|Win32
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|x64.ActiveCfg = Release|Win32
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.Build.0 = Debug|Win32
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|x64.ActiveCfg = Debug|Win32
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.ActiveCfg = Release|Win32
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.Build.0 = Release|Win32
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|x64.ActiveCfg = Release|Win32
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.Build.0 = Debug|Win32
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|x64.ActiveCfg = Debug|Win32
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.ActiveCfg = Release|Win32
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.Build.0 = Release|Win32
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|x64.ActiveCfg = Release|Win32
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.ActiveCfg = Debug Static|Win32
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.Build.0 = Debug Static|Win32
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|x64.ActiveCfg = Debug|Win32
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.ActiveCfg = Release Static|Win32
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.Build.0 = Release Static|Win32
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|x64.ActiveCfg = Release|Win32
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.ActiveCfg = Debug Static|Win32
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.Build.0 = Debug Static|Win32
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|x64.ActiveCfg = Debug|Win32
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.ActiveCfg = Release Static|Win32
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.Build.0 = Release Static|Win32
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|x64.ActiveCfg = Release|Win32
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.Build.0 = Debug|Win32
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|x64.ActiveCfg = Debug|Win32
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.ActiveCfg = Release|Win32
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.Build.0 = Release|Win32
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|x64.ActiveCfg = Release|Win32
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.Build.0 = Debug|Win32
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|x64.ActiveCfg = Debug|Win32
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.ActiveCfg = Release|Win32
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.Build.0 = Release|Win32
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|x64.ActiveCfg = Release|Win32
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.Build.0 = Debug|Win32
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|x64.ActiveCfg = Debug|Win32
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.ActiveCfg = Release|Win32
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.Build.0 = Release|Win32
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|x64.ActiveCfg = Release|Win32
-		{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.ActiveCfg = Debug|Win32
-		{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.Build.0 = Debug|Win32
-		{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.ActiveCfg = Debug|Win32
-		{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.ActiveCfg = Release|Win32
-		{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.Build.0 = Release|Win32
-		{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.ActiveCfg = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{4926323F-4EA8-4B7D-A3D3-65488725988F} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{5580D60E-0F77-4716-9CD4-B8E5986FA375} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{486369EB-F150-4B56-BCC8-77B9E18FF5F5} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{D42518CC-7475-454D-B392-0E132C07D761} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{C7705DC4-2088-493E-AF8D-65BC6D65C125} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{784113EF-44D9-4949-835D-7065D3C7AD08} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{05515420-16DE-4E63-BE73-85BE85BA5142} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5} = {2D57D093-3F8D-4729-AD9A-68E945C200A5}
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
-		{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{8FD2E297-4096-47E5-9258-C48FF1841523} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{1906D736-08BD-4EE1-924F-B536249B9A54} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{8F992C49-6C51-412F-B2A3-34EAB708EB65} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{028C7278-05D7-4E18-82FE-BE231B844F41} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
-		{E7116F50-2B10-472F-92BD-C8667AA9C1AE} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
-		{1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
-		{5927104D-C14C-4AC8-925C-4AB681762E75} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
-		{7BFD517E-7F8F-4A40-A78E-8D3632738227} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
-		{6374D55C-FABE-4A02-9CF1-4145308A56C5} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
-		{CDE9B06A-3C27-4987-8FAE-DF1006BC705D} = {DB1024A8-41BF-4AD7-9AE6-13202230D1F3}
-		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{EB751DC4-87BD-4766-B78D-DFB64BA9F988} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{CF78E84D-8456-44F2-8197-0E0E88D30A3C} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{AA91F0AC-6562-435E-814C-5C94689FEFA2} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{819C7242-6184-46FE-BC7B-C7E25C0581EE} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-		{A407B661-D7DC-4E30-B268-FFF3296C35E6} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.vcproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.vcproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EEF031CB-FED8-451E-A471-91EC8D4F6750}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {8D04B550-D240-4A44-8A18-35DA3F7038D9}
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.vcproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsm", "src\mod\codecs\mod_gsm\mod_gsm.vcproj", "{4926323F-4EA8-4B7D-A3D3-65488725988F}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8FD2E297-4096-47E5-9258-C48FF1841523} = {8FD2E297-4096-47E5-9258-C48FF1841523}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xmpp_event", "src\mod\event_handlers\mod_xmpp_event\mod_xmpp_event.vcproj", "{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}"
+	ProjectSection(ProjectDependencies) = postProject
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.vcproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {3D0370CA-BED2-4657-A475-32375CBCB6E4}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_test", "src\mod\event_handlers\mod_event_test\mod_event_test.vcproj", "{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g711", "src\mod\codecs\mod_g711\mod_g711.vcproj", "{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iax", "src\mod\endpoints\mod_iax\mod_iax.vcproj", "{3A5B9131-F20C-4A85-9447-6C1610941CEE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.vcproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {0A18A071-125E-442F-AFF7-A3F68ABECF99}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_l16", "src\mod\codecs\mod_l16\mod_l16.vcproj", "{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_softtimer", "src\mod\timers\mod_softtimer\mod_softtimer.vcproj", "{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_speex", "src\mod\codecs\mod_speex\mod_speex.vcproj", "{5580D60E-0F77-4716-9CD4-B8E5986FA375}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_woomera", "src\mod\endpoints\mod_woomera\mod_woomera.vcproj", "{FE3540C5-3303-46E0-A69E-D92F775687F1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dialplans", "Dialplans", "{C5F182F9-754A-4EC5-B50F-76ED02BE13F4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Event Handlers", "Event Handlers", "{9ADF1E48-2F5C-4ED7-A893-596259FABFE0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formats", "Formats", "{A5A27244-AD24-46E5-B01B-840CD296C91D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Timers", "Timers", "{2D57D093-3F8D-4729-AD9A-68E945C200A5}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{CBD81696-EFB4-4D2F-8451-1B8DAA86155A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "docs", "docs\docs.vcproj", "{1A1FF289-4FD6-4285-A422-D31DD67A4723}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.vcproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Directories", "Directories", "{B8F5B47B-8568-46EB-B320-64C17D2A98BC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ldap", "src\mod\directories\mod_ldap\mod_ldap.vcproj", "{EC3E5C7F-EE09-47E2-80FE-546363D14A98}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.vcproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_zeroconf", "src\mod\event_handlers\mod_zeroconf\mod_zeroconf.vcproj", "{C7705DC4-2088-493E-AF8D-65BC6D65C125}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {49C34584-B6DA-448F-83CF-27584DC9FC90}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.vcproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.vcproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Languages", "Languages", "{0C808854-54D1-4230-BFF5-77B5FD905000}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "src\mod\languages\mod_spidermonkey\mod_spidermonkey.vcproj", "{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}"
+	ProjectSection(ProjectDependencies) = postProject
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cepstral", "src\mod\asr_tts\mod_cepstral\mod_cepstral.vcproj", "{692F6330-4D87-4C82-81DF-40DB5892636E}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_perl", "src\mod\languages\mod_perl\fs_perl.vcproj", "{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_perl", "src\mod\languages\mod_perl\mod_perl.vcproj", "{7B077E7F-1BE7-4291-AB86-55E527B25CAC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
+	ProjectSection(ProjectDependencies) = postProject
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.vcproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
+	ProjectSection(ProjectDependencies) = postProject
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{1906D736-08BD-4EE1-924F-B536249B9A54} = {1906D736-08BD-4EE1-924F-B536249B9A54}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.vcproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_console", "src\mod\loggers\mod_console\mod_console.vcproj", "{1C453396-D912-4213-89FD-9B489162B7B5}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XML Interfaces", "XML Interfaces", "{F69A4A6B-9360-4EBB-A280-22AA3C455AC5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.vcproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
+	ProjectSection(ProjectDependencies) = postProject
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {356EC96D-4C9F-47B5-9083-FC328B87BA94}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.vcproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.vcproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.vcproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.vcproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr", "src\mod\event_handlers\mod_cdr\mod_cdr.vcproj", "{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgsm", "libs\codec\gsm\libgsm.vcproj", "{8FD2E297-4096-47E5-9258-C48FF1841523}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libilbc", "libs\codec\ilbc\libilbc.vcproj", "{989BB874-7AF1-44CB-8E5C-CC8113D267E8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiax2", "libs\iax\libiax2.vcproj", "{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.vcproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
+	ProjectSection(ProjectDependencies) = postProject
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {E727E8F6-935D-46FE-8B0E-37834748A0E3}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "libs\srtp\libsrtp.vcproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsqlite", "libs\win32\sqlite\sqlite.vcproj", "{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "libs\win32\pcre\libpcre.vcproj", "{8D04B550-D240-4A44-8A18-35DA3F7038D9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {1CED5987-A529-46DC-B30F-870D85FF9C94}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre Generate pcre_chartables.c", "libs\win32\pcre\pcre_chartables.c.vcproj", "{1CED5987-A529-46DC-B30F-870D85FF9C94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample", "libs\win32\libresample\libresample.vcproj", "{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapr", "libs\win32\apr\libapr.vcproj", "{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapriconv", "libs\win32\apr-iconv\libapriconv.vcproj", "{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
+	ProjectSection(ProjectDependencies) = postProject
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {101130D1-3EA6-4ED2-B65D-CEB5243A20ED}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "libs\win32\speex\libspeex.vcproj", "{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.vcproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download HOWL", "libs\win32\Download HOWL.vcproj", "{5927104D-C14C-4AC8-925C-4AB681762E75}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "howl static library", "libs\win32\howl\libhowl.vcproj", "{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder static library", "libs\win32\howl\libmDNSResponder.vcproj", "{49C34584-B6DA-448F-83CF-27584DC9FC90}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}
+		{5927104D-C14C-4AC8-925C-4AB681762E75} = {5927104D-C14C-4AC8-925C-4AB681762E75}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.vcproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "libs\win32\curl\curllib.vcproj", "{87EE9DA4-DE1E-4448-8324-183C98DCA588}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlrpc", "libs\win32\xmlrpc\xmlrpc.vcproj", "{A3FE0076-B366-429D-A238-D7304DA7D3C1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Abyss", "libs\win32\xmlrpc\Abyss.vcproj", "{356EC96D-4C9F-47B5-9083-FC328B87BA94}"
+	ProjectSection(ProjectDependencies) = postProject
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {A3FE0076-B366-429D-A238-D7304DA7D3C1}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.vcproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "js", "libs\win32\js\js.vcproj", "{204FA0DE-305D-4414-AE2E-F195A23F390D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.vcproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg726", "libs\codec\g726\libg726.vcproj", "{5A6A281A-AA50-470A-8305-202BDA1CD1BF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g726", "src\mod\codecs\mod_g726\mod_g726.vcproj", "{486369EB-F150-4B56-BCC8-77B9E18FF5F5}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {5A6A281A-AA50-470A-8305-202BDA1CD1BF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg7xx", "libs\codec\g7xx\libg7xx.vcproj", "{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g722", "src\mod\codecs\mod_g722\mod_g722.vcproj", "{D42518CC-7475-454D-B392-0E132C07D761}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.vcproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pthread", "libs\win32\pthread\pthread.vcproj", "{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.vcproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.vcproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSwitch.NET", "src\dotnet\FreeSwitch.NET.csproj", "{251CAABC-16C3-4593-A491-603B908094E0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_core_db", "src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.vcproj", "{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_teletone", "src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.vcproj", "{8F992C49-6C51-412F-B2A3-34EAB708EB65}"
+	ProjectSection(ProjectDependencies) = postProject
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libudns", "libs\win32\udns\libudns.vcproj", "{4043FC6A-9A30-4577-8AD5-9B233C9575D8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applications\mod_enum\mod_enum.vcproj", "{71A967D5-0E99-4CEF-A587-98836EE6F2EF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_etpan", "src\mod\languages\mod_spidermonkey_etpan\mod_spidermonkey_etpan.vcproj", "{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_odbc", "src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.vcproj", "{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libs\win32\etpan\libetpan.vcproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.vcproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "say", "say", "{6CD61A1D-797C-470A-BE08-8C31B68BB336}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\mod_say_en\mod_say_en.vcproj", "{988CACF7-3FCB-4992-BE69-77872AE67DC8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\portaudio\build\msvc\portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.vcproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amr", "src\mod\codecs\mod_amr\mod_amr.vcproj", "{8DEB383C-4091-4F42-A56F-C9E46D552D79}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Config", "_Config", "{57D119DC-484F-420F-B9E9-8589FD9A8DF8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default", "Default", "{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}"
+	ProjectSection(SolutionItems) = preProject
+		conf\conference.conf.xml = conf\conference.conf.xml
+		conf\console.conf.xml = conf\console.conf.xml
+		conf\default_context.xml = conf\default_context.xml
+		conf\dialplan_directory.conf.xml = conf\dialplan_directory.conf.xml
+		conf\dingaling.conf.xml = conf\dingaling.conf.xml
+		conf\directory.xml = conf\directory.xml
+		conf\enum.conf.xml = conf\enum.conf.xml
+		conf\event_multicast.conf.xml = conf\event_multicast.conf.xml
+		conf\event_socket.conf.xml = conf\event_socket.conf.xml
+		conf\freeswitch.xml = conf\freeswitch.xml
+		conf\iax.conf.xml = conf\iax.conf.xml
+		conf\ivr.conf.xml = conf\ivr.conf.xml
+		conf\lang_en.xml = conf\lang_en.xml
+		conf\lang_fr.xml = conf\lang_fr.xml
+		conf\mod_cdr.conf.xml = conf\mod_cdr.conf.xml
+		conf\modules.conf.xml = conf\modules.conf.xml
+		conf\portaudio.conf.xml = conf\portaudio.conf.xml
+		conf\rss.conf.xml = conf\rss.conf.xml
+		conf\sofia.conf.xml = conf\sofia.conf.xml
+		conf\spidermonkey.conf.xml = conf\spidermonkey.conf.xml
+		conf\switch.conf.xml = conf\switch.conf.xml
+		conf\syslog.conf.xml = conf\syslog.conf.xml
+		conf\wanpipe.conf.xml = conf\wanpipe.conf.xml
+		conf\woomera.conf.xml = conf\woomera.conf.xml
+		conf\xml_cdr.conf.xml = conf\xml_cdr.conf.xml
+		conf\xml_curl.conf.xml = conf\xml_curl.conf.xml
+		conf\xml_rpc.conf.xml = conf\xml_rpc.conf.xml
+		conf\xmpp_event.conf.xml = conf\xmpp_event.conf.xml
+		conf\zeroconf.conf.xml = conf\zeroconf.conf.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Release", "Release", "{7BFD517E-7F8F-4A40-A78E-8D3632738227}"
+	ProjectSection(SolutionItems) = preProject
+		release\conf\conference.conf.xml = release\conf\conference.conf.xml
+		release\conf\console.conf.xml = release\conf\console.conf.xml
+		release\conf\default_context.xml = release\conf\default_context.xml
+		release\conf\dialplan_directory.conf.xml = release\conf\dialplan_directory.conf.xml
+		release\conf\dingaling.conf.xml = release\conf\dingaling.conf.xml
+		release\conf\directory.xml = release\conf\directory.xml
+		release\conf\enum.conf.xml = release\conf\enum.conf.xml
+		release\conf\event_multicast.conf.xml = release\conf\event_multicast.conf.xml
+		release\conf\event_socket.conf.xml = release\conf\event_socket.conf.xml
+		release\conf\freeswitch.xml = release\conf\freeswitch.xml
+		release\conf\freeswitch_combined.xml = release\conf\freeswitch_combined.xml
+		release\conf\iax.conf.xml = release\conf\iax.conf.xml
+		release\conf\ivr.conf.xml = release\conf\ivr.conf.xml
+		release\conf\lang_en.xml = release\conf\lang_en.xml
+		release\conf\lang_fr.xml = release\conf\lang_fr.xml
+		release\conf\mod_cdr.conf.xml = release\conf\mod_cdr.conf.xml
+		release\conf\modules.conf.xml = release\conf\modules.conf.xml
+		release\conf\portaudio.conf.xml = release\conf\portaudio.conf.xml
+		release\conf\rss.conf.xml = release\conf\rss.conf.xml
+		release\conf\sofia.conf.xml = release\conf\sofia.conf.xml
+		release\conf\spidermonkey.conf.xml = release\conf\spidermonkey.conf.xml
+		release\conf\switch.conf.xml = release\conf\switch.conf.xml
+		release\conf\syslog.conf.xml = release\conf\syslog.conf.xml
+		release\conf\wanpipe.conf.xml = release\conf\wanpipe.conf.xml
+		release\conf\woomera.conf.xml = release\conf\woomera.conf.xml
+		release\conf\xml_cdr.conf.xml = release\conf\xml_cdr.conf.xml
+		release\conf\xml_curl.conf.xml = release\conf\xml_curl.conf.xml
+		release\conf\xml_rpc.conf.xml = release\conf\xml_rpc.conf.xml
+		release\conf\xmpp_event.conf.xml = release\conf\xmpp_event.conf.xml
+		release\conf\zeroconf.conf.xml = release\conf\zeroconf.conf.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug", "Debug", "{6374D55C-FABE-4A02-9CF1-4145308A56C5}"
+	ProjectSection(SolutionItems) = preProject
+		debug\conf\conference.conf.xml = debug\conf\conference.conf.xml
+		debug\conf\console.conf.xml = debug\conf\console.conf.xml
+		debug\conf\default_context.xml = debug\conf\default_context.xml
+		debug\conf\dialplan_directory.conf.xml = debug\conf\dialplan_directory.conf.xml
+		debug\conf\dingaling.conf.xml = debug\conf\dingaling.conf.xml
+		debug\conf\directory.xml = debug\conf\directory.xml
+		debug\conf\enum.conf.xml = debug\conf\enum.conf.xml
+		debug\conf\event_multicast.conf.xml = debug\conf\event_multicast.conf.xml
+		debug\conf\event_socket.conf.xml = debug\conf\event_socket.conf.xml
+		debug\conf\freeswitch.xml = debug\conf\freeswitch.xml
+		debug\conf\freeswitch_combined.xml = debug\conf\freeswitch_combined.xml
+		debug\conf\iax.conf.xml = debug\conf\iax.conf.xml
+		debug\conf\ivr.conf.xml = debug\conf\ivr.conf.xml
+		debug\conf\lang_en.xml = debug\conf\lang_en.xml
+		debug\conf\lang_fr.xml = debug\conf\lang_fr.xml
+		debug\conf\mod_cdr.conf.xml = debug\conf\mod_cdr.conf.xml
+		debug\conf\modules.conf.xml = debug\conf\modules.conf.xml
+		debug\conf\portaudio.conf.xml = debug\conf\portaudio.conf.xml
+		debug\conf\rss.conf.xml = debug\conf\rss.conf.xml
+		debug\conf\sofia.conf.xml = debug\conf\sofia.conf.xml
+		debug\conf\spidermonkey.conf.xml = debug\conf\spidermonkey.conf.xml
+		debug\conf\switch.conf.xml = debug\conf\switch.conf.xml
+		debug\conf\syslog.conf.xml = debug\conf\syslog.conf.xml
+		debug\conf\wanpipe.conf.xml = debug\conf\wanpipe.conf.xml
+		debug\conf\woomera.conf.xml = debug\conf\woomera.conf.xml
+		debug\conf\xml_cdr.conf.xml = debug\conf\xml_cdr.conf.xml
+		debug\conf\xml_curl.conf.xml = debug\conf\xml_curl.conf.xml
+		debug\conf\xml_rpc.conf.xml = debug\conf\xml_rpc.conf.xml
+		debug\conf\xmpp_event.conf.xml = debug\conf\xmpp_event.conf.xml
+		debug\conf\zeroconf.conf.xml = debug\conf\zeroconf.conf.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build System", "{DB1024A8-41BF-4AD7-9AE6-13202230D1F3}"
+	ProjectSection(SolutionItems) = preProject
+		acsite.m4 = acsite.m4
+		build\buildlib.sh = build\buildlib.sh
+		configure.in = configure.in
+		Makefile.am = Makefile.am
+		build\modules.conf.in = build\modules.conf.in
+		libs\win32\util.vbs = libs\win32\util.vbs
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "m4", "m4", "{CDE9B06A-3C27-4987-8FAE-DF1006BC705D}"
+	ProjectSection(SolutionItems) = preProject
+		build\config\ac_cflags_gcc_option.m4 = build\config\ac_cflags_gcc_option.m4
+		build\config\ac_cflags_sun_option.m4 = build\config\ac_cflags_sun_option.m4
+		build\config\ac_gcc_archflag.m4 = build\config\ac_gcc_archflag.m4
+		build\config\ac_gcc_x86_cpuid.m4 = build\config\ac_gcc_x86_cpuid.m4
+		build\config\ac_prog_gzip.m4 = build\config\ac_prog_gzip.m4
+		build\config\ac_prog_wget.m4 = build\config\ac_prog_wget.m4
+		build\config\ax_cc_maxopt.m4 = build\config\ax_cc_maxopt.m4
+		build\config\ax_cflags_warn_all_ansi.m4 = build\config\ax_cflags_warn_all_ansi.m4
+		build\config\ax_check_compiler_flags.m4 = build\config\ax_check_compiler_flags.m4
+		build\config\ax_compiler_vendor.m4 = build\config\ax_compiler_vendor.m4
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h26x", "src\mod\codecs\mod_h26x\mod_h26x.vcproj", "{2C3C2423-234B-4772-8899-D3B137E5CA35}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_esf", "src\mod\applications\mod_esf\mod_esf.vcproj", "{3850D93A-5F24-4922-BC1C-74D08C37C256}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_local_stream", "src\mod\formats\mod_local_stream\mod_local_stream.vcproj", "{2CA40887-1622-46A1-A7F9-17FD7E7E545B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mediaframe", "libs\openmrcp\mediaframe\mediaframe.vcproj", "{AA91F0AC-6562-435E-814C-5C94689FEFA2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpcore", "libs\openmrcp\mrcpcore\mrcpcore.vcproj", "{829A9309-3B94-43C0-846B-7EC9D6D35F8B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2} = {AA91F0AC-6562-435E-814C-5C94689FEFA2}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtspcore", "libs\openmrcp\rtspcore\rtspcore.vcproj", "{EB751DC4-87BD-4766-B78D-DFB64BA9F988}"
+	ProjectSection(ProjectDependencies) = postProject
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpmediaframe", "libs\openmrcp\module\mrcpmediaframe\mrcpmediaframe.vcproj", "{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcprtsp", "libs\openmrcp\module\mrcprtsp\mrcprtsp.vcproj", "{CF78E84D-8456-44F2-8197-0E0E88D30A3C}"
+	ProjectSection(ProjectDependencies) = postProject
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988} = {EB751DC4-87BD-4766-B78D-DFB64BA9F988}
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "openmrcp", "openmrcp", "{ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpsofiasip", "libs\openmrcp\module\mrcpsofiasip\mrcpsofiasip.vcproj", "{819C7242-6184-46FE-BC7B-C7E25C0581EE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpv2agent", "libs\openmrcp\module\mrcpv2agent\mrcpv2agent.vcproj", "{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}"
+	ProjectSection(ProjectDependencies) = postProject
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {829A9309-3B94-43C0-846B-7EC9D6D35F8B}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopenmrcpclient", "libs\openmrcp\platform\openmrcpclient\libopenmrcpclient.vcproj", "{A407B661-D7DC-4E30-B268-FFF3296C35E6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E} = {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6} = {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE} = {819C7242-6184-46FE-BC7B-C7E25C0581EE}
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C} = {CF78E84D-8456-44F2-8197-0E0E88D30A3C}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_openmrcp", "src\mod\asr_tts\mod_openmrcp\mod_openmrcp.vcproj", "{E7116F50-2B10-472F-92BD-C8667AA9C1AE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6} = {A407B661-D7DC-4E30-B268-FFF3296C35E6}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_socket", "src\mod\languages\mod_spidermonkey_socket\mod_spidermonkey_socket.vcproj", "{028C7278-05D7-4E18-82FE-BE231B844F41}"
+	ProjectSection(ProjectDependencies) = postProject
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release|Win32
+		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|Win32.Build.0 = Debug|Win32
+		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Debug|x64.ActiveCfg = Debug|Win32
+		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|Win32.ActiveCfg = Release|Win32
+		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|Win32.Build.0 = Release|Win32
+		{4926323F-4EA8-4B7D-A3D3-65488725988F}.Release|x64.ActiveCfg = Release|Win32
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|Win32.Build.0 = Debug|Win32
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Debug|x64.ActiveCfg = Debug|Win32
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|Win32.ActiveCfg = Release|Win32
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|Win32.Build.0 = Release|Win32
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59}.Release|x64.ActiveCfg = Release|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.Build.0 = Debug|Win32
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|x64.ActiveCfg = Debug|Win32
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Release|Win32.ActiveCfg = Release|Win32
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Release|Win32.Build.0 = Release|Win32
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Release|x64.ActiveCfg = Release|Win32
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Debug|Win32.Build.0 = Debug|Win32
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Debug|x64.ActiveCfg = Debug|Win32
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Release|Win32.ActiveCfg = Release|Win32
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Release|Win32.Build.0 = Release|Win32
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE}.Release|x64.ActiveCfg = Release|Win32
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.Build.0 = Debug|Win32
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|x64.ActiveCfg = Debug|Win32
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|Win32
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Debug|Win32.Build.0 = Debug|Win32
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Debug|x64.ActiveCfg = Debug|Win32
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Release|Win32.ActiveCfg = Release|Win32
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Release|Win32.Build.0 = Release|Win32
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88}.Release|x64.ActiveCfg = Release|Win32
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Debug|Win32.Build.0 = Debug|Win32
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Debug|x64.ActiveCfg = Debug|Win32
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Release|Win32.ActiveCfg = Release|Win32
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Release|Win32.Build.0 = Release|Win32
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5}.Release|x64.ActiveCfg = Release|Win32
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.Build.0 = Debug|Win32
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|x64.ActiveCfg = Debug|Win32
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.ActiveCfg = Release|Win32
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.Build.0 = Release|Win32
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|x64.ActiveCfg = Release|Win32
+		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32
+		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.ActiveCfg = Debug|Win32
+		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32
+		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32
+		{FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.ActiveCfg = Release|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32
+		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|Win32.ActiveCfg = Debug
+		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.ActiveCfg = Debug with MySql
+		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.Build.0 = Debug with MySql
+		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|Win32.ActiveCfg = Release
+		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|x64.ActiveCfg = Release with MySql
+		{B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|x64.Build.0 = Release with MySql
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|Win32
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.Build.0 = Debug|Win32
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|x64.ActiveCfg = Debug|Win32
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.ActiveCfg = Release|Win32
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.Build.0 = Release|Win32
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|x64.ActiveCfg = Release|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|Win32
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.ActiveCfg = Debug|Win32
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.ActiveCfg = Release|Win32
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|Win32
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|Win32
+		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Debug|x64.ActiveCfg = Debug|Win32
+		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Release|Win32.ActiveCfg = Release|Win32
+		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Release|x64.ActiveCfg = Release|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|Win32
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|Win32.Build.0 = Debug|Win32
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|x64.ActiveCfg = Debug|Win32
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|Win32.ActiveCfg = Release|Win32
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|Win32.Build.0 = Release|Win32
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|x64.ActiveCfg = Release|Win32
+		{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|Win32.Build.0 = Debug|Win32
+		{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|x64.ActiveCfg = Debug|Win32
+		{8FD2E297-4096-47E5-9258-C48FF1841523}.Release|Win32.ActiveCfg = Release|Win32
+		{8FD2E297-4096-47E5-9258-C48FF1841523}.Release|Win32.Build.0 = Release|Win32
+		{8FD2E297-4096-47E5-9258-C48FF1841523}.Release|x64.ActiveCfg = Release|Win32
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.Build.0 = Debug|Win32
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|x64.ActiveCfg = Debug|Win32
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.ActiveCfg = Release|Win32
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.Build.0 = Release|Win32
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|x64.ActiveCfg = Release|Win32
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Debug|Win32.Build.0 = Debug|Win32
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Debug|x64.ActiveCfg = Debug|Win32
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Release|Win32.ActiveCfg = Release|Win32
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Release|Win32.Build.0 = Release|Win32
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}.Release|x64.ActiveCfg = Release|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|x64.ActiveCfg = Debug|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release|Win32
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|x64.ActiveCfg = Release|Win32
+		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.Build.0 = Debug|Win32
+		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|x64.ActiveCfg = Debug|Win32
+		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.ActiveCfg = Release|Win32
+		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.Build.0 = Release|Win32
+		{1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|x64.ActiveCfg = Release|Win32
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.ActiveCfg = Debug|Win32
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.Build.0 = Debug|Win32
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|x64.ActiveCfg = Debug|Win32
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.ActiveCfg = Release|Win32
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.Build.0 = Release|Win32
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|x64.ActiveCfg = Release|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|Win32
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Debug|Win32.ActiveCfg = Debug|Win32
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Debug|Win32.Build.0 = Debug|Win32
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Debug|x64.ActiveCfg = Debug|Win32
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Release|Win32.ActiveCfg = Release|Win32
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Release|Win32.Build.0 = Release|Win32
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED}.Release|x64.ActiveCfg = Release|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|Win32
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.Build.0 = Debug|Win32
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|x64.ActiveCfg = Debug|Win32
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.ActiveCfg = Release|Win32
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.Build.0 = Release|Win32
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|x64.ActiveCfg = Release|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|Win32
+		{5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.Build.0 = Debug|Win32
+		{5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|x64.ActiveCfg = Debug|Win32
+		{5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.ActiveCfg = Release|Win32
+		{5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.Build.0 = Release|Win32
+		{5927104D-C14C-4AC8-925C-4AB681762E75}.Release|x64.ActiveCfg = Release|Win32
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.Build.0 = Debug|Win32
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|x64.ActiveCfg = Debug|Win32
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.ActiveCfg = Release|Win32
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.Build.0 = Release|Win32
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|x64.ActiveCfg = Release|Win32
+		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.ActiveCfg = Debug|Win32
+		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.Build.0 = Debug|Win32
+		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|x64.ActiveCfg = Debug|Win32
+		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.ActiveCfg = Release|Win32
+		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.Build.0 = Release|Win32
+		{49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|x64.ActiveCfg = Release|Win32
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|Win32
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|Win32
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.ActiveCfg = Debug|Win32
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.ActiveCfg = Release|Win32
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Debug|Win32.Build.0 = Debug|Win32
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Debug|x64.ActiveCfg = Debug|Win32
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Release|Win32.ActiveCfg = Release|Win32
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Release|Win32.Build.0 = Release|Win32
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1}.Release|x64.ActiveCfg = Release|Win32
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Debug|Win32.ActiveCfg = Debug|Win32
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Debug|Win32.Build.0 = Debug|Win32
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Debug|x64.ActiveCfg = Debug|Win32
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Release|Win32.ActiveCfg = Release|Win32
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Release|Win32.Build.0 = Release|Win32
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94}.Release|x64.ActiveCfg = Release|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|Win32
+		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.Build.0 = Debug|Win32
+		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|x64.ActiveCfg = Debug|Win32
+		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.ActiveCfg = Release|Win32
+		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.Build.0 = Release|Win32
+		{204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|x64.ActiveCfg = Release|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|Win32
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|Win32.Build.0 = Debug|Win32
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Debug|x64.ActiveCfg = Debug|Win32
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|Win32.ActiveCfg = Release|Win32
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|Win32.Build.0 = Release|Win32
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF}.Release|x64.ActiveCfg = Release|Win32
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Debug|Win32.Build.0 = Debug|Win32
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Debug|x64.ActiveCfg = Debug|Win32
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Release|Win32.ActiveCfg = Release|Win32
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Release|Win32.Build.0 = Release|Win32
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5}.Release|x64.ActiveCfg = Release|Win32
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Debug|Win32.Build.0 = Debug|Win32
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Debug|x64.ActiveCfg = Debug|Win32
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Release|Win32.ActiveCfg = Release|Win32
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Release|Win32.Build.0 = Release|Win32
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}.Release|x64.ActiveCfg = Release|Win32
+		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|Win32.Build.0 = Debug|Win32
+		{D42518CC-7475-454D-B392-0E132C07D761}.Debug|x64.ActiveCfg = Debug|Win32
+		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.ActiveCfg = Release|Win32
+		{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.Build.0 = Release|Win32
+		{D42518CC-7475-454D-B392-0E132C07D761}.Release|x64.ActiveCfg = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|Win32
+		{251CAABC-16C3-4593-A491-603B908094E0}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{251CAABC-16C3-4593-A491-603B908094E0}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{251CAABC-16C3-4593-A491-603B908094E0}.Release|Win32.ActiveCfg = Release|Any CPU
+		{251CAABC-16C3-4593-A491-603B908094E0}.Release|x64.ActiveCfg = Release|Any CPU
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.Build.0 = Debug|Win32
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.ActiveCfg = Debug|Win32
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.ActiveCfg = Release|Win32
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.Build.0 = Release|Win32
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.ActiveCfg = Release|Win32
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.Build.0 = Debug|Win32
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.ActiveCfg = Debug|Win32
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.ActiveCfg = Release|Win32
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.Build.0 = Release|Win32
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.ActiveCfg = Release|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.Build.0 = Debug|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.Build.0 = Release|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|Win32
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|Win32.Build.0 = Debug|Win32
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|x64.ActiveCfg = Debug|Win32
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|Win32.ActiveCfg = Release|Win32
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|Win32.Build.0 = Release|Win32
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|x64.ActiveCfg = Release|Win32
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|Win32
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|Win32
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|Win32.Build.0 = Debug|Win32
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|x64.ActiveCfg = Debug|Win32
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|Win32.ActiveCfg = Release|Win32
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|Win32.Build.0 = Release|Win32
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|x64.ActiveCfg = Release|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|Win32
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.Build.0 = Debug|Win32
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|x64.ActiveCfg = Debug|Win32
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.ActiveCfg = Release|Win32
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.Build.0 = Release|Win32
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|x64.ActiveCfg = Release|Win32
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.Build.0 = Debug|Win32
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|x64.ActiveCfg = Debug|Win32
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.ActiveCfg = Release|Win32
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.Build.0 = Release|Win32
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|x64.ActiveCfg = Release|Win32
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.Build.0 = Debug|Win32
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|x64.ActiveCfg = Debug|Win32
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.ActiveCfg = Release|Win32
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.Build.0 = Release|Win32
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|x64.ActiveCfg = Release|Win32
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.Build.0 = Debug|Win32
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|x64.ActiveCfg = Debug|Win32
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.ActiveCfg = Release|Win32
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.Build.0 = Release|Win32
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|x64.ActiveCfg = Release|Win32
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.ActiveCfg = Debug Static|Win32
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.Build.0 = Debug Static|Win32
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|x64.ActiveCfg = Debug|Win32
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.ActiveCfg = Release Static|Win32
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.Build.0 = Release Static|Win32
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|x64.ActiveCfg = Release|Win32
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.ActiveCfg = Debug Static|Win32
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.Build.0 = Debug Static|Win32
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|x64.ActiveCfg = Debug|Win32
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.ActiveCfg = Release Static|Win32
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.Build.0 = Release Static|Win32
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|x64.ActiveCfg = Release|Win32
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.Build.0 = Debug|Win32
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|x64.ActiveCfg = Debug|Win32
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.ActiveCfg = Release|Win32
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.Build.0 = Release|Win32
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|x64.ActiveCfg = Release|Win32
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.Build.0 = Debug|Win32
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|x64.ActiveCfg = Debug|Win32
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.ActiveCfg = Release|Win32
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.Build.0 = Release|Win32
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|x64.ActiveCfg = Release|Win32
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.Build.0 = Debug|Win32
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|x64.ActiveCfg = Debug|Win32
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.ActiveCfg = Release|Win32
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.Build.0 = Release|Win32
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|x64.ActiveCfg = Release|Win32
+		{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.ActiveCfg = Debug|Win32
+		{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.Build.0 = Debug|Win32
+		{028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.ActiveCfg = Debug|Win32
+		{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.ActiveCfg = Release|Win32
+		{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.Build.0 = Release|Win32
+		{028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.ActiveCfg = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{4926323F-4EA8-4B7D-A3D3-65488725988F} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{B1FE4613-3F4B-4DAF-9714-2472BF8F56AE} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{5844AFE1-AA3E-4BDB-A9EF-119AEF19DF88} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{5580D60E-0F77-4716-9CD4-B8E5986FA375} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{486369EB-F150-4B56-BCC8-77B9E18FF5F5} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{D42518CC-7475-454D-B392-0E132C07D761} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{F10BE67C-A8FF-4CB2-AF29-D46D2590DC59} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{C7705DC4-2088-493E-AF8D-65BC6D65C125} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{784113EF-44D9-4949-835D-7065D3C7AD08} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{05515420-16DE-4E63-BE73-85BE85BA5142} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5} = {2D57D093-3F8D-4729-AD9A-68E945C200A5}
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
+		{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{8FD2E297-4096-47E5-9258-C48FF1841523} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1906D736-08BD-4EE1-924F-B536249B9A54} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{8D04B550-D240-4A44-8A18-35DA3F7038D9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1CED5987-A529-46DC-B30F-870D85FF9C94} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{50AD0E28-B8D7-4FCC-8FC3-599F6AC69761} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{101130D1-3EA6-4ED2-B65D-CEB5243A20ED} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1C469CDD-A3AF-4A94-A592-B2CF12F2D918} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{0D826AF5-0506-4C50-BB8B-7DB019AC21AE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{49C34584-B6DA-448F-83CF-27584DC9FC90} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{3D0370CA-BED2-4657-A475-32375CBCB6E4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{A3FE0076-B366-429D-A238-D7304DA7D3C1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{356EC96D-4C9F-47B5-9083-FC328B87BA94} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{204FA0DE-305D-4414-AE2E-F195A23F390D} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{5A6A281A-AA50-470A-8305-202BDA1CD1BF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{8F992C49-6C51-412F-B2A3-34EAB708EB65} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{028C7278-05D7-4E18-82FE-BE231B844F41} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
+		{E7116F50-2B10-472F-92BD-C8667AA9C1AE} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
+		{1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+		{5927104D-C14C-4AC8-925C-4AB681762E75} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
+		{7BFD517E-7F8F-4A40-A78E-8D3632738227} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
+		{6374D55C-FABE-4A02-9CF1-4145308A56C5} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
+		{CDE9B06A-3C27-4987-8FAE-DF1006BC705D} = {DB1024A8-41BF-4AD7-9AE6-13202230D1F3}
+		{829A9309-3B94-43C0-846B-7EC9D6D35F8B} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{EB751DC4-87BD-4766-B78D-DFB64BA9F988} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{9EA22C31-BB7E-4C40-A698-2C6792D1E0C6} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{CF78E84D-8456-44F2-8197-0E0E88D30A3C} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{AA91F0AC-6562-435E-814C-5C94689FEFA2} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{819C7242-6184-46FE-BC7B-C7E25C0581EE} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{FB64EA08-3BC0-48AE-BE4B-74F1024B756E} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+		{A407B661-D7DC-4E30-B268-FFF3296C35E6} = {ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE}
+	EndGlobalSection
+EndGlobal

Modified: freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.c	Fri Sep 21 14:49:14 2007
@@ -1,109 +1,109 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       FrameClassify.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include "iLBC_define.h"
-   
-   /*---------------------------------------------------------------*
-    *  Classification of subframes to localize start state
-    *--------------------------------------------------------------*/
-   
-   int FrameClassify(      /* index to the max-energy sub-frame */
-       iLBC_Enc_Inst_t *iLBCenc_inst, 
-                           /* (i/o) the encoder state structure */
-       float *residual     /* (i) lpc residual signal */
-   ) {
-       float max_ssqEn, fssqEn[NSUB_MAX], bssqEn[NSUB_MAX], *pp;
-       int n, l, max_ssqEn_n;
-       const float ssqEn_win[NSUB_MAX-1]={(float)0.8,(float)0.9,
-           (float)1.0,(float)0.9,(float)0.8};
-       const float sampEn_win[5]={(float)1.0/(float)6.0, 
-           (float)2.0/(float)6.0, (float)3.0/(float)6.0,
-           (float)4.0/(float)6.0, (float)5.0/(float)6.0};
-       
-       /* init the front and back energies to zero */
-   
-       memset(fssqEn, 0, NSUB_MAX*sizeof(float));
-       memset(bssqEn, 0, NSUB_MAX*sizeof(float));
-   
-       /* Calculate front of first seqence */
-   
-       n=0;
-       pp=residual;
-   
-   
-       for (l=0; l<5; l++) {
-           fssqEn[n] += sampEn_win[l] * (*pp) * (*pp);
-           pp++;
-       }
-       for (l=5; l<SUBL; l++) {
-           fssqEn[n] += (*pp) * (*pp);
-           pp++;
-       }
-   
-       /* Calculate front and back of all middle sequences */
-   
-       for (n=1; n<iLBCenc_inst->nsub-1; n++) {
-           pp=residual+n*SUBL;
-           for (l=0; l<5; l++) {
-               fssqEn[n] += sampEn_win[l] * (*pp) * (*pp);
-               bssqEn[n] += (*pp) * (*pp);
-               pp++;
-           }
-           for (l=5; l<SUBL-5; l++) {
-               fssqEn[n] += (*pp) * (*pp);
-               bssqEn[n] += (*pp) * (*pp);
-               pp++;
-           }
-           for (l=SUBL-5; l<SUBL; l++) {
-               fssqEn[n] += (*pp) * (*pp);
-               bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp);
-               pp++;
-           }
-       }
-   
-       /* Calculate back of last seqence */
-   
-       n=iLBCenc_inst->nsub-1;
-       pp=residual+n*SUBL;
-       for (l=0; l<SUBL-5; l++) {
-           bssqEn[n] += (*pp) * (*pp);
-           pp++;
-       }
-       for (l=SUBL-5; l<SUBL; l++) {
-           bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp);
-           pp++;
-       }
-   
-       /* find the index to the weighted 80 sample with 
-          most energy */
-   
-       if (iLBCenc_inst->mode==20) l=1;
-       else                        l=0;
-   
-       max_ssqEn=(fssqEn[0]+bssqEn[1])*ssqEn_win[l];
-       max_ssqEn_n=1;
-       for (n=2; n<iLBCenc_inst->nsub; n++) {
-   
-           l++;
-   
-   
-           if ((fssqEn[n-1]+bssqEn[n])*ssqEn_win[l] > max_ssqEn) {
-               max_ssqEn=(fssqEn[n-1]+bssqEn[n]) *
-                               ssqEn_win[l];
-               max_ssqEn_n=n;
-           }
-       }
-   
-       return max_ssqEn_n;
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       FrameClassify.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include "iLBC_define.h"
+   
+   /*---------------------------------------------------------------*
+    *  Classification of subframes to localize start state
+    *--------------------------------------------------------------*/
+   
+   int FrameClassify(      /* index to the max-energy sub-frame */
+       iLBC_Enc_Inst_t *iLBCenc_inst, 
+                           /* (i/o) the encoder state structure */
+       float *residual     /* (i) lpc residual signal */
+   ) {
+       float max_ssqEn, fssqEn[NSUB_MAX], bssqEn[NSUB_MAX], *pp;
+       int n, l, max_ssqEn_n;
+       const float ssqEn_win[NSUB_MAX-1]={(float)0.8,(float)0.9,
+           (float)1.0,(float)0.9,(float)0.8};
+       const float sampEn_win[5]={(float)1.0/(float)6.0, 
+           (float)2.0/(float)6.0, (float)3.0/(float)6.0,
+           (float)4.0/(float)6.0, (float)5.0/(float)6.0};
+       
+       /* init the front and back energies to zero */
+   
+       memset(fssqEn, 0, NSUB_MAX*sizeof(float));
+       memset(bssqEn, 0, NSUB_MAX*sizeof(float));
+   
+       /* Calculate front of first seqence */
+   
+       n=0;
+       pp=residual;
+   
+   
+       for (l=0; l<5; l++) {
+           fssqEn[n] += sampEn_win[l] * (*pp) * (*pp);
+           pp++;
+       }
+       for (l=5; l<SUBL; l++) {
+           fssqEn[n] += (*pp) * (*pp);
+           pp++;
+       }
+   
+       /* Calculate front and back of all middle sequences */
+   
+       for (n=1; n<iLBCenc_inst->nsub-1; n++) {
+           pp=residual+n*SUBL;
+           for (l=0; l<5; l++) {
+               fssqEn[n] += sampEn_win[l] * (*pp) * (*pp);
+               bssqEn[n] += (*pp) * (*pp);
+               pp++;
+           }
+           for (l=5; l<SUBL-5; l++) {
+               fssqEn[n] += (*pp) * (*pp);
+               bssqEn[n] += (*pp) * (*pp);
+               pp++;
+           }
+           for (l=SUBL-5; l<SUBL; l++) {
+               fssqEn[n] += (*pp) * (*pp);
+               bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp);
+               pp++;
+           }
+       }
+   
+       /* Calculate back of last seqence */
+   
+       n=iLBCenc_inst->nsub-1;
+       pp=residual+n*SUBL;
+       for (l=0; l<SUBL-5; l++) {
+           bssqEn[n] += (*pp) * (*pp);
+           pp++;
+       }
+       for (l=SUBL-5; l<SUBL; l++) {
+           bssqEn[n] += sampEn_win[SUBL-l-1] * (*pp) * (*pp);
+           pp++;
+       }
+   
+       /* find the index to the weighted 80 sample with 
+          most energy */
+   
+       if (iLBCenc_inst->mode==20) l=1;
+       else                        l=0;
+   
+       max_ssqEn=(fssqEn[0]+bssqEn[1])*ssqEn_win[l];
+       max_ssqEn_n=1;
+       for (n=2; n<iLBCenc_inst->nsub; n++) {
+   
+           l++;
+   
+   
+           if ((fssqEn[n-1]+bssqEn[n])*ssqEn_win[l] > max_ssqEn) {
+               max_ssqEn=(fssqEn[n-1]+bssqEn[n]) *
+                               ssqEn_win[l];
+               max_ssqEn_n=n;
+           }
+       }
+   
+       return max_ssqEn_n;
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/FrameClassify.h	Fri Sep 21 14:49:14 2007
@@ -1,26 +1,26 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       FrameClassify.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   
-   
-   #ifndef __iLBC_FRAMECLASSIFY_H
-   #define __iLBC_FRAMECLASSIFY_H
-   
-   int FrameClassify(      /* index to the max-energy sub-frame */
-       iLBC_Enc_Inst_t *iLBCenc_inst, 
-                           /* (i/o) the encoder state structure */
-       float *residual     /* (i) lpc residual signal */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       FrameClassify.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   
+   
+   #ifndef __iLBC_FRAMECLASSIFY_H
+   #define __iLBC_FRAMECLASSIFY_H
+   
+   int FrameClassify(      /* index to the max-energy sub-frame */
+       iLBC_Enc_Inst_t *iLBCenc_inst, 
+                           /* (i/o) the encoder state structure */
+       float *residual     /* (i) lpc residual signal */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.c	Fri Sep 21 14:49:14 2007
@@ -1,151 +1,151 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       LPC_decode.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <string.h>
-   
-   #include "helpfun.h"
-   #include "lsf.h"
-   #include "iLBC_define.h"
-   #include "constants.h"
-   
-   /*---------------------------------------------------------------*
-    *  interpolation of lsf coefficients for the decoder
-    *--------------------------------------------------------------*/
-   
-   void LSFinterpolate2a_dec( 
-       float *a,           /* (o) lpc coefficients for a sub-frame */
-       float *lsf1,    /* (i) first lsf coefficient vector */
-   
-   
-       float *lsf2,    /* (i) second lsf coefficient vector */
-       float coef,         /* (i) interpolation weight */
-       int length          /* (i) length of lsf vectors */
-   ){
-       float  lsftmp[LPC_FILTERORDER];
-       
-       interpolate(lsftmp, lsf1, lsf2, coef, length);
-       lsf2a(a, lsftmp);
-   }
-   
-   /*---------------------------------------------------------------*
-    *  obtain dequantized lsf coefficients from quantization index 
-    *--------------------------------------------------------------*/
-   
-   void SimplelsfDEQ(
-       float *lsfdeq,    /* (o) dequantized lsf coefficients */
-       int *index,         /* (i) quantization index */
-       int lpc_n           /* (i) number of LPCs */
-   ){  
-       int i, j, pos, cb_pos;
-   
-       /* decode first LSF */
-       
-       pos = 0;
-       cb_pos = 0;
-       for (i = 0; i < LSF_NSPLIT; i++) {
-           for (j = 0; j < dim_lsfCbTbl[i]; j++) {
-               lsfdeq[pos + j] = lsfCbTbl[cb_pos + 
-                   (long)(index[i])*dim_lsfCbTbl[i] + j];
-           }       
-           pos += dim_lsfCbTbl[i];
-           cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i];
-       }
-   
-       if (lpc_n>1) {
-   
-           /* decode last LSF */
-   
-           pos = 0;
-           cb_pos = 0;
-           for (i = 0; i < LSF_NSPLIT; i++) {
-               for (j = 0; j < dim_lsfCbTbl[i]; j++) {
-                   lsfdeq[LPC_FILTERORDER + pos + j] = 
-                       lsfCbTbl[cb_pos + 
-                       (long)(index[LSF_NSPLIT + i])*
-                       dim_lsfCbTbl[i] + j];
-               }       
-               pos += dim_lsfCbTbl[i];
-               cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i];
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-   
-   
-    *  obtain synthesis and weighting filters form lsf coefficients 
-    *---------------------------------------------------------------*/
-   
-   void DecoderInterpolateLSF( 
-       float *syntdenum, /* (o) synthesis filter coefficients */
-       float *weightdenum, /* (o) weighting denumerator 
-                                  coefficients */
-       float *lsfdeq,       /* (i) dequantized lsf coefficients */
-       int length,         /* (i) length of lsf coefficient vector */
-       iLBC_Dec_Inst_t *iLBCdec_inst 
-                           /* (i) the decoder state structure */
-   ){
-       int    i, pos, lp_length;
-       float  lp[LPC_FILTERORDER + 1], *lsfdeq2;
-           
-       lsfdeq2 = lsfdeq + length;
-       lp_length = length + 1;
-       
-       if (iLBCdec_inst->mode==30) {
-           /* sub-frame 1: Interpolation between old and first */
-   
-           LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, lsfdeq, 
-               lsf_weightTbl_30ms[0], length);
-           memcpy(syntdenum,lp,lp_length*sizeof(float));
-           bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, 
-               lp_length);
-   
-           /* sub-frames 2 to 6: interpolation between first 
-              and last LSF */
-       
-           pos = lp_length;
-           for (i = 1; i < 6; i++) {
-               LSFinterpolate2a_dec(lp, lsfdeq, lsfdeq2, 
-                   lsf_weightTbl_30ms[i], length);
-               memcpy(syntdenum + pos,lp,lp_length*sizeof(float));
-               bwexpand(weightdenum + pos, lp, 
-                   LPC_CHIRP_WEIGHTDENUM, lp_length);
-               pos += lp_length;
-           }
-       }
-       else {
-           pos = 0;
-           for (i = 0; i < iLBCdec_inst->nsub; i++) {
-               LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, 
-                   lsfdeq, lsf_weightTbl_20ms[i], length);
-               memcpy(syntdenum+pos,lp,lp_length*sizeof(float));
-               bwexpand(weightdenum+pos, lp, LPC_CHIRP_WEIGHTDENUM, 
-                   lp_length);
-               pos += lp_length;
-           }
-       }
-       
-       /* update memory */
-   
-   
-   
-       if (iLBCdec_inst->mode==30)
-           memcpy(iLBCdec_inst->lsfdeqold, lsfdeq2, 
-                       length*sizeof(float));
-       else
-           memcpy(iLBCdec_inst->lsfdeqold, lsfdeq, 
-                       length*sizeof(float));
-   
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       LPC_decode.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <string.h>
+   
+   #include "helpfun.h"
+   #include "lsf.h"
+   #include "iLBC_define.h"
+   #include "constants.h"
+   
+   /*---------------------------------------------------------------*
+    *  interpolation of lsf coefficients for the decoder
+    *--------------------------------------------------------------*/
+   
+   void LSFinterpolate2a_dec( 
+       float *a,           /* (o) lpc coefficients for a sub-frame */
+       float *lsf1,    /* (i) first lsf coefficient vector */
+   
+   
+       float *lsf2,    /* (i) second lsf coefficient vector */
+       float coef,         /* (i) interpolation weight */
+       int length          /* (i) length of lsf vectors */
+   ){
+       float  lsftmp[LPC_FILTERORDER];
+       
+       interpolate(lsftmp, lsf1, lsf2, coef, length);
+       lsf2a(a, lsftmp);
+   }
+   
+   /*---------------------------------------------------------------*
+    *  obtain dequantized lsf coefficients from quantization index 
+    *--------------------------------------------------------------*/
+   
+   void SimplelsfDEQ(
+       float *lsfdeq,    /* (o) dequantized lsf coefficients */
+       int *index,         /* (i) quantization index */
+       int lpc_n           /* (i) number of LPCs */
+   ){  
+       int i, j, pos, cb_pos;
+   
+       /* decode first LSF */
+       
+       pos = 0;
+       cb_pos = 0;
+       for (i = 0; i < LSF_NSPLIT; i++) {
+           for (j = 0; j < dim_lsfCbTbl[i]; j++) {
+               lsfdeq[pos + j] = lsfCbTbl[cb_pos + 
+                   (long)(index[i])*dim_lsfCbTbl[i] + j];
+           }       
+           pos += dim_lsfCbTbl[i];
+           cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i];
+       }
+   
+       if (lpc_n>1) {
+   
+           /* decode last LSF */
+   
+           pos = 0;
+           cb_pos = 0;
+           for (i = 0; i < LSF_NSPLIT; i++) {
+               for (j = 0; j < dim_lsfCbTbl[i]; j++) {
+                   lsfdeq[LPC_FILTERORDER + pos + j] = 
+                       lsfCbTbl[cb_pos + 
+                       (long)(index[LSF_NSPLIT + i])*
+                       dim_lsfCbTbl[i] + j];
+               }       
+               pos += dim_lsfCbTbl[i];
+               cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i];
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+   
+   
+    *  obtain synthesis and weighting filters form lsf coefficients 
+    *---------------------------------------------------------------*/
+   
+   void DecoderInterpolateLSF( 
+       float *syntdenum, /* (o) synthesis filter coefficients */
+       float *weightdenum, /* (o) weighting denumerator 
+                                  coefficients */
+       float *lsfdeq,       /* (i) dequantized lsf coefficients */
+       int length,         /* (i) length of lsf coefficient vector */
+       iLBC_Dec_Inst_t *iLBCdec_inst 
+                           /* (i) the decoder state structure */
+   ){
+       int    i, pos, lp_length;
+       float  lp[LPC_FILTERORDER + 1], *lsfdeq2;
+           
+       lsfdeq2 = lsfdeq + length;
+       lp_length = length + 1;
+       
+       if (iLBCdec_inst->mode==30) {
+           /* sub-frame 1: Interpolation between old and first */
+   
+           LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, lsfdeq, 
+               lsf_weightTbl_30ms[0], length);
+           memcpy(syntdenum,lp,lp_length*sizeof(float));
+           bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, 
+               lp_length);
+   
+           /* sub-frames 2 to 6: interpolation between first 
+              and last LSF */
+       
+           pos = lp_length;
+           for (i = 1; i < 6; i++) {
+               LSFinterpolate2a_dec(lp, lsfdeq, lsfdeq2, 
+                   lsf_weightTbl_30ms[i], length);
+               memcpy(syntdenum + pos,lp,lp_length*sizeof(float));
+               bwexpand(weightdenum + pos, lp, 
+                   LPC_CHIRP_WEIGHTDENUM, lp_length);
+               pos += lp_length;
+           }
+       }
+       else {
+           pos = 0;
+           for (i = 0; i < iLBCdec_inst->nsub; i++) {
+               LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, 
+                   lsfdeq, lsf_weightTbl_20ms[i], length);
+               memcpy(syntdenum+pos,lp,lp_length*sizeof(float));
+               bwexpand(weightdenum+pos, lp, LPC_CHIRP_WEIGHTDENUM, 
+                   lp_length);
+               pos += lp_length;
+           }
+       }
+       
+       /* update memory */
+   
+   
+   
+       if (iLBCdec_inst->mode==30)
+           memcpy(iLBCdec_inst->lsfdeqold, lsfdeq2, 
+                       length*sizeof(float));
+       else
+           memcpy(iLBCdec_inst->lsfdeqold, lsfdeq, 
+                       length*sizeof(float));
+   
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/LPCdecode.h	Fri Sep 21 14:49:14 2007
@@ -1,44 +1,44 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       LPC_decode.h     
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_LPC_DECODE_H
-   #define __iLBC_LPC_DECODE_H
-   
-   void LSFinterpolate2a_dec( 
-   
-   
-       float *a,           /* (o) lpc coefficients for a sub-frame */
-       float *lsf1,    /* (i) first lsf coefficient vector */
-       float *lsf2,    /* (i) second lsf coefficient vector */
-       float coef,         /* (i) interpolation weight */
-       int length          /* (i) length of lsf vectors */
-   );
-         
-   void SimplelsfDEQ( 
-       float *lsfdeq,      /* (o) dequantized lsf coefficients */
-       int *index,         /* (i) quantization index */
-       int lpc_n           /* (i) number of LPCs */
-   );
-   
-   void DecoderInterpolateLSF( 
-       float *syntdenum,   /* (o) synthesis filter coefficients */
-       float *weightdenum, /* (o) weighting denumerator 
-                                  coefficients */
-       float *lsfdeq,      /* (i) dequantized lsf coefficients */
-       int length,         /* (i) length of lsf coefficient vector */
-       iLBC_Dec_Inst_t *iLBCdec_inst 
-                           /* (i) the decoder state structure */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       LPC_decode.h     
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_LPC_DECODE_H
+   #define __iLBC_LPC_DECODE_H
+   
+   void LSFinterpolate2a_dec( 
+   
+   
+       float *a,           /* (o) lpc coefficients for a sub-frame */
+       float *lsf1,    /* (i) first lsf coefficient vector */
+       float *lsf2,    /* (i) second lsf coefficient vector */
+       float coef,         /* (i) interpolation weight */
+       int length          /* (i) length of lsf vectors */
+   );
+         
+   void SimplelsfDEQ( 
+       float *lsfdeq,      /* (o) dequantized lsf coefficients */
+       int *index,         /* (i) quantization index */
+       int lpc_n           /* (i) number of LPCs */
+   );
+   
+   void DecoderInterpolateLSF( 
+       float *syntdenum,   /* (o) synthesis filter coefficients */
+       float *weightdenum, /* (o) weighting denumerator 
+                                  coefficients */
+       float *lsfdeq,      /* (i) dequantized lsf coefficients */
+       int length,         /* (i) length of lsf coefficient vector */
+       iLBC_Dec_Inst_t *iLBCdec_inst 
+                           /* (i) the decoder state structure */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/LPCencode.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/LPCencode.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/LPCencode.c	Fri Sep 21 14:49:14 2007
@@ -1,227 +1,227 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       LPCencode.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <string.h>
-   
-   
-   
-   #include "iLBC_define.h"
-   #include "helpfun.h"
-   #include "lsf.h"
-   #include "constants.h"
-   
-   /*----------------------------------------------------------------*
-    *  lpc analysis (subrutine to LPCencode)
-    *---------------------------------------------------------------*/
-   
-   void SimpleAnalysis(
-       float *lsf,         /* (o) lsf coefficients */
-       float *data,    /* (i) new data vector */
-       iLBC_Enc_Inst_t *iLBCenc_inst 
-                           /* (i/o) the encoder state structure */
-   ){
-       int k, is;
-       float temp[BLOCKL_MAX], lp[LPC_FILTERORDER + 1];
-       float lp2[LPC_FILTERORDER + 1];
-       float r[LPC_FILTERORDER + 1];
-   
-       is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl;
-       memcpy(iLBCenc_inst->lpc_buffer+is,data,
-           iLBCenc_inst->blockl*sizeof(float));
-       
-       /* No lookahead, last window is asymmetric */
-       
-       for (k = 0; k < iLBCenc_inst->lpc_n; k++) {
-           
-           is = LPC_LOOKBACK;
-   
-           if (k < (iLBCenc_inst->lpc_n - 1)) {
-               window(temp, lpc_winTbl, 
-                   iLBCenc_inst->lpc_buffer, BLOCKL_MAX);
-           } else {
-               window(temp, lpc_asymwinTbl, 
-                   iLBCenc_inst->lpc_buffer + is, BLOCKL_MAX);
-           }
-           
-           autocorr(r, temp, BLOCKL_MAX, LPC_FILTERORDER);
-           window(r, r, lpc_lagwinTbl, LPC_FILTERORDER + 1);
-           
-           levdurb(lp, temp, r, LPC_FILTERORDER);
-           bwexpand(lp2, lp, LPC_CHIRP_SYNTDENUM, LPC_FILTERORDER+1);
-   
-           a2lsf(lsf + k*LPC_FILTERORDER, lp2);
-       }
-       is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl;
-       memmove(iLBCenc_inst->lpc_buffer, 
-           iLBCenc_inst->lpc_buffer+LPC_LOOKBACK+BLOCKL_MAX-is, 
-           is*sizeof(float));
-   }
-   
-   /*----------------------------------------------------------------*
-   
-   
-    *  lsf interpolator and conversion from lsf to a coefficients
-    *  (subrutine to SimpleInterpolateLSF)
-    *---------------------------------------------------------------*/
-   
-   void LSFinterpolate2a_enc(
-       float *a,       /* (o) lpc coefficients */ 
-       float *lsf1,/* (i) first set of lsf coefficients */
-       float *lsf2,/* (i) second set of lsf coefficients */
-       float coef,     /* (i) weighting coefficient to use between 
-                              lsf1 and lsf2 */
-       long length      /* (i) length of coefficient vectors */
-   ){  
-       float  lsftmp[LPC_FILTERORDER];
-       
-       interpolate(lsftmp, lsf1, lsf2, coef, length);
-       lsf2a(a, lsftmp);
-   }
-   
-   /*----------------------------------------------------------------*
-    *  lsf interpolator (subrutine to LPCencode)
-    *---------------------------------------------------------------*/
-   
-   void SimpleInterpolateLSF(
-       float *syntdenum,   /* (o) the synthesis filter denominator 
-                                  resulting from the quantized 
-                                  interpolated lsf */
-       float *weightdenum, /* (o) the weighting filter denominator 
-                                  resulting from the unquantized 
-                                  interpolated lsf */
-       float *lsf,         /* (i) the unquantized lsf coefficients */
-       float *lsfdeq,      /* (i) the dequantized lsf coefficients */
-       float *lsfold,      /* (i) the unquantized lsf coefficients of 
-                                  the previous signal frame */
-       float *lsfdeqold, /* (i) the dequantized lsf coefficients of 
-                                  the previous signal frame */
-       int length,         /* (i) should equate LPC_FILTERORDER */
-       iLBC_Enc_Inst_t *iLBCenc_inst 
-                           /* (i/o) the encoder state structure */
-   ){
-       int    i, pos, lp_length;
-       float  lp[LPC_FILTERORDER + 1], *lsf2, *lsfdeq2;
-       
-       lsf2 = lsf + length;
-       lsfdeq2 = lsfdeq + length;
-       lp_length = length + 1; 
-    
-       if (iLBCenc_inst->mode==30) {
-           /* sub-frame 1: Interpolation between old and first 
-              set of lsf coefficients */
-   
-           LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, 
-               lsf_weightTbl_30ms[0], length);
-           memcpy(syntdenum,lp,lp_length*sizeof(float));
-           LSFinterpolate2a_enc(lp, lsfold, lsf, 
-   
-   
-               lsf_weightTbl_30ms[0], length);
-           bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, lp_length);
-   
-           /* sub-frame 2 to 6: Interpolation between first 
-              and second set of lsf coefficients */
-       
-           pos = lp_length;
-           for (i = 1; i < iLBCenc_inst->nsub; i++) {
-               LSFinterpolate2a_enc(lp, lsfdeq, lsfdeq2, 
-                   lsf_weightTbl_30ms[i], length);
-               memcpy(syntdenum + pos,lp,lp_length*sizeof(float));
-           
-               LSFinterpolate2a_enc(lp, lsf, lsf2, 
-                   lsf_weightTbl_30ms[i], length);
-               bwexpand(weightdenum + pos, lp, 
-                   LPC_CHIRP_WEIGHTDENUM, lp_length);
-               pos += lp_length;
-           }
-       }
-       else {
-           pos = 0;
-           for (i = 0; i < iLBCenc_inst->nsub; i++) {
-               LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, 
-                   lsf_weightTbl_20ms[i], length);
-               memcpy(syntdenum+pos,lp,lp_length*sizeof(float));
-               LSFinterpolate2a_enc(lp, lsfold, lsf, 
-                   lsf_weightTbl_20ms[i], length);
-               bwexpand(weightdenum+pos, lp, 
-                   LPC_CHIRP_WEIGHTDENUM, lp_length);
-               pos += lp_length;
-           }
-       }
-       
-       /* update memory */
-   
-       if (iLBCenc_inst->mode==30) {
-           memcpy(lsfold, lsf2, length*sizeof(float));
-           memcpy(lsfdeqold, lsfdeq2, length*sizeof(float));
-       }
-       else {
-           memcpy(lsfold, lsf, length*sizeof(float));
-           memcpy(lsfdeqold, lsfdeq, length*sizeof(float));
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  lsf quantizer (subrutine to LPCencode)
-    *---------------------------------------------------------------*/
-   
-   void SimplelsfQ(
-       float *lsfdeq,    /* (o) dequantized lsf coefficients
-                              (dimension FILTERORDER) */
-       int *index,     /* (o) quantization index */
-       float *lsf,      /* (i) the lsf coefficient vector to be 
-   
-   
-                              quantized (dimension FILTERORDER ) */
-       int lpc_n     /* (i) number of lsf sets to quantize */
-   ){    
-       /* Quantize first LSF with memoryless split VQ */
-       SplitVQ(lsfdeq, index, lsf, lsfCbTbl, LSF_NSPLIT, 
-           dim_lsfCbTbl, size_lsfCbTbl);
-   
-       if (lpc_n==2) {
-           /* Quantize second LSF with memoryless split VQ */
-           SplitVQ(lsfdeq + LPC_FILTERORDER, index + LSF_NSPLIT, 
-               lsf + LPC_FILTERORDER, lsfCbTbl, LSF_NSPLIT, 
-               dim_lsfCbTbl, size_lsfCbTbl);
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  lpc encoder
-    *---------------------------------------------------------------*/
-   
-   void LPCencode( 
-       float *syntdenum, /* (i/o) synthesis filter coefficients 
-                                  before/after encoding */
-       float *weightdenum, /* (i/o) weighting denumerator 
-                                  coefficients before/after 
-                                  encoding */
-       int *lsf_index,     /* (o) lsf quantization index */
-       float *data,    /* (i) lsf coefficients to quantize */
-       iLBC_Enc_Inst_t *iLBCenc_inst 
-                           /* (i/o) the encoder state structure */
-   ){
-       float lsf[LPC_FILTERORDER * LPC_N_MAX];
-       float lsfdeq[LPC_FILTERORDER * LPC_N_MAX];
-       int change=0;
-       
-       SimpleAnalysis(lsf, data, iLBCenc_inst);
-       SimplelsfQ(lsfdeq, lsf_index, lsf, iLBCenc_inst->lpc_n);
-       change=LSF_check(lsfdeq, LPC_FILTERORDER, iLBCenc_inst->lpc_n);
-       SimpleInterpolateLSF(syntdenum, weightdenum, 
-           lsf, lsfdeq, iLBCenc_inst->lsfold, 
-           iLBCenc_inst->lsfdeqold, LPC_FILTERORDER, iLBCenc_inst);
-   }
-   
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       LPCencode.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <string.h>
+   
+   
+   
+   #include "iLBC_define.h"
+   #include "helpfun.h"
+   #include "lsf.h"
+   #include "constants.h"
+   
+   /*----------------------------------------------------------------*
+    *  lpc analysis (subrutine to LPCencode)
+    *---------------------------------------------------------------*/
+   
+   void SimpleAnalysis(
+       float *lsf,         /* (o) lsf coefficients */
+       float *data,    /* (i) new data vector */
+       iLBC_Enc_Inst_t *iLBCenc_inst 
+                           /* (i/o) the encoder state structure */
+   ){
+       int k, is;
+       float temp[BLOCKL_MAX], lp[LPC_FILTERORDER + 1];
+       float lp2[LPC_FILTERORDER + 1];
+       float r[LPC_FILTERORDER + 1];
+   
+       is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl;
+       memcpy(iLBCenc_inst->lpc_buffer+is,data,
+           iLBCenc_inst->blockl*sizeof(float));
+       
+       /* No lookahead, last window is asymmetric */
+       
+       for (k = 0; k < iLBCenc_inst->lpc_n; k++) {
+           
+           is = LPC_LOOKBACK;
+   
+           if (k < (iLBCenc_inst->lpc_n - 1)) {
+               window(temp, lpc_winTbl, 
+                   iLBCenc_inst->lpc_buffer, BLOCKL_MAX);
+           } else {
+               window(temp, lpc_asymwinTbl, 
+                   iLBCenc_inst->lpc_buffer + is, BLOCKL_MAX);
+           }
+           
+           autocorr(r, temp, BLOCKL_MAX, LPC_FILTERORDER);
+           window(r, r, lpc_lagwinTbl, LPC_FILTERORDER + 1);
+           
+           levdurb(lp, temp, r, LPC_FILTERORDER);
+           bwexpand(lp2, lp, LPC_CHIRP_SYNTDENUM, LPC_FILTERORDER+1);
+   
+           a2lsf(lsf + k*LPC_FILTERORDER, lp2);
+       }
+       is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl;
+       memmove(iLBCenc_inst->lpc_buffer, 
+           iLBCenc_inst->lpc_buffer+LPC_LOOKBACK+BLOCKL_MAX-is, 
+           is*sizeof(float));
+   }
+   
+   /*----------------------------------------------------------------*
+   
+   
+    *  lsf interpolator and conversion from lsf to a coefficients
+    *  (subrutine to SimpleInterpolateLSF)
+    *---------------------------------------------------------------*/
+   
+   void LSFinterpolate2a_enc(
+       float *a,       /* (o) lpc coefficients */ 
+       float *lsf1,/* (i) first set of lsf coefficients */
+       float *lsf2,/* (i) second set of lsf coefficients */
+       float coef,     /* (i) weighting coefficient to use between 
+                              lsf1 and lsf2 */
+       long length      /* (i) length of coefficient vectors */
+   ){  
+       float  lsftmp[LPC_FILTERORDER];
+       
+       interpolate(lsftmp, lsf1, lsf2, coef, length);
+       lsf2a(a, lsftmp);
+   }
+   
+   /*----------------------------------------------------------------*
+    *  lsf interpolator (subrutine to LPCencode)
+    *---------------------------------------------------------------*/
+   
+   void SimpleInterpolateLSF(
+       float *syntdenum,   /* (o) the synthesis filter denominator 
+                                  resulting from the quantized 
+                                  interpolated lsf */
+       float *weightdenum, /* (o) the weighting filter denominator 
+                                  resulting from the unquantized 
+                                  interpolated lsf */
+       float *lsf,         /* (i) the unquantized lsf coefficients */
+       float *lsfdeq,      /* (i) the dequantized lsf coefficients */
+       float *lsfold,      /* (i) the unquantized lsf coefficients of 
+                                  the previous signal frame */
+       float *lsfdeqold, /* (i) the dequantized lsf coefficients of 
+                                  the previous signal frame */
+       int length,         /* (i) should equate LPC_FILTERORDER */
+       iLBC_Enc_Inst_t *iLBCenc_inst 
+                           /* (i/o) the encoder state structure */
+   ){
+       int    i, pos, lp_length;
+       float  lp[LPC_FILTERORDER + 1], *lsf2, *lsfdeq2;
+       
+       lsf2 = lsf + length;
+       lsfdeq2 = lsfdeq + length;
+       lp_length = length + 1; 
+    
+       if (iLBCenc_inst->mode==30) {
+           /* sub-frame 1: Interpolation between old and first 
+              set of lsf coefficients */
+   
+           LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, 
+               lsf_weightTbl_30ms[0], length);
+           memcpy(syntdenum,lp,lp_length*sizeof(float));
+           LSFinterpolate2a_enc(lp, lsfold, lsf, 
+   
+   
+               lsf_weightTbl_30ms[0], length);
+           bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, lp_length);
+   
+           /* sub-frame 2 to 6: Interpolation between first 
+              and second set of lsf coefficients */
+       
+           pos = lp_length;
+           for (i = 1; i < iLBCenc_inst->nsub; i++) {
+               LSFinterpolate2a_enc(lp, lsfdeq, lsfdeq2, 
+                   lsf_weightTbl_30ms[i], length);
+               memcpy(syntdenum + pos,lp,lp_length*sizeof(float));
+           
+               LSFinterpolate2a_enc(lp, lsf, lsf2, 
+                   lsf_weightTbl_30ms[i], length);
+               bwexpand(weightdenum + pos, lp, 
+                   LPC_CHIRP_WEIGHTDENUM, lp_length);
+               pos += lp_length;
+           }
+       }
+       else {
+           pos = 0;
+           for (i = 0; i < iLBCenc_inst->nsub; i++) {
+               LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, 
+                   lsf_weightTbl_20ms[i], length);
+               memcpy(syntdenum+pos,lp,lp_length*sizeof(float));
+               LSFinterpolate2a_enc(lp, lsfold, lsf, 
+                   lsf_weightTbl_20ms[i], length);
+               bwexpand(weightdenum+pos, lp, 
+                   LPC_CHIRP_WEIGHTDENUM, lp_length);
+               pos += lp_length;
+           }
+       }
+       
+       /* update memory */
+   
+       if (iLBCenc_inst->mode==30) {
+           memcpy(lsfold, lsf2, length*sizeof(float));
+           memcpy(lsfdeqold, lsfdeq2, length*sizeof(float));
+       }
+       else {
+           memcpy(lsfold, lsf, length*sizeof(float));
+           memcpy(lsfdeqold, lsfdeq, length*sizeof(float));
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  lsf quantizer (subrutine to LPCencode)
+    *---------------------------------------------------------------*/
+   
+   void SimplelsfQ(
+       float *lsfdeq,    /* (o) dequantized lsf coefficients
+                              (dimension FILTERORDER) */
+       int *index,     /* (o) quantization index */
+       float *lsf,      /* (i) the lsf coefficient vector to be 
+   
+   
+                              quantized (dimension FILTERORDER ) */
+       int lpc_n     /* (i) number of lsf sets to quantize */
+   ){    
+       /* Quantize first LSF with memoryless split VQ */
+       SplitVQ(lsfdeq, index, lsf, lsfCbTbl, LSF_NSPLIT, 
+           dim_lsfCbTbl, size_lsfCbTbl);
+   
+       if (lpc_n==2) {
+           /* Quantize second LSF with memoryless split VQ */
+           SplitVQ(lsfdeq + LPC_FILTERORDER, index + LSF_NSPLIT, 
+               lsf + LPC_FILTERORDER, lsfCbTbl, LSF_NSPLIT, 
+               dim_lsfCbTbl, size_lsfCbTbl);
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  lpc encoder
+    *---------------------------------------------------------------*/
+   
+   void LPCencode( 
+       float *syntdenum, /* (i/o) synthesis filter coefficients 
+                                  before/after encoding */
+       float *weightdenum, /* (i/o) weighting denumerator 
+                                  coefficients before/after 
+                                  encoding */
+       int *lsf_index,     /* (o) lsf quantization index */
+       float *data,    /* (i) lsf coefficients to quantize */
+       iLBC_Enc_Inst_t *iLBCenc_inst 
+                           /* (i/o) the encoder state structure */
+   ){
+       float lsf[LPC_FILTERORDER * LPC_N_MAX];
+       float lsfdeq[LPC_FILTERORDER * LPC_N_MAX];
+       int change=0;
+       
+       SimpleAnalysis(lsf, data, iLBCenc_inst);
+       SimplelsfQ(lsfdeq, lsf_index, lsf, iLBCenc_inst->lpc_n);
+       change=LSF_check(lsfdeq, LPC_FILTERORDER, iLBCenc_inst->lpc_n);
+       SimpleInterpolateLSF(syntdenum, weightdenum, 
+           lsf, lsfdeq, iLBCenc_inst->lsfold, 
+           iLBCenc_inst->lsfdeqold, LPC_FILTERORDER, iLBCenc_inst);
+   }
+   
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/LPCencode.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/LPCencode.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/LPCencode.h	Fri Sep 21 14:49:14 2007
@@ -1,29 +1,29 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       LPCencode.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_LPCENCOD_H
-   #define __iLBC_LPCENCOD_H
-   
-   void LPCencode( 
-       float *syntdenum,   /* (i/o) synthesis filter coefficients 
-                                  before/after encoding */
-       float *weightdenum, /* (i/o) weighting denumerator coefficients
-                                  before/after encoding */
-       int *lsf_index,     /* (o) lsf quantization index */
-       float *data,    /* (i) lsf coefficients to quantize */
-       iLBC_Enc_Inst_t *iLBCenc_inst 
-                           /* (i/o) the encoder state structure */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       LPCencode.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_LPCENCOD_H
+   #define __iLBC_LPCENCOD_H
+   
+   void LPCencode( 
+       float *syntdenum,   /* (i/o) synthesis filter coefficients 
+                                  before/after encoding */
+       float *weightdenum, /* (i/o) weighting denumerator coefficients
+                                  before/after encoding */
+       int *lsf_index,     /* (o) lsf quantization index */
+       float *data,    /* (i) lsf coefficients to quantize */
+       iLBC_Enc_Inst_t *iLBCenc_inst 
+                           /* (i/o) the encoder state structure */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.c	Fri Sep 21 14:49:14 2007
@@ -1,75 +1,75 @@
-   
-   /******************************************************************
-   
-   
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       StateConstructW.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h> 
-   #include <string.h>
-   
-   #include "iLBC_define.h"
-   #include "constants.h"
-   #include "filter.h"
-   
-   /*----------------------------------------------------------------*
-    *  decoding of the start state
-    *---------------------------------------------------------------*/
-   
-   void StateConstructW( 
-       int idxForMax,      /* (i) 6-bit index for the quantization of 
-                                  max amplitude */
-       int *idxVec,    /* (i) vector of quantization indexes */
-       float *syntDenum,   /* (i) synthesis filter denumerator */
-       float *out,         /* (o) the decoded state vector */
-       int len             /* (i) length of a state vector */
-   ){
-       float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp, 
-           numerator[LPC_FILTERORDER+1];
-       float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout;
-       int k,tmpi;
-       
-       /* decoding of the maximum value */
-   
-       maxVal = state_frgqTbl[idxForMax];
-       maxVal = (float)pow(10,maxVal)/(float)4.5;
-           
-       /* initialization of buffers and coefficients */
-       
-       memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float));
-       memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float));
-       for (k=0; k<LPC_FILTERORDER; k++) {
-           numerator[k]=syntDenum[LPC_FILTERORDER-k];
-       }
-       numerator[LPC_FILTERORDER]=syntDenum[0];
-       tmp = &tmpbuf[LPC_FILTERORDER];
-       fout = &foutbuf[LPC_FILTERORDER];
-   
-       /* decoding of the sample values */
-       
-       for (k=0; k<len; k++) {
-           tmpi = len-1-k;
-           /* maxVal = 1/scal */
-   
-   
-           tmp[k] = maxVal*state_sq3Tbl[idxVec[tmpi]];
-       }
-   
-       /* circular convolution with all-pass filter */
-   
-       memset(tmp+len, 0, len*sizeof(float));
-       ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, 
-           LPC_FILTERORDER, fout);
-       for (k=0;k<len;k++) {
-           out[k] = fout[len-1-k]+fout[2*len-1-k];
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+   
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       StateConstructW.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h> 
+   #include <string.h>
+   
+   #include "iLBC_define.h"
+   #include "constants.h"
+   #include "filter.h"
+   
+   /*----------------------------------------------------------------*
+    *  decoding of the start state
+    *---------------------------------------------------------------*/
+   
+   void StateConstructW( 
+       int idxForMax,      /* (i) 6-bit index for the quantization of 
+                                  max amplitude */
+       int *idxVec,    /* (i) vector of quantization indexes */
+       float *syntDenum,   /* (i) synthesis filter denumerator */
+       float *out,         /* (o) the decoded state vector */
+       int len             /* (i) length of a state vector */
+   ){
+       float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp, 
+           numerator[LPC_FILTERORDER+1];
+       float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout;
+       int k,tmpi;
+       
+       /* decoding of the maximum value */
+   
+       maxVal = state_frgqTbl[idxForMax];
+       maxVal = (float)pow(10,maxVal)/(float)4.5;
+           
+       /* initialization of buffers and coefficients */
+       
+       memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float));
+       memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float));
+       for (k=0; k<LPC_FILTERORDER; k++) {
+           numerator[k]=syntDenum[LPC_FILTERORDER-k];
+       }
+       numerator[LPC_FILTERORDER]=syntDenum[0];
+       tmp = &tmpbuf[LPC_FILTERORDER];
+       fout = &foutbuf[LPC_FILTERORDER];
+   
+       /* decoding of the sample values */
+       
+       for (k=0; k<len; k++) {
+           tmpi = len-1-k;
+           /* maxVal = 1/scal */
+   
+   
+           tmp[k] = maxVal*state_sq3Tbl[idxVec[tmpi]];
+       }
+   
+       /* circular convolution with all-pass filter */
+   
+       memset(tmp+len, 0, len*sizeof(float));
+       ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, 
+           LPC_FILTERORDER, fout);
+       for (k=0;k<len;k++) {
+           out[k] = fout[len-1-k]+fout[2*len-1-k];
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/StateConstructW.h	Fri Sep 21 14:49:14 2007
@@ -1,27 +1,27 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       StateConstructW.h  
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_STATECONSTRUCTW_H
-   #define __iLBC_STATECONSTRUCTW_H
-   
-   void StateConstructW( 
-       int idxForMax,      /* (i) 6-bit index for the quantization of 
-                                  max amplitude */
-       int *idxVec,    /* (i) vector of quantization indexes */
-       float *syntDenum,   /* (i) synthesis filter denumerator */
-       float *out,         /* (o) the decoded state vector */
-       int len             /* (i) length of a state vector */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       StateConstructW.h  
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_STATECONSTRUCTW_H
+   #define __iLBC_STATECONSTRUCTW_H
+   
+   void StateConstructW( 
+       int idxForMax,      /* (i) 6-bit index for the quantization of 
+                                  max amplitude */
+       int *idxVec,    /* (i) vector of quantization indexes */
+       float *syntDenum,   /* (i) synthesis filter denumerator */
+       float *out,         /* (o) the decoded state vector */
+       int len             /* (i) length of a state vector */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.c	Fri Sep 21 14:49:14 2007
@@ -1,193 +1,193 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       StateSearchW.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h> 
-   #include <string.h>
-   
-   #include "iLBC_define.h"
-   #include "constants.h"
-   #include "filter.h"
-   #include "helpfun.h"
-   
-   /*----------------------------------------------------------------*
-    *  predictive noise shaping encoding of scaled start state 
-    *  (subrutine for StateSearchW) 
-    *---------------------------------------------------------------*/
-   
-   void AbsQuantW(
-       iLBC_Enc_Inst_t *iLBCenc_inst,  
-                           /* (i) Encoder instance */
-       float *in,          /* (i) vector to encode */
-       float *syntDenum,   /* (i) denominator of synthesis filter */
-       float *weightDenum, /* (i) denominator of weighting filter */
-       int *out,           /* (o) vector of quantizer indexes */
-       int len,        /* (i) length of vector to encode and 
-                                  vector of quantizer indexes */
-       int state_first     /* (i) position of start state in the 
-                                  80 vec */
-   ){
-       float *syntOut;
-       float syntOutBuf[LPC_FILTERORDER+STATE_SHORT_LEN_30MS];
-       float toQ, xq;
-       int n;
-       int index;
-   
-       /* initialization of buffer for filtering */
-               
-       memset(syntOutBuf, 0, LPC_FILTERORDER*sizeof(float));
-   
-   
-   
-       /* initialization of pointer for filtering */
-   
-       syntOut = &syntOutBuf[LPC_FILTERORDER];
-       
-       /* synthesis and weighting filters on input */
-       
-       if (state_first) {
-           AllPoleFilter (in, weightDenum, SUBL, LPC_FILTERORDER);
-       } else {
-           AllPoleFilter (in, weightDenum, 
-               iLBCenc_inst->state_short_len-SUBL, 
-               LPC_FILTERORDER);
-       }
-   
-       /* encoding loop */
-   
-       for (n=0; n<len; n++) {
-           
-           /* time update of filter coefficients */  
-           
-           if ((state_first)&&(n==SUBL)){
-               syntDenum += (LPC_FILTERORDER+1);
-               weightDenum += (LPC_FILTERORDER+1);
-   
-               /* synthesis and weighting filters on input */
-               AllPoleFilter (&in[n], weightDenum, len-n, 
-                   LPC_FILTERORDER);
-   
-           } else if ((state_first==0)&&
-               (n==(iLBCenc_inst->state_short_len-SUBL))) {
-               syntDenum += (LPC_FILTERORDER+1);
-               weightDenum += (LPC_FILTERORDER+1);
-   
-               /* synthesis and weighting filters on input */
-               AllPoleFilter (&in[n], weightDenum, len-n, 
-                   LPC_FILTERORDER);
-               
-           }
-           
-           /* prediction of synthesized and weighted input */
-   
-           syntOut[n] = 0.0;
-           AllPoleFilter (&syntOut[n], weightDenum, 1, 
-               LPC_FILTERORDER);
-           
-           /* quantization */      
-   
-           toQ = in[n]-syntOut[n];
-           sort_sq(&xq, &index, toQ, state_sq3Tbl, 8);
-           out[n]=index;
-           syntOut[n] = state_sq3Tbl[out[n]];
-   
-           /* update of the prediction filter */
-   
-   
-   
-           AllPoleFilter(&syntOut[n], weightDenum, 1, 
-               LPC_FILTERORDER);
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  encoding of start state                          
-    *---------------------------------------------------------------*/
-   
-   void StateSearchW( 
-       iLBC_Enc_Inst_t *iLBCenc_inst,  
-                           /* (i) Encoder instance */
-       float *residual,/* (i) target residual vector */
-       float *syntDenum,   /* (i) lpc synthesis filter */
-       float *weightDenum, /* (i) weighting filter denuminator */
-       int *idxForMax,     /* (o) quantizer index for maximum 
-                                  amplitude */
-       int *idxVec,    /* (o) vector of quantization indexes */
-       int len,        /* (i) length of all vectors */
-       int state_first     /* (i) position of start state in the 
-                                  80 vec */
-   ){  
-       float dtmp, maxVal;
-       float tmpbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS];
-       float *tmp, numerator[1+LPC_FILTERORDER]; 
-       float foutbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS], *fout;
-       int k;
-       float qmax, scal;
-       
-       /* initialization of buffers and filter coefficients */
-   
-       memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float));
-       memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float));
-       for (k=0; k<LPC_FILTERORDER; k++) {
-           numerator[k]=syntDenum[LPC_FILTERORDER-k];
-       }
-       numerator[LPC_FILTERORDER]=syntDenum[0];
-       tmp = &tmpbuf[LPC_FILTERORDER];
-       fout = &foutbuf[LPC_FILTERORDER];
-   
-       /* circular convolution with the all-pass filter */
-       
-       memcpy(tmp, residual, len*sizeof(float));
-       memset(tmp+len, 0, len*sizeof(float));
-       ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, 
-           LPC_FILTERORDER, fout);
-       for (k=0; k<len; k++) {
-           fout[k] += fout[k+len];
-       }   
-           
-       /* identification of the maximum amplitude value */
-       
-       maxVal = fout[0];
-   
-   
-       for (k=1; k<len; k++) {
-           
-           if (fout[k]*fout[k] > maxVal*maxVal){
-               maxVal = fout[k];
-           }
-       }
-       maxVal=(float)fabs(maxVal);
-           
-       /* encoding of the maximum amplitude value */
-       
-       if (maxVal < 10.0) {
-           maxVal = 10.0;
-       }
-       maxVal = (float)log10(maxVal);
-       sort_sq(&dtmp, idxForMax, maxVal, state_frgqTbl, 64);
-   
-       /* decoding of the maximum amplitude representation value,
-          and corresponding scaling of start state */
-   
-       maxVal=state_frgqTbl[*idxForMax];
-       qmax = (float)pow(10,maxVal);
-       scal = (float)(4.5)/qmax;
-       for (k=0; k<len; k++){
-           fout[k] *= scal;
-       }
-   
-       /* predictive noise shaping encoding of scaled start state */
-   
-       AbsQuantW(iLBCenc_inst, fout,syntDenum, 
-           weightDenum,idxVec, len, state_first);
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       StateSearchW.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h> 
+   #include <string.h>
+   
+   #include "iLBC_define.h"
+   #include "constants.h"
+   #include "filter.h"
+   #include "helpfun.h"
+   
+   /*----------------------------------------------------------------*
+    *  predictive noise shaping encoding of scaled start state 
+    *  (subrutine for StateSearchW) 
+    *---------------------------------------------------------------*/
+   
+   void AbsQuantW(
+       iLBC_Enc_Inst_t *iLBCenc_inst,  
+                           /* (i) Encoder instance */
+       float *in,          /* (i) vector to encode */
+       float *syntDenum,   /* (i) denominator of synthesis filter */
+       float *weightDenum, /* (i) denominator of weighting filter */
+       int *out,           /* (o) vector of quantizer indexes */
+       int len,        /* (i) length of vector to encode and 
+                                  vector of quantizer indexes */
+       int state_first     /* (i) position of start state in the 
+                                  80 vec */
+   ){
+       float *syntOut;
+       float syntOutBuf[LPC_FILTERORDER+STATE_SHORT_LEN_30MS];
+       float toQ, xq;
+       int n;
+       int index;
+   
+       /* initialization of buffer for filtering */
+               
+       memset(syntOutBuf, 0, LPC_FILTERORDER*sizeof(float));
+   
+   
+   
+       /* initialization of pointer for filtering */
+   
+       syntOut = &syntOutBuf[LPC_FILTERORDER];
+       
+       /* synthesis and weighting filters on input */
+       
+       if (state_first) {
+           AllPoleFilter (in, weightDenum, SUBL, LPC_FILTERORDER);
+       } else {
+           AllPoleFilter (in, weightDenum, 
+               iLBCenc_inst->state_short_len-SUBL, 
+               LPC_FILTERORDER);
+       }
+   
+       /* encoding loop */
+   
+       for (n=0; n<len; n++) {
+           
+           /* time update of filter coefficients */  
+           
+           if ((state_first)&&(n==SUBL)){
+               syntDenum += (LPC_FILTERORDER+1);
+               weightDenum += (LPC_FILTERORDER+1);
+   
+               /* synthesis and weighting filters on input */
+               AllPoleFilter (&in[n], weightDenum, len-n, 
+                   LPC_FILTERORDER);
+   
+           } else if ((state_first==0)&&
+               (n==(iLBCenc_inst->state_short_len-SUBL))) {
+               syntDenum += (LPC_FILTERORDER+1);
+               weightDenum += (LPC_FILTERORDER+1);
+   
+               /* synthesis and weighting filters on input */
+               AllPoleFilter (&in[n], weightDenum, len-n, 
+                   LPC_FILTERORDER);
+               
+           }
+           
+           /* prediction of synthesized and weighted input */
+   
+           syntOut[n] = 0.0;
+           AllPoleFilter (&syntOut[n], weightDenum, 1, 
+               LPC_FILTERORDER);
+           
+           /* quantization */      
+   
+           toQ = in[n]-syntOut[n];
+           sort_sq(&xq, &index, toQ, state_sq3Tbl, 8);
+           out[n]=index;
+           syntOut[n] = state_sq3Tbl[out[n]];
+   
+           /* update of the prediction filter */
+   
+   
+   
+           AllPoleFilter(&syntOut[n], weightDenum, 1, 
+               LPC_FILTERORDER);
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  encoding of start state                          
+    *---------------------------------------------------------------*/
+   
+   void StateSearchW( 
+       iLBC_Enc_Inst_t *iLBCenc_inst,  
+                           /* (i) Encoder instance */
+       float *residual,/* (i) target residual vector */
+       float *syntDenum,   /* (i) lpc synthesis filter */
+       float *weightDenum, /* (i) weighting filter denuminator */
+       int *idxForMax,     /* (o) quantizer index for maximum 
+                                  amplitude */
+       int *idxVec,    /* (o) vector of quantization indexes */
+       int len,        /* (i) length of all vectors */
+       int state_first     /* (i) position of start state in the 
+                                  80 vec */
+   ){  
+       float dtmp, maxVal;
+       float tmpbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS];
+       float *tmp, numerator[1+LPC_FILTERORDER]; 
+       float foutbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS], *fout;
+       int k;
+       float qmax, scal;
+       
+       /* initialization of buffers and filter coefficients */
+   
+       memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float));
+       memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float));
+       for (k=0; k<LPC_FILTERORDER; k++) {
+           numerator[k]=syntDenum[LPC_FILTERORDER-k];
+       }
+       numerator[LPC_FILTERORDER]=syntDenum[0];
+       tmp = &tmpbuf[LPC_FILTERORDER];
+       fout = &foutbuf[LPC_FILTERORDER];
+   
+       /* circular convolution with the all-pass filter */
+       
+       memcpy(tmp, residual, len*sizeof(float));
+       memset(tmp+len, 0, len*sizeof(float));
+       ZeroPoleFilter(tmp, numerator, syntDenum, 2*len, 
+           LPC_FILTERORDER, fout);
+       for (k=0; k<len; k++) {
+           fout[k] += fout[k+len];
+       }   
+           
+       /* identification of the maximum amplitude value */
+       
+       maxVal = fout[0];
+   
+   
+       for (k=1; k<len; k++) {
+           
+           if (fout[k]*fout[k] > maxVal*maxVal){
+               maxVal = fout[k];
+           }
+       }
+       maxVal=(float)fabs(maxVal);
+           
+       /* encoding of the maximum amplitude value */
+       
+       if (maxVal < 10.0) {
+           maxVal = 10.0;
+       }
+       maxVal = (float)log10(maxVal);
+       sort_sq(&dtmp, idxForMax, maxVal, state_frgqTbl, 64);
+   
+       /* decoding of the maximum amplitude representation value,
+          and corresponding scaling of start state */
+   
+       maxVal=state_frgqTbl[*idxForMax];
+       qmax = (float)pow(10,maxVal);
+       scal = (float)(4.5)/qmax;
+       for (k=0; k<len; k++){
+           fout[k] *= scal;
+       }
+   
+       /* predictive noise shaping encoding of scaled start state */
+   
+       AbsQuantW(iLBCenc_inst, fout,syntDenum, 
+           weightDenum,idxVec, len, state_first);
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/StateSearchW.h	Fri Sep 21 14:49:14 2007
@@ -1,48 +1,48 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       StateSearchW.h     
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_STATESEARCHW_H
-   #define __iLBC_STATESEARCHW_H
-   
-   void AbsQuantW(
-       iLBC_Enc_Inst_t *iLBCenc_inst,  
-                           /* (i) Encoder instance */
-       float *in,          /* (i) vector to encode */
-       float *syntDenum,   /* (i) denominator of synthesis filter */
-       float *weightDenum, /* (i) denominator of weighting filter */
-       int *out,           /* (o) vector of quantizer indexes */
-       int len,        /* (i) length of vector to encode and 
-                                  vector of quantizer indexes */
-       int state_first     /* (i) position of start state in the 
-                                  80 vec */
-   );
-   
-   void StateSearchW( 
-       iLBC_Enc_Inst_t *iLBCenc_inst,  
-                           /* (i) Encoder instance */
-       float *residual,/* (i) target residual vector */
-       float *syntDenum,   /* (i) lpc synthesis filter */
-       float *weightDenum, /* (i) weighting filter denuminator */
-       int *idxForMax,     /* (o) quantizer index for maximum 
-                                  amplitude */
-       int *idxVec,    /* (o) vector of quantization indexes */
-       int len,        /* (i) length of all vectors */
-       int state_first     /* (i) position of start state in the 
-   
-   
-                                  80 vec */
-   );
-   
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       StateSearchW.h     
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_STATESEARCHW_H
+   #define __iLBC_STATESEARCHW_H
+   
+   void AbsQuantW(
+       iLBC_Enc_Inst_t *iLBCenc_inst,  
+                           /* (i) Encoder instance */
+       float *in,          /* (i) vector to encode */
+       float *syntDenum,   /* (i) denominator of synthesis filter */
+       float *weightDenum, /* (i) denominator of weighting filter */
+       int *out,           /* (o) vector of quantizer indexes */
+       int len,        /* (i) length of vector to encode and 
+                                  vector of quantizer indexes */
+       int state_first     /* (i) position of start state in the 
+                                  80 vec */
+   );
+   
+   void StateSearchW( 
+       iLBC_Enc_Inst_t *iLBCenc_inst,  
+                           /* (i) Encoder instance */
+       float *residual,/* (i) target residual vector */
+       float *syntDenum,   /* (i) lpc synthesis filter */
+       float *weightDenum, /* (i) weighting filter denuminator */
+       int *idxForMax,     /* (o) quantizer index for maximum 
+                                  amplitude */
+       int *idxVec,    /* (o) vector of quantization indexes */
+       int len,        /* (i) length of all vectors */
+       int state_first     /* (i) position of start state in the 
+   
+   
+                                  80 vec */
+   );
+   
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/anaFilter.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/anaFilter.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/anaFilter.c	Fri Sep 21 14:49:14 2007
@@ -1,70 +1,70 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       anaFilter.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <string.h>
-   #include "iLBC_define.h"
-   
-   /*----------------------------------------------------------------*
-    *  LP analysis filter.
-   
-   
-    *---------------------------------------------------------------*/
-       
-   void anaFilter(
-       float *In,  /* (i) Signal to be filtered */
-       float *a,   /* (i) LP parameters */
-       int len,/* (i) Length of signal */
-       float *Out, /* (o) Filtered signal */
-       float *mem  /* (i/o) Filter state */
-   ){
-       int i, j;
-       float *po, *pi, *pm, *pa;
-   
-       po = Out;
-   
-       /* Filter first part using memory from past */
-       
-       for (i=0; i<LPC_FILTERORDER; i++) {
-           pi = &In[i];
-           pm = &mem[LPC_FILTERORDER-1];
-           pa = a;
-           *po=0.0;
-           for (j=0; j<=i; j++) {
-               *po+=(*pa++)*(*pi--);
-           }
-           for (j=i+1; j<LPC_FILTERORDER+1; j++) {
-   
-               *po+=(*pa++)*(*pm--);
-           }
-           po++;
-       }
-   
-       /* Filter last part where the state is entierly 
-          in the input vector */
-   
-       for (i=LPC_FILTERORDER; i<len; i++) {
-           pi = &In[i];
-           pa = a;
-           *po=0.0;
-           for (j=0; j<LPC_FILTERORDER+1; j++) {
-               *po+=(*pa++)*(*pi--);
-           }
-           po++;
-       }
-   
-       /* Update state vector */
-   
-       memcpy(mem, &In[len-LPC_FILTERORDER], 
-           LPC_FILTERORDER*sizeof(float));
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       anaFilter.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <string.h>
+   #include "iLBC_define.h"
+   
+   /*----------------------------------------------------------------*
+    *  LP analysis filter.
+   
+   
+    *---------------------------------------------------------------*/
+       
+   void anaFilter(
+       float *In,  /* (i) Signal to be filtered */
+       float *a,   /* (i) LP parameters */
+       int len,/* (i) Length of signal */
+       float *Out, /* (o) Filtered signal */
+       float *mem  /* (i/o) Filter state */
+   ){
+       int i, j;
+       float *po, *pi, *pm, *pa;
+   
+       po = Out;
+   
+       /* Filter first part using memory from past */
+       
+       for (i=0; i<LPC_FILTERORDER; i++) {
+           pi = &In[i];
+           pm = &mem[LPC_FILTERORDER-1];
+           pa = a;
+           *po=0.0;
+           for (j=0; j<=i; j++) {
+               *po+=(*pa++)*(*pi--);
+           }
+           for (j=i+1; j<LPC_FILTERORDER+1; j++) {
+   
+               *po+=(*pa++)*(*pm--);
+           }
+           po++;
+       }
+   
+       /* Filter last part where the state is entierly 
+          in the input vector */
+   
+       for (i=LPC_FILTERORDER; i<len; i++) {
+           pi = &In[i];
+           pa = a;
+           *po=0.0;
+           for (j=0; j<LPC_FILTERORDER+1; j++) {
+               *po+=(*pa++)*(*pi--);
+           }
+           po++;
+       }
+   
+       /* Update state vector */
+   
+       memcpy(mem, &In[len-LPC_FILTERORDER], 
+           LPC_FILTERORDER*sizeof(float));
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/anaFilter.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/anaFilter.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/anaFilter.h	Fri Sep 21 14:49:14 2007
@@ -1,26 +1,26 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       anaFilter.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_ANAFILTER_H
-   #define __iLBC_ANAFILTER_H
-   
-   void anaFilter(
-       float *In,  /* (i) Signal to be filtered */
-       float *a,   /* (i) LP parameters */
-       int len,/* (i) Length of signal */
-       float *Out, /* (o) Filtered signal */
-       float *mem  /* (i/o) Filter state */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       anaFilter.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_ANAFILTER_H
+   #define __iLBC_ANAFILTER_H
+   
+   void anaFilter(
+       float *In,  /* (i) Signal to be filtered */
+       float *a,   /* (i) LP parameters */
+       int len,/* (i) Length of signal */
+       float *Out, /* (o) Filtered signal */
+       float *mem  /* (i/o) Filter state */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/constants.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/constants.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/constants.c	Fri Sep 21 14:49:14 2007
@@ -1,729 +1,729 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       constants.c
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include "iLBC_define.h"
-   
-   /* ULP bit allocation */
-   
-       /* 20 ms frame */
-   
-   const iLBC_ULP_Inst_t ULP_20msTbl = {
-       /* LSF */
-       {   {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, 
-           {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}},
-       /* Start state location, gain and samples */
-       {2,0,0,0,0},
-       {1,0,0,0,0},
-       {6,0,0,0,0},
-       {0,1,2,0,0},
-       /* extra CB index and extra CB gain */
-       {{6,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
-       {{2,0,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}},
-       /* CB index and CB gain */
-       {   {{7,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
-           {{0,0,8,0,0}, {0,0,8,0,0}, {0,0,8,0,0}},
-           {{0,0,0,0,0}, {0,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,2,2,0,0}, {1,1,2,0,0}, {0,0,3,0,0}},
-           {{1,1,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}},
-           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}},
-           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}}
-   };
-   
-       /* 30 ms frame */
-   
-   const iLBC_ULP_Inst_t ULP_30msTbl = {
-       /* LSF */
-       {   {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, 
-   
-   
-           {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}},
-       /* Start state location, gain and samples */
-       {3,0,0,0,0},
-       {1,0,0,0,0},
-       {6,0,0,0,0},
-       {0,1,2,0,0},
-       /* extra CB index and extra CB gain */
-       {{4,2,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
-       {{1,1,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}},
-       /* CB index and CB gain */
-       {   {{6,1,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
-           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}},
-           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}},
-           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}},
-       {   {{1,2,2,0,0}, {1,2,1,0,0}, {0,0,3,0,0}},
-           {{0,2,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}},
-           {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}},
-           {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}}
-   };
-   
-   /* HP Filters */
-   
-   float hpi_zero_coefsTbl[3] = {
-       (float)0.92727436, (float)-1.8544941, (float)0.92727436
-   };
-   float hpi_pole_coefsTbl[3] = {
-       (float)1.0, (float)-1.9059465, (float)0.9114024
-   };
-   float hpo_zero_coefsTbl[3] = {
-       (float)0.93980581, (float)-1.8795834, (float)0.93980581
-   };
-   float hpo_pole_coefsTbl[3] = {
-       (float)1.0, (float)-1.9330735, (float)0.93589199
-   };
-   
-   /* LP Filter */
-   
-   float lpFilt_coefsTbl[FILTERORDER_DS]={
-       (float)-0.066650, (float)0.125000, (float)0.316650, 
-       (float)0.414063, (float)0.316650, 
-       (float)0.125000, (float)-0.066650
-   };
-   
-   /* State quantization tables */
-   
-   float state_sq3Tbl[8] = {
-       (float)-3.719849, (float)-2.177490, (float)-1.130005, 
-       (float)-0.309692, (float)0.444214, (float)1.329712, 
-       (float)2.436279, (float)3.983887
-   };
-   
-   float state_frgqTbl[64] = {
-       (float)1.000085, (float)1.071695, (float)1.140395, 
-       (float)1.206868, (float)1.277188, (float)1.351503, 
-   
-   
-       (float)1.429380, (float)1.500727, (float)1.569049, 
-       (float)1.639599, (float)1.707071, (float)1.781531, 
-       (float)1.840799, (float)1.901550, (float)1.956695, 
-       (float)2.006750, (float)2.055474, (float)2.102787, 
-       (float)2.142819, (float)2.183592, (float)2.217962, 
-       (float)2.257177, (float)2.295739, (float)2.332967, 
-       (float)2.369248, (float)2.402792, (float)2.435080, 
-       (float)2.468598, (float)2.503394, (float)2.539284, 
-       (float)2.572944, (float)2.605036, (float)2.636331, 
-       (float)2.668939, (float)2.698780, (float)2.729101, 
-       (float)2.759786, (float)2.789834, (float)2.818679, 
-       (float)2.848074, (float)2.877470, (float)2.906899, 
-       (float)2.936655, (float)2.967804, (float)3.000115, 
-       (float)3.033367, (float)3.066355, (float)3.104231, 
-       (float)3.141499, (float)3.183012, (float)3.222952, 
-       (float)3.265433, (float)3.308441, (float)3.350823, 
-       (float)3.395275, (float)3.442793, (float)3.490801, 
-       (float)3.542514, (float)3.604064, (float)3.666050, 
-       (float)3.740994, (float)3.830749, (float)3.938770, 
-       (float)4.101764
-   };
-   
-   /* CB tables */
-   
-   int search_rangeTbl[5][CB_NSTAGES]={{58,58,58}, {108,44,44}, 
-               {108,108,108}, {108,108,108}, {108,108,108}};
-   int stMemLTbl=85;
-   int memLfTbl[NASUB_MAX]={147,147,147,147};
-   
-   /* expansion filter(s) */
-   
-   float cbfiltersTbl[CB_FILTERLEN]={
-       (float)-0.034180, (float)0.108887, (float)-0.184326,
-       (float)0.806152,  (float)0.713379, (float)-0.144043,
-       (float)0.083740,  (float)-0.033691
-   };
-   
-   /* Gain Quantization */
-   
-   float gain_sq3Tbl[8]={
-       (float)-1.000000,  (float)-0.659973,  (float)-0.330017,
-       (float)0.000000, (float)0.250000, (float)0.500000, 
-       (float)0.750000, (float)1.00000};
-   
-   float gain_sq4Tbl[16]={
-       (float)-1.049988, (float)-0.900024, (float)-0.750000, 
-       (float)-0.599976, (float)-0.450012, (float)-0.299988, 
-       (float)-0.150024, (float)0.000000, (float)0.150024, 
-       (float)0.299988, (float)0.450012, (float)0.599976, 
-       (float)0.750000, (float)0.900024, (float)1.049988, 
-       (float)1.200012};
-   
-   float gain_sq5Tbl[32]={
-       (float)0.037476, (float)0.075012, (float)0.112488, 
-   
-   
-       (float)0.150024, (float)0.187500, (float)0.224976, 
-       (float)0.262512, (float)0.299988, (float)0.337524, 
-       (float)0.375000, (float)0.412476, (float)0.450012, 
-       (float)0.487488, (float)0.525024, (float)0.562500, 
-       (float)0.599976, (float)0.637512, (float)0.674988, 
-       (float)0.712524, (float)0.750000, (float)0.787476, 
-       (float)0.825012, (float)0.862488, (float)0.900024, 
-       (float)0.937500, (float)0.974976, (float)1.012512, 
-       (float)1.049988, (float)1.087524, (float)1.125000, 
-       (float)1.162476, (float)1.200012};
-   
-   /* Enhancer - Upsamling a factor 4 (ENH_UPS0 = 4) */
-   float polyphaserTbl[ENH_UPS0*(2*ENH_FL0+1)]={ 
-       (float)0.000000, (float)0.000000, (float)0.000000,
-   (float)1.000000, 
-           (float)0.000000, (float)0.000000, (float)0.000000, 
-       (float)0.015625, (float)-0.076904, (float)0.288330,
-   (float)0.862061, 
-           (float)-0.106445, (float)0.018799, (float)-0.015625, 
-       (float)0.023682, (float)-0.124268, (float)0.601563,
-   (float)0.601563, 
-           (float)-0.124268, (float)0.023682, (float)-0.023682, 
-       (float)0.018799, (float)-0.106445, (float)0.862061,
-   (float)0.288330, 
-           (float)-0.076904, (float)0.015625, (float)-0.018799};
-   
-   float enh_plocsTbl[ENH_NBLOCKS_TOT] = {(float)40.0, (float)120.0, 
-               (float)200.0, (float)280.0, (float)360.0, 
-               (float)440.0, (float)520.0, (float)600.0};
-   
-   /* LPC analysis and quantization */ 
-   
-   int dim_lsfCbTbl[LSF_NSPLIT] = {3, 3, 4};
-   int size_lsfCbTbl[LSF_NSPLIT] = {64,128,128};
-   
-   
-   float lsfmeanTbl[LPC_FILTERORDER] = { 
-       (float)0.281738, (float)0.445801, (float)0.663330, 
-       (float)0.962524, (float)1.251831, (float)1.533081, 
-       (float)1.850586, (float)2.137817, (float)2.481445, 
-       (float)2.777344};
-   
-   float lsf_weightTbl_30ms[6] = {(float)(1.0/2.0), (float)1.0,
-   (float)(2.0/3.0), 
-       (float)(1.0/3.0), (float)0.0, (float)0.0};
-   
-   float lsf_weightTbl_20ms[4] = {(float)(3.0/4.0), (float)(2.0/4.0), 
-       (float)(1.0/4.0), (float)(0.0)};
-   
-   /* Hanning LPC window */
-   float lpc_winTbl[BLOCKL_MAX]={
-       (float)0.000183, (float)0.000671, (float)0.001526,
-       (float)0.002716, (float)0.004242, (float)0.006104,
-       (float)0.008301, (float)0.010834, (float)0.013702,
-   
-   
-       (float)0.016907, (float)0.020416, (float)0.024261,
-       (float)0.028442, (float)0.032928, (float)0.037750,
-       (float)0.042877, (float)0.048309, (float)0.054047,
-       (float)0.060089, (float)0.066437, (float)0.073090,
-       (float)0.080017, (float)0.087219, (float)0.094727,
-       (float)0.102509, (float)0.110535, (float)0.118835,
-       (float)0.127411, (float)0.136230, (float)0.145294,
-       (float)0.154602, (float)0.164154, (float)0.173920,
-       (float)0.183899, (float)0.194122, (float)0.204529,
-       (float)0.215149, (float)0.225952, (float)0.236938,
-       (float)0.248108, (float)0.259460, (float)0.270966,
-       (float)0.282654, (float)0.294464, (float)0.306396,
-       (float)0.318481, (float)0.330688, (float)0.343018,
-       (float)0.355438, (float)0.367981, (float)0.380585,
-       (float)0.393280, (float)0.406067, (float)0.418884,
-       (float)0.431763, (float)0.444702, (float)0.457672,
-       (float)0.470673, (float)0.483704, (float)0.496735,
-       (float)0.509766, (float)0.522797, (float)0.535828,
-       (float)0.548798, (float)0.561768, (float)0.574677,
-       (float)0.587524, (float)0.600342, (float)0.613068,
-       (float)0.625732, (float)0.638306, (float)0.650787,
-       (float)0.663147, (float)0.675415, (float)0.687561,
-       (float)0.699585, (float)0.711487, (float)0.723206,
-       (float)0.734802, (float)0.746216, (float)0.757477,
-       (float)0.768585, (float)0.779480, (float)0.790192,
-       (float)0.800720, (float)0.811005, (float)0.821106,
-       (float)0.830994, (float)0.840668, (float)0.850067,
-       (float)0.859253, (float)0.868225, (float)0.876892,
-       (float)0.885345, (float)0.893524, (float)0.901428,
-       (float)0.909058, (float)0.916412, (float)0.923492,
-       (float)0.930267, (float)0.936768, (float)0.942963,
-       (float)0.948853, (float)0.954437, (float)0.959717,
-       (float)0.964691, (float)0.969360, (float)0.973694,
-       (float)0.977692, (float)0.981384, (float)0.984741,
-       (float)0.987762, (float)0.990479, (float)0.992828,
-       (float)0.994873, (float)0.996552, (float)0.997925,
-       (float)0.998932, (float)0.999603, (float)0.999969,
-       (float)0.999969, (float)0.999603, (float)0.998932,
-       (float)0.997925, (float)0.996552, (float)0.994873,
-       (float)0.992828, (float)0.990479, (float)0.987762,
-       (float)0.984741, (float)0.981384, (float)0.977692,
-       (float)0.973694, (float)0.969360, (float)0.964691,
-       (float)0.959717, (float)0.954437, (float)0.948853,
-       (float)0.942963, (float)0.936768, (float)0.930267,
-       (float)0.923492, (float)0.916412, (float)0.909058,
-       (float)0.901428, (float)0.893524, (float)0.885345,
-       (float)0.876892, (float)0.868225, (float)0.859253,
-       (float)0.850067, (float)0.840668, (float)0.830994,
-       (float)0.821106, (float)0.811005, (float)0.800720,
-       (float)0.790192, (float)0.779480, (float)0.768585,
-       (float)0.757477, (float)0.746216, (float)0.734802,
-       (float)0.723206, (float)0.711487, (float)0.699585,
-       (float)0.687561, (float)0.675415, (float)0.663147,
-       (float)0.650787, (float)0.638306, (float)0.625732,
-   
-   
-       (float)0.613068, (float)0.600342, (float)0.587524,
-       (float)0.574677, (float)0.561768, (float)0.548798,
-       (float)0.535828, (float)0.522797, (float)0.509766,
-       (float)0.496735, (float)0.483704, (float)0.470673,
-       (float)0.457672, (float)0.444702, (float)0.431763,
-       (float)0.418884, (float)0.406067, (float)0.393280,
-       (float)0.380585, (float)0.367981, (float)0.355438,
-       (float)0.343018, (float)0.330688, (float)0.318481,
-       (float)0.306396, (float)0.294464, (float)0.282654,
-       (float)0.270966, (float)0.259460, (float)0.248108,
-       (float)0.236938, (float)0.225952, (float)0.215149,
-       (float)0.204529, (float)0.194122, (float)0.183899,
-       (float)0.173920, (float)0.164154, (float)0.154602,
-       (float)0.145294, (float)0.136230, (float)0.127411,
-       (float)0.118835, (float)0.110535, (float)0.102509,
-       (float)0.094727, (float)0.087219, (float)0.080017,
-       (float)0.073090, (float)0.066437, (float)0.060089,
-       (float)0.054047, (float)0.048309, (float)0.042877,
-       (float)0.037750, (float)0.032928, (float)0.028442,
-       (float)0.024261, (float)0.020416, (float)0.016907,
-       (float)0.013702, (float)0.010834, (float)0.008301,
-       (float)0.006104, (float)0.004242, (float)0.002716,
-       (float)0.001526, (float)0.000671, (float)0.000183
-   };
-   
-   /* Asymmetric LPC window */
-   float lpc_asymwinTbl[BLOCKL_MAX]={
-       (float)0.000061, (float)0.000214, (float)0.000458,
-       (float)0.000824, (float)0.001282, (float)0.001831,
-       (float)0.002472, (float)0.003235, (float)0.004120,
-       (float)0.005066, (float)0.006134, (float)0.007294,
-       (float)0.008545, (float)0.009918, (float)0.011383,
-       (float)0.012939, (float)0.014587, (float)0.016357,
-       (float)0.018219, (float)0.020172, (float)0.022217,
-       (float)0.024353, (float)0.026611, (float)0.028961,
-       (float)0.031372, (float)0.033905, (float)0.036530,
-       (float)0.039276, (float)0.042084, (float)0.044983,
-       (float)0.047974, (float)0.051086, (float)0.054260,
-       (float)0.057526, (float)0.060883, (float)0.064331,
-       (float)0.067871, (float)0.071503, (float)0.075226,
-       (float)0.079010, (float)0.082916, (float)0.086884,
-       (float)0.090942, (float)0.095062, (float)0.099304,
-       (float)0.103607, (float)0.107971, (float)0.112427,
-       (float)0.116974, (float)0.121582, (float)0.126282,
-       (float)0.131073, (float)0.135895, (float)0.140839,
-       (float)0.145813, (float)0.150879, (float)0.156006,
-       (float)0.161224, (float)0.166504, (float)0.171844,
-       (float)0.177246, (float)0.182709, (float)0.188263,
-       (float)0.193848, (float)0.199524, (float)0.205231,
-       (float)0.211029, (float)0.216858, (float)0.222778,
-       (float)0.228729, (float)0.234741, (float)0.240814,
-       (float)0.246918, (float)0.253082, (float)0.259308,
-       (float)0.265564, (float)0.271881, (float)0.278259,
-       (float)0.284668, (float)0.291107, (float)0.297607,
-   
-   
-       (float)0.304138, (float)0.310730, (float)0.317322,
-       (float)0.323975, (float)0.330658, (float)0.337372,
-       (float)0.344147, (float)0.350922, (float)0.357727,
-       (float)0.364594, (float)0.371460, (float)0.378357,
-       (float)0.385284, (float)0.392212, (float)0.399170,
-       (float)0.406158, (float)0.413177, (float)0.420197,
-       (float)0.427246, (float)0.434296, (float)0.441376,
-       (float)0.448456, (float)0.455536, (float)0.462646,
-       (float)0.469757, (float)0.476868, (float)0.483978,
-       (float)0.491089, (float)0.498230, (float)0.505341,
-       (float)0.512451, (float)0.519592, (float)0.526703,
-       (float)0.533813, (float)0.540924, (float)0.548004,
-       (float)0.555084, (float)0.562164, (float)0.569244,
-       (float)0.576294, (float)0.583313, (float)0.590332,
-       (float)0.597321, (float)0.604309, (float)0.611267,
-       (float)0.618195, (float)0.625092, (float)0.631989,
-       (float)0.638855, (float)0.645660, (float)0.652466,
-       (float)0.659241, (float)0.665985, (float)0.672668,
-       (float)0.679352, (float)0.685974, (float)0.692566,
-       (float)0.699127, (float)0.705658, (float)0.712128,
-       (float)0.718536, (float)0.724945, (float)0.731262,
-       (float)0.737549, (float)0.743805, (float)0.750000,
-       (float)0.756134, (float)0.762238, (float)0.768280,
-       (float)0.774261, (float)0.780182, (float)0.786072,
-       (float)0.791870, (float)0.797638, (float)0.803314,
-       (float)0.808960, (float)0.814514, (float)0.820038,
-       (float)0.825470, (float)0.830841, (float)0.836151,
-       (float)0.841400, (float)0.846558, (float)0.851654,
-       (float)0.856689, (float)0.861633, (float)0.866516,
-       (float)0.871338, (float)0.876068, (float)0.880737,
-       (float)0.885315, (float)0.889801, (float)0.894226,
-       (float)0.898560, (float)0.902832, (float)0.907013,
-       (float)0.911102, (float)0.915100, (float)0.919037,
-       (float)0.922882, (float)0.926636, (float)0.930328,
-       (float)0.933899, (float)0.937408, (float)0.940796,
-       (float)0.944122, (float)0.947357, (float)0.950470,
-       (float)0.953522, (float)0.956482, (float)0.959351,
-       (float)0.962097, (float)0.964783, (float)0.967377,
-       (float)0.969849, (float)0.972229, (float)0.974518,
-       (float)0.976715, (float)0.978821, (float)0.980835,
-       (float)0.982727, (float)0.984528, (float)0.986237,
-       (float)0.987854, (float)0.989380, (float)0.990784,
-       (float)0.992096, (float)0.993317, (float)0.994415,
-       (float)0.995422, (float)0.996338, (float)0.997162,
-       (float)0.997864, (float)0.998474, (float)0.998962,
-       (float)0.999390, (float)0.999695, (float)0.999878,
-       (float)0.999969, (float)0.999969, (float)0.996918,
-       (float)0.987701, (float)0.972382, (float)0.951050,
-       (float)0.923889, (float)0.891022, (float)0.852631,
-       (float)0.809021, (float)0.760406, (float)0.707092,
-       (float)0.649445, (float)0.587799, (float)0.522491,
-       (float)0.453979, (float)0.382690, (float)0.309021,
-       (float)0.233459, (float)0.156433, (float)0.078461
-   };
-   
-   
-   
-   /* Lag window for LPC */
-   float lpc_lagwinTbl[LPC_FILTERORDER + 1]={
-       (float)1.000100, (float)0.998890, (float)0.995569,
-           (float)0.990057, (float)0.982392,
-       (float)0.972623, (float)0.960816, (float)0.947047,
-           (float)0.931405, (float)0.913989, (float)0.894909};
-   
-   /* LSF quantization*/
-   float lsfCbTbl[64 * 3 + 128 * 3 + 128 * 4] = {
-   (float)0.155396, (float)0.273193, (float)0.451172,
-   (float)0.390503, (float)0.648071, (float)1.002075,
-   (float)0.440186, (float)0.692261, (float)0.955688,
-   (float)0.343628, (float)0.642334, (float)1.071533,
-   (float)0.318359, (float)0.491577, (float)0.670532,
-   (float)0.193115, (float)0.375488, (float)0.725708,
-   (float)0.364136, (float)0.510376, (float)0.658691,
-   (float)0.297485, (float)0.527588, (float)0.842529,
-   (float)0.227173, (float)0.365967, (float)0.563110,
-   (float)0.244995, (float)0.396729, (float)0.636475,
-   (float)0.169434, (float)0.300171, (float)0.520264,
-   (float)0.312866, (float)0.464478, (float)0.643188,
-   (float)0.248535, (float)0.429932, (float)0.626099,
-   (float)0.236206, (float)0.491333, (float)0.817139,
-   (float)0.334961, (float)0.625122, (float)0.895752,
-   (float)0.343018, (float)0.518555, (float)0.698608,
-   (float)0.372803, (float)0.659790, (float)0.945435,
-   (float)0.176880, (float)0.316528, (float)0.581421,
-   (float)0.416382, (float)0.625977, (float)0.805176,
-   (float)0.303223, (float)0.568726, (float)0.915039,
-   (float)0.203613, (float)0.351440, (float)0.588135,
-   (float)0.221191, (float)0.375000, (float)0.614746,
-   (float)0.199951, (float)0.323364, (float)0.476074,
-   (float)0.300781, (float)0.433350, (float)0.566895,
-   (float)0.226196, (float)0.354004, (float)0.507568,
-   (float)0.300049, (float)0.508179, (float)0.711670,
-   (float)0.312012, (float)0.492676, (float)0.763428,
-   (float)0.329956, (float)0.541016, (float)0.795776,
-   (float)0.373779, (float)0.604614, (float)0.928833,
-   (float)0.210571, (float)0.452026, (float)0.755249,
-   (float)0.271118, (float)0.473267, (float)0.662476,
-   (float)0.285522, (float)0.436890, (float)0.634399,
-   (float)0.246704, (float)0.565552, (float)0.859009,
-   (float)0.270508, (float)0.406250, (float)0.553589,
-   (float)0.361450, (float)0.578491, (float)0.813843,
-   (float)0.342651, (float)0.482788, (float)0.622437,
-   (float)0.340332, (float)0.549438, (float)0.743164,
-   (float)0.200439, (float)0.336304, (float)0.540894,
-   (float)0.407837, (float)0.644775, (float)0.895142,
-   (float)0.294678, (float)0.454834, (float)0.699097,
-   (float)0.193115, (float)0.344482, (float)0.643188,
-   (float)0.275757, (float)0.420776, (float)0.598755,
-   (float)0.380493, (float)0.608643, (float)0.861084,
-   (float)0.222778, (float)0.426147, (float)0.676514,
-   
-   
-   (float)0.407471, (float)0.700195, (float)1.053101,
-   (float)0.218384, (float)0.377197, (float)0.669922,
-   (float)0.313232, (float)0.454102, (float)0.600952,
-   (float)0.347412, (float)0.571533, (float)0.874146,
-   (float)0.238037, (float)0.405396, (float)0.729492,
-   (float)0.223877, (float)0.412964, (float)0.822021,
-   (float)0.395264, (float)0.582153, (float)0.743896,
-   (float)0.247925, (float)0.485596, (float)0.720581,
-   (float)0.229126, (float)0.496582, (float)0.907715,
-   (float)0.260132, (float)0.566895, (float)1.012695,
-   (float)0.337402, (float)0.611572, (float)0.978149,
-   (float)0.267822, (float)0.447632, (float)0.769287,
-   (float)0.250610, (float)0.381714, (float)0.530029,
-   (float)0.430054, (float)0.805054, (float)1.221924,
-   (float)0.382568, (float)0.544067, (float)0.701660,
-   (float)0.383545, (float)0.710327, (float)1.149170,
-   (float)0.271362, (float)0.529053, (float)0.775513,
-   (float)0.246826, (float)0.393555, (float)0.588623,
-   (float)0.266846, (float)0.422119, (float)0.676758,
-   (float)0.311523, (float)0.580688, (float)0.838623,
-   (float)1.331177, (float)1.576782, (float)1.779541,
-   (float)1.160034, (float)1.401978, (float)1.768188,
-   (float)1.161865, (float)1.525146, (float)1.715332,
-   (float)0.759521, (float)0.913940, (float)1.119873,
-   (float)0.947144, (float)1.121338, (float)1.282471,
-   (float)1.015015, (float)1.557007, (float)1.804932,
-   (float)1.172974, (float)1.402100, (float)1.692627,
-   (float)1.087524, (float)1.474243, (float)1.665405,
-   (float)0.899536, (float)1.105225, (float)1.406250,
-   (float)1.148438, (float)1.484741, (float)1.796265,
-   (float)0.785645, (float)1.209839, (float)1.567749,
-   (float)0.867798, (float)1.166504, (float)1.450684,
-   (float)0.922485, (float)1.229858, (float)1.420898,
-   (float)0.791260, (float)1.123291, (float)1.409546,
-   (float)0.788940, (float)0.966064, (float)1.340332,
-   (float)1.051147, (float)1.272827, (float)1.556641,
-   (float)0.866821, (float)1.181152, (float)1.538818,
-   (float)0.906738, (float)1.373535, (float)1.607910,
-   (float)1.244751, (float)1.581421, (float)1.933838,
-   (float)0.913940, (float)1.337280, (float)1.539673,
-   (float)0.680542, (float)0.959229, (float)1.662720,
-   (float)0.887207, (float)1.430542, (float)1.800781,
-   (float)0.912598, (float)1.433594, (float)1.683960,
-   (float)0.860474, (float)1.060303, (float)1.455322,
-   (float)1.005127, (float)1.381104, (float)1.706909,
-   (float)0.800781, (float)1.363892, (float)1.829102,
-   (float)0.781860, (float)1.124390, (float)1.505981,
-   (float)1.003662, (float)1.471436, (float)1.684692,
-   (float)0.981323, (float)1.309570, (float)1.618042,
-   (float)1.228760, (float)1.554321, (float)1.756470,
-   (float)0.734375, (float)0.895752, (float)1.225586,
-   (float)0.841797, (float)1.055664, (float)1.249268,
-   (float)0.920166, (float)1.119385, (float)1.486206,
-   (float)0.894409, (float)1.539063, (float)1.828979,
-   
-   
-   (float)1.283691, (float)1.543335, (float)1.858276,
-   (float)0.676025, (float)0.933105, (float)1.490845,
-   (float)0.821289, (float)1.491821, (float)1.739868,
-   (float)0.923218, (float)1.144653, (float)1.580566,
-   (float)1.057251, (float)1.345581, (float)1.635864,
-   (float)0.888672, (float)1.074951, (float)1.353149,
-   (float)0.942749, (float)1.195435, (float)1.505493,
-   (float)1.492310, (float)1.788086, (float)2.039673,
-   (float)1.070313, (float)1.634399, (float)1.860962,
-   (float)1.253296, (float)1.488892, (float)1.686035,
-   (float)0.647095, (float)0.864014, (float)1.401855,
-   (float)0.866699, (float)1.254883, (float)1.453369,
-   (float)1.063965, (float)1.532593, (float)1.731323,
-   (float)1.167847, (float)1.521484, (float)1.884033,
-   (float)0.956055, (float)1.502075, (float)1.745605,
-   (float)0.928711, (float)1.288574, (float)1.479614,
-   (float)1.088013, (float)1.380737, (float)1.570801,
-   (float)0.905029, (float)1.186768, (float)1.371948,
-   (float)1.057861, (float)1.421021, (float)1.617432,
-   (float)1.108276, (float)1.312500, (float)1.501465,
-   (float)0.979492, (float)1.416992, (float)1.624268,
-   (float)1.276001, (float)1.661011, (float)2.007935,
-   (float)0.993042, (float)1.168579, (float)1.331665,
-   (float)0.778198, (float)0.944946, (float)1.235962,
-   (float)1.223755, (float)1.491333, (float)1.815674,
-   (float)0.852661, (float)1.350464, (float)1.722290,
-   (float)1.134766, (float)1.593140, (float)1.787354,
-   (float)1.051392, (float)1.339722, (float)1.531006,
-   (float)0.803589, (float)1.271240, (float)1.652100,
-   (float)0.755737, (float)1.143555, (float)1.639404,
-   (float)0.700928, (float)0.837280, (float)1.130371,
-   (float)0.942749, (float)1.197876, (float)1.669800,
-   (float)0.993286, (float)1.378296, (float)1.566528,
-   (float)0.801025, (float)1.095337, (float)1.298950,
-   (float)0.739990, (float)1.032959, (float)1.383667,
-   (float)0.845703, (float)1.072266, (float)1.543823,
-   (float)0.915649, (float)1.072266, (float)1.224487,
-   (float)1.021973, (float)1.226196, (float)1.481323,
-   (float)0.999878, (float)1.204102, (float)1.555908,
-   (float)0.722290, (float)0.913940, (float)1.340210,
-   (float)0.673340, (float)0.835938, (float)1.259521,
-   (float)0.832397, (float)1.208374, (float)1.394165,
-   (float)0.962158, (float)1.576172, (float)1.912842,
-   (float)1.166748, (float)1.370850, (float)1.556763,
-   (float)0.946289, (float)1.138550, (float)1.400391,
-   (float)1.035034, (float)1.218262, (float)1.386475,
-   (float)1.393799, (float)1.717773, (float)2.000244,
-   (float)0.972656, (float)1.260986, (float)1.760620,
-   (float)1.028198, (float)1.288452, (float)1.484619,
-   (float)0.773560, (float)1.258057, (float)1.756714,
-   (float)1.080322, (float)1.328003, (float)1.742676,
-   (float)0.823975, (float)1.450806, (float)1.917725,
-   (float)0.859009, (float)1.016602, (float)1.191895,
-   (float)0.843994, (float)1.131104, (float)1.645020,
-   
-   
-   (float)1.189697, (float)1.702759, (float)1.894409,
-   (float)1.346680, (float)1.763184, (float)2.066040,
-   (float)0.980469, (float)1.253784, (float)1.441650,
-   (float)1.338135, (float)1.641968, (float)1.932739,
-   (float)1.223267, (float)1.424194, (float)1.626465,
-   (float)0.765747, (float)1.004150, (float)1.579102,
-   (float)1.042847, (float)1.269165, (float)1.647461,
-   (float)0.968750, (float)1.257568, (float)1.555786,
-   (float)0.826294, (float)0.993408, (float)1.275146,
-   (float)0.742310, (float)0.950439, (float)1.430542,
-   (float)1.054321, (float)1.439819, (float)1.828003,
-   (float)1.072998, (float)1.261719, (float)1.441895,
-   (float)0.859375, (float)1.036377, (float)1.314819,
-   (float)0.895752, (float)1.267212, (float)1.605591,
-   (float)0.805420, (float)0.962891, (float)1.142334,
-   (float)0.795654, (float)1.005493, (float)1.468506,
-   (float)1.105347, (float)1.313843, (float)1.584839,
-   (float)0.792236, (float)1.221802, (float)1.465698,
-   (float)1.170532, (float)1.467651, (float)1.664063,
-   (float)0.838257, (float)1.153198, (float)1.342163,
-   (float)0.968018, (float)1.198242, (float)1.391235,
-   (float)1.250122, (float)1.623535, (float)1.823608,
-   (float)0.711670, (float)1.058350, (float)1.512085,
-   (float)1.204834, (float)1.454468, (float)1.739136,
-   (float)1.137451, (float)1.421753, (float)1.620117,
-   (float)0.820435, (float)1.322754, (float)1.578247,
-   (float)0.798706, (float)1.005005, (float)1.213867,
-   (float)0.980713, (float)1.324951, (float)1.512939,
-   (float)1.112305, (float)1.438843, (float)1.735596,
-   (float)1.135498, (float)1.356689, (float)1.635742,
-   (float)1.101318, (float)1.387451, (float)1.686523,
-   (float)0.849854, (float)1.276978, (float)1.523438,
-   (float)1.377930, (float)1.627563, (float)1.858154,
-   (float)0.884888, (float)1.095459, (float)1.287476,
-   (float)1.289795, (float)1.505859, (float)1.756592,
-   (float)0.817505, (float)1.384155, (float)1.650513,
-   (float)1.446655, (float)1.702148, (float)1.931885,
-   (float)0.835815, (float)1.023071, (float)1.385376,
-   (float)0.916626, (float)1.139038, (float)1.335327,
-   (float)0.980103, (float)1.174072, (float)1.453735,
-   (float)1.705688, (float)2.153809, (float)2.398315, (float)2.743408,
-   (float)1.797119, (float)2.016846, (float)2.445679, (float)2.701904,
-   (float)1.990356, (float)2.219116, (float)2.576416, (float)2.813477,
-   (float)1.849365, (float)2.190918, (float)2.611572, (float)2.835083,
-   (float)1.657959, (float)1.854370, (float)2.159058, (float)2.726196,
-   (float)1.437744, (float)1.897705, (float)2.253174, (float)2.655396,
-   (float)2.028687, (float)2.247314, (float)2.542358, (float)2.875854,
-   (float)1.736938, (float)1.922119, (float)2.185913, (float)2.743408,
-   (float)1.521606, (float)1.870972, (float)2.526855, (float)2.786987,
-   (float)1.841431, (float)2.050659, (float)2.463623, (float)2.857666,
-   (float)1.590088, (float)2.067261, (float)2.427979, (float)2.794434,
-   (float)1.746826, (float)2.057373, (float)2.320190, (float)2.800781,
-   (float)1.734619, (float)1.940552, (float)2.306030, (float)2.826416,
-   (float)1.786255, (float)2.204468, (float)2.457520, (float)2.795288,
-   
-   
-   (float)1.861084, (float)2.170532, (float)2.414551, (float)2.763672,
-   (float)2.001465, (float)2.307617, (float)2.552734, (float)2.811890,
-   (float)1.784424, (float)2.124146, (float)2.381592, (float)2.645508,
-   (float)1.888794, (float)2.135864, (float)2.418579, (float)2.861206,
-   (float)2.301147, (float)2.531250, (float)2.724976, (float)2.913086,
-   (float)1.837769, (float)2.051270, (float)2.261963, (float)2.553223,
-   (float)2.012939, (float)2.221191, (float)2.440186, (float)2.678101,
-   (float)1.429565, (float)1.858276, (float)2.582275, (float)2.845703,
-   (float)1.622803, (float)1.897705, (float)2.367310, (float)2.621094,
-   (float)1.581543, (float)1.960449, (float)2.515869, (float)2.736450,
-   (float)1.419434, (float)1.933960, (float)2.394653, (float)2.746704,
-   (float)1.721924, (float)2.059570, (float)2.421753, (float)2.769653,
-   (float)1.911011, (float)2.220703, (float)2.461060, (float)2.740723,
-   (float)1.581177, (float)1.860840, (float)2.516968, (float)2.874634,
-   (float)1.870361, (float)2.098755, (float)2.432373, (float)2.656494,
-   (float)2.059692, (float)2.279785, (float)2.495605, (float)2.729370,
-   (float)1.815674, (float)2.181519, (float)2.451538, (float)2.680542,
-   (float)1.407959, (float)1.768311, (float)2.343018, (float)2.668091,
-   (float)2.168701, (float)2.394653, (float)2.604736, (float)2.829346,
-   (float)1.636230, (float)1.865723, (float)2.329102, (float)2.824219,
-   (float)1.878906, (float)2.139526, (float)2.376709, (float)2.679810,
-   (float)1.765381, (float)1.971802, (float)2.195435, (float)2.586914,
-   (float)2.164795, (float)2.410889, (float)2.673706, (float)2.903198,
-   (float)2.071899, (float)2.331055, (float)2.645874, (float)2.907104,
-   (float)2.026001, (float)2.311523, (float)2.594849, (float)2.863892,
-   (float)1.948975, (float)2.180786, (float)2.514893, (float)2.797852,
-   (float)1.881836, (float)2.130859, (float)2.478149, (float)2.804199,
-   (float)2.238159, (float)2.452759, (float)2.652832, (float)2.868286,
-   (float)1.897949, (float)2.101685, (float)2.524292, (float)2.880127,
-   (float)1.856445, (float)2.074585, (float)2.541016, (float)2.791748,
-   (float)1.695557, (float)2.199097, (float)2.506226, (float)2.742676,
-   (float)1.612671, (float)1.877075, (float)2.435425, (float)2.732910,
-   (float)1.568848, (float)1.786499, (float)2.194580, (float)2.768555,
-   (float)1.953369, (float)2.164551, (float)2.486938, (float)2.874023,
-   (float)1.388306, (float)1.725342, (float)2.384521, (float)2.771851,
-   (float)2.115356, (float)2.337769, (float)2.592896, (float)2.864014,
-   (float)1.905762, (float)2.111328, (float)2.363525, (float)2.789307,
-   (float)1.882568, (float)2.332031, (float)2.598267, (float)2.827637,
-   (float)1.683594, (float)2.088745, (float)2.361938, (float)2.608643,
-   (float)1.874023, (float)2.182129, (float)2.536133, (float)2.766968,
-   (float)1.861938, (float)2.070435, (float)2.309692, (float)2.700562,
-   (float)1.722168, (float)2.107422, (float)2.477295, (float)2.837646,
-   (float)1.926880, (float)2.184692, (float)2.442627, (float)2.663818,
-   (float)2.123901, (float)2.337280, (float)2.553101, (float)2.777466,
-   (float)1.588135, (float)1.911499, (float)2.212769, (float)2.543945,
-   (float)2.053955, (float)2.370850, (float)2.712158, (float)2.939941,
-   (float)2.210449, (float)2.519653, (float)2.770386, (float)2.958618,
-   (float)2.199463, (float)2.474731, (float)2.718262, (float)2.919922,
-   (float)1.960083, (float)2.175415, (float)2.608032, (float)2.888794,
-   (float)1.953735, (float)2.185181, (float)2.428223, (float)2.809570,
-   (float)1.615234, (float)2.036499, (float)2.576538, (float)2.834595,
-   (float)1.621094, (float)2.028198, (float)2.431030, (float)2.664673,
-   (float)1.824951, (float)2.267456, (float)2.514526, (float)2.747925,
-   (float)1.994263, (float)2.229126, (float)2.475220, (float)2.833984,
-   
-   
-   (float)1.746338, (float)2.011353, (float)2.588257, (float)2.826904,
-   (float)1.562866, (float)2.135986, (float)2.471680, (float)2.687256,
-   (float)1.748901, (float)2.083496, (float)2.460938, (float)2.686279,
-   (float)1.758057, (float)2.131470, (float)2.636597, (float)2.891602,
-   (float)2.071289, (float)2.299072, (float)2.550781, (float)2.814331,
-   (float)1.839600, (float)2.094360, (float)2.496460, (float)2.723999,
-   (float)1.882202, (float)2.088257, (float)2.636841, (float)2.923096,
-   (float)1.957886, (float)2.153198, (float)2.384399, (float)2.615234,
-   (float)1.992920, (float)2.351196, (float)2.654419, (float)2.889771,
-   (float)2.012817, (float)2.262451, (float)2.643799, (float)2.903076,
-   (float)2.025635, (float)2.254761, (float)2.508423, (float)2.784058,
-   (float)2.316040, (float)2.589355, (float)2.794189, (float)2.963623,
-   (float)1.741211, (float)2.279541, (float)2.578491, (float)2.816284,
-   (float)1.845337, (float)2.055786, (float)2.348511, (float)2.822021,
-   (float)1.679932, (float)1.926514, (float)2.499756, (float)2.835693,
-   (float)1.722534, (float)1.946899, (float)2.448486, (float)2.728760,
-   (float)1.829834, (float)2.043213, (float)2.580444, (float)2.867676,
-   (float)1.676636, (float)2.071655, (float)2.322510, (float)2.704834,
-   (float)1.791504, (float)2.113525, (float)2.469727, (float)2.784058,
-   (float)1.977051, (float)2.215088, (float)2.497437, (float)2.726929,
-   (float)1.800171, (float)2.106689, (float)2.357788, (float)2.738892,
-   (float)1.827759, (float)2.170166, (float)2.525879, (float)2.852417,
-   (float)1.918335, (float)2.132813, (float)2.488403, (float)2.728149,
-   (float)1.916748, (float)2.225098, (float)2.542603, (float)2.857666,
-   (float)1.761230, (float)1.976074, (float)2.507446, (float)2.884521,
-   (float)2.053711, (float)2.367432, (float)2.608032, (float)2.837646,
-   (float)1.595337, (float)2.000977, (float)2.307129, (float)2.578247,
-   (float)1.470581, (float)2.031250, (float)2.375854, (float)2.647583,
-   (float)1.801392, (float)2.128052, (float)2.399780, (float)2.822876,
-   (float)1.853638, (float)2.066650, (float)2.429199, (float)2.751465,
-   (float)1.956299, (float)2.163696, (float)2.394775, (float)2.734253,
-   (float)1.963623, (float)2.275757, (float)2.585327, (float)2.865234,
-   (float)1.887451, (float)2.105469, (float)2.331787, (float)2.587402,
-   (float)2.120117, (float)2.443359, (float)2.733887, (float)2.941406,
-   (float)1.506348, (float)1.766968, (float)2.400513, (float)2.851807,
-   (float)1.664551, (float)1.981079, (float)2.375732, (float)2.774414,
-   (float)1.720703, (float)1.978882, (float)2.391479, (float)2.640991,
-   (float)1.483398, (float)1.814819, (float)2.434448, (float)2.722290,
-   (float)1.769043, (float)2.136597, (float)2.563721, (float)2.774414,
-   (float)1.810791, (float)2.049316, (float)2.373901, (float)2.613647,
-   (float)1.788330, (float)2.005981, (float)2.359131, (float)2.723145,
-   (float)1.785156, (float)1.993164, (float)2.399780, (float)2.832520,
-   (float)1.695313, (float)2.022949, (float)2.522583, (float)2.745117,
-   (float)1.584106, (float)1.965576, (float)2.299927, (float)2.715576,
-   (float)1.894897, (float)2.249878, (float)2.655884, (float)2.897705,
-   (float)1.720581, (float)1.995728, (float)2.299438, (float)2.557007,
-   (float)1.619385, (float)2.173950, (float)2.574219, (float)2.787964,
-   (float)1.883179, (float)2.220459, (float)2.474365, (float)2.825073,
-   (float)1.447632, (float)2.045044, (float)2.555542, (float)2.744873,
-   (float)1.502686, (float)2.156616, (float)2.653320, (float)2.846558,
-   (float)1.711548, (float)1.944092, (float)2.282959, (float)2.685791,
-   (float)1.499756, (float)1.867554, (float)2.341064, (float)2.578857,
-   (float)1.916870, (float)2.135132, (float)2.568237, (float)2.826050,
-   (float)1.498047, (float)1.711182, (float)2.223267, (float)2.755127,
-   
-   
-   (float)1.808716, (float)1.997559, (float)2.256470, (float)2.758545,
-   (float)2.088501, (float)2.402710, (float)2.667358, (float)2.890259,
-   (float)1.545044, (float)1.819214, (float)2.324097, (float)2.692993,
-   (float)1.796021, (float)2.012573, (float)2.505737, (float)2.784912,
-   (float)1.786499, (float)2.041748, (float)2.290405, (float)2.650757,
-   (float)1.938232, (float)2.264404, (float)2.529053, (float)2.796143
-   };
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       constants.c
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include "iLBC_define.h"
+   
+   /* ULP bit allocation */
+   
+       /* 20 ms frame */
+   
+   const iLBC_ULP_Inst_t ULP_20msTbl = {
+       /* LSF */
+       {   {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, 
+           {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}},
+       /* Start state location, gain and samples */
+       {2,0,0,0,0},
+       {1,0,0,0,0},
+       {6,0,0,0,0},
+       {0,1,2,0,0},
+       /* extra CB index and extra CB gain */
+       {{6,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
+       {{2,0,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}},
+       /* CB index and CB gain */
+       {   {{7,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
+           {{0,0,8,0,0}, {0,0,8,0,0}, {0,0,8,0,0}},
+           {{0,0,0,0,0}, {0,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,2,2,0,0}, {1,1,2,0,0}, {0,0,3,0,0}},
+           {{1,1,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}},
+           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}},
+           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}}
+   };
+   
+       /* 30 ms frame */
+   
+   const iLBC_ULP_Inst_t ULP_30msTbl = {
+       /* LSF */
+       {   {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}, 
+   
+   
+           {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}},
+       /* Start state location, gain and samples */
+       {3,0,0,0,0},
+       {1,0,0,0,0},
+       {6,0,0,0,0},
+       {0,1,2,0,0},
+       /* extra CB index and extra CB gain */
+       {{4,2,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
+       {{1,1,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}},
+       /* CB index and CB gain */
+       {   {{6,1,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}},
+           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}},
+           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}},
+           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}},
+       {   {{1,2,2,0,0}, {1,2,1,0,0}, {0,0,3,0,0}},
+           {{0,2,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}},
+           {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}},
+           {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}}
+   };
+   
+   /* HP Filters */
+   
+   float hpi_zero_coefsTbl[3] = {
+       (float)0.92727436, (float)-1.8544941, (float)0.92727436
+   };
+   float hpi_pole_coefsTbl[3] = {
+       (float)1.0, (float)-1.9059465, (float)0.9114024
+   };
+   float hpo_zero_coefsTbl[3] = {
+       (float)0.93980581, (float)-1.8795834, (float)0.93980581
+   };
+   float hpo_pole_coefsTbl[3] = {
+       (float)1.0, (float)-1.9330735, (float)0.93589199
+   };
+   
+   /* LP Filter */
+   
+   float lpFilt_coefsTbl[FILTERORDER_DS]={
+       (float)-0.066650, (float)0.125000, (float)0.316650, 
+       (float)0.414063, (float)0.316650, 
+       (float)0.125000, (float)-0.066650
+   };
+   
+   /* State quantization tables */
+   
+   float state_sq3Tbl[8] = {
+       (float)-3.719849, (float)-2.177490, (float)-1.130005, 
+       (float)-0.309692, (float)0.444214, (float)1.329712, 
+       (float)2.436279, (float)3.983887
+   };
+   
+   float state_frgqTbl[64] = {
+       (float)1.000085, (float)1.071695, (float)1.140395, 
+       (float)1.206868, (float)1.277188, (float)1.351503, 
+   
+   
+       (float)1.429380, (float)1.500727, (float)1.569049, 
+       (float)1.639599, (float)1.707071, (float)1.781531, 
+       (float)1.840799, (float)1.901550, (float)1.956695, 
+       (float)2.006750, (float)2.055474, (float)2.102787, 
+       (float)2.142819, (float)2.183592, (float)2.217962, 
+       (float)2.257177, (float)2.295739, (float)2.332967, 
+       (float)2.369248, (float)2.402792, (float)2.435080, 
+       (float)2.468598, (float)2.503394, (float)2.539284, 
+       (float)2.572944, (float)2.605036, (float)2.636331, 
+       (float)2.668939, (float)2.698780, (float)2.729101, 
+       (float)2.759786, (float)2.789834, (float)2.818679, 
+       (float)2.848074, (float)2.877470, (float)2.906899, 
+       (float)2.936655, (float)2.967804, (float)3.000115, 
+       (float)3.033367, (float)3.066355, (float)3.104231, 
+       (float)3.141499, (float)3.183012, (float)3.222952, 
+       (float)3.265433, (float)3.308441, (float)3.350823, 
+       (float)3.395275, (float)3.442793, (float)3.490801, 
+       (float)3.542514, (float)3.604064, (float)3.666050, 
+       (float)3.740994, (float)3.830749, (float)3.938770, 
+       (float)4.101764
+   };
+   
+   /* CB tables */
+   
+   int search_rangeTbl[5][CB_NSTAGES]={{58,58,58}, {108,44,44}, 
+               {108,108,108}, {108,108,108}, {108,108,108}};
+   int stMemLTbl=85;
+   int memLfTbl[NASUB_MAX]={147,147,147,147};
+   
+   /* expansion filter(s) */
+   
+   float cbfiltersTbl[CB_FILTERLEN]={
+       (float)-0.034180, (float)0.108887, (float)-0.184326,
+       (float)0.806152,  (float)0.713379, (float)-0.144043,
+       (float)0.083740,  (float)-0.033691
+   };
+   
+   /* Gain Quantization */
+   
+   float gain_sq3Tbl[8]={
+       (float)-1.000000,  (float)-0.659973,  (float)-0.330017,
+       (float)0.000000, (float)0.250000, (float)0.500000, 
+       (float)0.750000, (float)1.00000};
+   
+   float gain_sq4Tbl[16]={
+       (float)-1.049988, (float)-0.900024, (float)-0.750000, 
+       (float)-0.599976, (float)-0.450012, (float)-0.299988, 
+       (float)-0.150024, (float)0.000000, (float)0.150024, 
+       (float)0.299988, (float)0.450012, (float)0.599976, 
+       (float)0.750000, (float)0.900024, (float)1.049988, 
+       (float)1.200012};
+   
+   float gain_sq5Tbl[32]={
+       (float)0.037476, (float)0.075012, (float)0.112488, 
+   
+   
+       (float)0.150024, (float)0.187500, (float)0.224976, 
+       (float)0.262512, (float)0.299988, (float)0.337524, 
+       (float)0.375000, (float)0.412476, (float)0.450012, 
+       (float)0.487488, (float)0.525024, (float)0.562500, 
+       (float)0.599976, (float)0.637512, (float)0.674988, 
+       (float)0.712524, (float)0.750000, (float)0.787476, 
+       (float)0.825012, (float)0.862488, (float)0.900024, 
+       (float)0.937500, (float)0.974976, (float)1.012512, 
+       (float)1.049988, (float)1.087524, (float)1.125000, 
+       (float)1.162476, (float)1.200012};
+   
+   /* Enhancer - Upsamling a factor 4 (ENH_UPS0 = 4) */
+   float polyphaserTbl[ENH_UPS0*(2*ENH_FL0+1)]={ 
+       (float)0.000000, (float)0.000000, (float)0.000000,
+   (float)1.000000, 
+           (float)0.000000, (float)0.000000, (float)0.000000, 
+       (float)0.015625, (float)-0.076904, (float)0.288330,
+   (float)0.862061, 
+           (float)-0.106445, (float)0.018799, (float)-0.015625, 
+       (float)0.023682, (float)-0.124268, (float)0.601563,
+   (float)0.601563, 
+           (float)-0.124268, (float)0.023682, (float)-0.023682, 
+       (float)0.018799, (float)-0.106445, (float)0.862061,
+   (float)0.288330, 
+           (float)-0.076904, (float)0.015625, (float)-0.018799};
+   
+   float enh_plocsTbl[ENH_NBLOCKS_TOT] = {(float)40.0, (float)120.0, 
+               (float)200.0, (float)280.0, (float)360.0, 
+               (float)440.0, (float)520.0, (float)600.0};
+   
+   /* LPC analysis and quantization */ 
+   
+   int dim_lsfCbTbl[LSF_NSPLIT] = {3, 3, 4};
+   int size_lsfCbTbl[LSF_NSPLIT] = {64,128,128};
+   
+   
+   float lsfmeanTbl[LPC_FILTERORDER] = { 
+       (float)0.281738, (float)0.445801, (float)0.663330, 
+       (float)0.962524, (float)1.251831, (float)1.533081, 
+       (float)1.850586, (float)2.137817, (float)2.481445, 
+       (float)2.777344};
+   
+   float lsf_weightTbl_30ms[6] = {(float)(1.0/2.0), (float)1.0,
+   (float)(2.0/3.0), 
+       (float)(1.0/3.0), (float)0.0, (float)0.0};
+   
+   float lsf_weightTbl_20ms[4] = {(float)(3.0/4.0), (float)(2.0/4.0), 
+       (float)(1.0/4.0), (float)(0.0)};
+   
+   /* Hanning LPC window */
+   float lpc_winTbl[BLOCKL_MAX]={
+       (float)0.000183, (float)0.000671, (float)0.001526,
+       (float)0.002716, (float)0.004242, (float)0.006104,
+       (float)0.008301, (float)0.010834, (float)0.013702,
+   
+   
+       (float)0.016907, (float)0.020416, (float)0.024261,
+       (float)0.028442, (float)0.032928, (float)0.037750,
+       (float)0.042877, (float)0.048309, (float)0.054047,
+       (float)0.060089, (float)0.066437, (float)0.073090,
+       (float)0.080017, (float)0.087219, (float)0.094727,
+       (float)0.102509, (float)0.110535, (float)0.118835,
+       (float)0.127411, (float)0.136230, (float)0.145294,
+       (float)0.154602, (float)0.164154, (float)0.173920,
+       (float)0.183899, (float)0.194122, (float)0.204529,
+       (float)0.215149, (float)0.225952, (float)0.236938,
+       (float)0.248108, (float)0.259460, (float)0.270966,
+       (float)0.282654, (float)0.294464, (float)0.306396,
+       (float)0.318481, (float)0.330688, (float)0.343018,
+       (float)0.355438, (float)0.367981, (float)0.380585,
+       (float)0.393280, (float)0.406067, (float)0.418884,
+       (float)0.431763, (float)0.444702, (float)0.457672,
+       (float)0.470673, (float)0.483704, (float)0.496735,
+       (float)0.509766, (float)0.522797, (float)0.535828,
+       (float)0.548798, (float)0.561768, (float)0.574677,
+       (float)0.587524, (float)0.600342, (float)0.613068,
+       (float)0.625732, (float)0.638306, (float)0.650787,
+       (float)0.663147, (float)0.675415, (float)0.687561,
+       (float)0.699585, (float)0.711487, (float)0.723206,
+       (float)0.734802, (float)0.746216, (float)0.757477,
+       (float)0.768585, (float)0.779480, (float)0.790192,
+       (float)0.800720, (float)0.811005, (float)0.821106,
+       (float)0.830994, (float)0.840668, (float)0.850067,
+       (float)0.859253, (float)0.868225, (float)0.876892,
+       (float)0.885345, (float)0.893524, (float)0.901428,
+       (float)0.909058, (float)0.916412, (float)0.923492,
+       (float)0.930267, (float)0.936768, (float)0.942963,
+       (float)0.948853, (float)0.954437, (float)0.959717,
+       (float)0.964691, (float)0.969360, (float)0.973694,
+       (float)0.977692, (float)0.981384, (float)0.984741,
+       (float)0.987762, (float)0.990479, (float)0.992828,
+       (float)0.994873, (float)0.996552, (float)0.997925,
+       (float)0.998932, (float)0.999603, (float)0.999969,
+       (float)0.999969, (float)0.999603, (float)0.998932,
+       (float)0.997925, (float)0.996552, (float)0.994873,
+       (float)0.992828, (float)0.990479, (float)0.987762,
+       (float)0.984741, (float)0.981384, (float)0.977692,
+       (float)0.973694, (float)0.969360, (float)0.964691,
+       (float)0.959717, (float)0.954437, (float)0.948853,
+       (float)0.942963, (float)0.936768, (float)0.930267,
+       (float)0.923492, (float)0.916412, (float)0.909058,
+       (float)0.901428, (float)0.893524, (float)0.885345,
+       (float)0.876892, (float)0.868225, (float)0.859253,
+       (float)0.850067, (float)0.840668, (float)0.830994,
+       (float)0.821106, (float)0.811005, (float)0.800720,
+       (float)0.790192, (float)0.779480, (float)0.768585,
+       (float)0.757477, (float)0.746216, (float)0.734802,
+       (float)0.723206, (float)0.711487, (float)0.699585,
+       (float)0.687561, (float)0.675415, (float)0.663147,
+       (float)0.650787, (float)0.638306, (float)0.625732,
+   
+   
+       (float)0.613068, (float)0.600342, (float)0.587524,
+       (float)0.574677, (float)0.561768, (float)0.548798,
+       (float)0.535828, (float)0.522797, (float)0.509766,
+       (float)0.496735, (float)0.483704, (float)0.470673,
+       (float)0.457672, (float)0.444702, (float)0.431763,
+       (float)0.418884, (float)0.406067, (float)0.393280,
+       (float)0.380585, (float)0.367981, (float)0.355438,
+       (float)0.343018, (float)0.330688, (float)0.318481,
+       (float)0.306396, (float)0.294464, (float)0.282654,
+       (float)0.270966, (float)0.259460, (float)0.248108,
+       (float)0.236938, (float)0.225952, (float)0.215149,
+       (float)0.204529, (float)0.194122, (float)0.183899,
+       (float)0.173920, (float)0.164154, (float)0.154602,
+       (float)0.145294, (float)0.136230, (float)0.127411,
+       (float)0.118835, (float)0.110535, (float)0.102509,
+       (float)0.094727, (float)0.087219, (float)0.080017,
+       (float)0.073090, (float)0.066437, (float)0.060089,
+       (float)0.054047, (float)0.048309, (float)0.042877,
+       (float)0.037750, (float)0.032928, (float)0.028442,
+       (float)0.024261, (float)0.020416, (float)0.016907,
+       (float)0.013702, (float)0.010834, (float)0.008301,
+       (float)0.006104, (float)0.004242, (float)0.002716,
+       (float)0.001526, (float)0.000671, (float)0.000183
+   };
+   
+   /* Asymmetric LPC window */
+   float lpc_asymwinTbl[BLOCKL_MAX]={
+       (float)0.000061, (float)0.000214, (float)0.000458,
+       (float)0.000824, (float)0.001282, (float)0.001831,
+       (float)0.002472, (float)0.003235, (float)0.004120,
+       (float)0.005066, (float)0.006134, (float)0.007294,
+       (float)0.008545, (float)0.009918, (float)0.011383,
+       (float)0.012939, (float)0.014587, (float)0.016357,
+       (float)0.018219, (float)0.020172, (float)0.022217,
+       (float)0.024353, (float)0.026611, (float)0.028961,
+       (float)0.031372, (float)0.033905, (float)0.036530,
+       (float)0.039276, (float)0.042084, (float)0.044983,
+       (float)0.047974, (float)0.051086, (float)0.054260,
+       (float)0.057526, (float)0.060883, (float)0.064331,
+       (float)0.067871, (float)0.071503, (float)0.075226,
+       (float)0.079010, (float)0.082916, (float)0.086884,
+       (float)0.090942, (float)0.095062, (float)0.099304,
+       (float)0.103607, (float)0.107971, (float)0.112427,
+       (float)0.116974, (float)0.121582, (float)0.126282,
+       (float)0.131073, (float)0.135895, (float)0.140839,
+       (float)0.145813, (float)0.150879, (float)0.156006,
+       (float)0.161224, (float)0.166504, (float)0.171844,
+       (float)0.177246, (float)0.182709, (float)0.188263,
+       (float)0.193848, (float)0.199524, (float)0.205231,
+       (float)0.211029, (float)0.216858, (float)0.222778,
+       (float)0.228729, (float)0.234741, (float)0.240814,
+       (float)0.246918, (float)0.253082, (float)0.259308,
+       (float)0.265564, (float)0.271881, (float)0.278259,
+       (float)0.284668, (float)0.291107, (float)0.297607,
+   
+   
+       (float)0.304138, (float)0.310730, (float)0.317322,
+       (float)0.323975, (float)0.330658, (float)0.337372,
+       (float)0.344147, (float)0.350922, (float)0.357727,
+       (float)0.364594, (float)0.371460, (float)0.378357,
+       (float)0.385284, (float)0.392212, (float)0.399170,
+       (float)0.406158, (float)0.413177, (float)0.420197,
+       (float)0.427246, (float)0.434296, (float)0.441376,
+       (float)0.448456, (float)0.455536, (float)0.462646,
+       (float)0.469757, (float)0.476868, (float)0.483978,
+       (float)0.491089, (float)0.498230, (float)0.505341,
+       (float)0.512451, (float)0.519592, (float)0.526703,
+       (float)0.533813, (float)0.540924, (float)0.548004,
+       (float)0.555084, (float)0.562164, (float)0.569244,
+       (float)0.576294, (float)0.583313, (float)0.590332,
+       (float)0.597321, (float)0.604309, (float)0.611267,
+       (float)0.618195, (float)0.625092, (float)0.631989,
+       (float)0.638855, (float)0.645660, (float)0.652466,
+       (float)0.659241, (float)0.665985, (float)0.672668,
+       (float)0.679352, (float)0.685974, (float)0.692566,
+       (float)0.699127, (float)0.705658, (float)0.712128,
+       (float)0.718536, (float)0.724945, (float)0.731262,
+       (float)0.737549, (float)0.743805, (float)0.750000,
+       (float)0.756134, (float)0.762238, (float)0.768280,
+       (float)0.774261, (float)0.780182, (float)0.786072,
+       (float)0.791870, (float)0.797638, (float)0.803314,
+       (float)0.808960, (float)0.814514, (float)0.820038,
+       (float)0.825470, (float)0.830841, (float)0.836151,
+       (float)0.841400, (float)0.846558, (float)0.851654,
+       (float)0.856689, (float)0.861633, (float)0.866516,
+       (float)0.871338, (float)0.876068, (float)0.880737,
+       (float)0.885315, (float)0.889801, (float)0.894226,
+       (float)0.898560, (float)0.902832, (float)0.907013,
+       (float)0.911102, (float)0.915100, (float)0.919037,
+       (float)0.922882, (float)0.926636, (float)0.930328,
+       (float)0.933899, (float)0.937408, (float)0.940796,
+       (float)0.944122, (float)0.947357, (float)0.950470,
+       (float)0.953522, (float)0.956482, (float)0.959351,
+       (float)0.962097, (float)0.964783, (float)0.967377,
+       (float)0.969849, (float)0.972229, (float)0.974518,
+       (float)0.976715, (float)0.978821, (float)0.980835,
+       (float)0.982727, (float)0.984528, (float)0.986237,
+       (float)0.987854, (float)0.989380, (float)0.990784,
+       (float)0.992096, (float)0.993317, (float)0.994415,
+       (float)0.995422, (float)0.996338, (float)0.997162,
+       (float)0.997864, (float)0.998474, (float)0.998962,
+       (float)0.999390, (float)0.999695, (float)0.999878,
+       (float)0.999969, (float)0.999969, (float)0.996918,
+       (float)0.987701, (float)0.972382, (float)0.951050,
+       (float)0.923889, (float)0.891022, (float)0.852631,
+       (float)0.809021, (float)0.760406, (float)0.707092,
+       (float)0.649445, (float)0.587799, (float)0.522491,
+       (float)0.453979, (float)0.382690, (float)0.309021,
+       (float)0.233459, (float)0.156433, (float)0.078461
+   };
+   
+   
+   
+   /* Lag window for LPC */
+   float lpc_lagwinTbl[LPC_FILTERORDER + 1]={
+       (float)1.000100, (float)0.998890, (float)0.995569,
+           (float)0.990057, (float)0.982392,
+       (float)0.972623, (float)0.960816, (float)0.947047,
+           (float)0.931405, (float)0.913989, (float)0.894909};
+   
+   /* LSF quantization*/
+   float lsfCbTbl[64 * 3 + 128 * 3 + 128 * 4] = {
+   (float)0.155396, (float)0.273193, (float)0.451172,
+   (float)0.390503, (float)0.648071, (float)1.002075,
+   (float)0.440186, (float)0.692261, (float)0.955688,
+   (float)0.343628, (float)0.642334, (float)1.071533,
+   (float)0.318359, (float)0.491577, (float)0.670532,
+   (float)0.193115, (float)0.375488, (float)0.725708,
+   (float)0.364136, (float)0.510376, (float)0.658691,
+   (float)0.297485, (float)0.527588, (float)0.842529,
+   (float)0.227173, (float)0.365967, (float)0.563110,
+   (float)0.244995, (float)0.396729, (float)0.636475,
+   (float)0.169434, (float)0.300171, (float)0.520264,
+   (float)0.312866, (float)0.464478, (float)0.643188,
+   (float)0.248535, (float)0.429932, (float)0.626099,
+   (float)0.236206, (float)0.491333, (float)0.817139,
+   (float)0.334961, (float)0.625122, (float)0.895752,
+   (float)0.343018, (float)0.518555, (float)0.698608,
+   (float)0.372803, (float)0.659790, (float)0.945435,
+   (float)0.176880, (float)0.316528, (float)0.581421,
+   (float)0.416382, (float)0.625977, (float)0.805176,
+   (float)0.303223, (float)0.568726, (float)0.915039,
+   (float)0.203613, (float)0.351440, (float)0.588135,
+   (float)0.221191, (float)0.375000, (float)0.614746,
+   (float)0.199951, (float)0.323364, (float)0.476074,
+   (float)0.300781, (float)0.433350, (float)0.566895,
+   (float)0.226196, (float)0.354004, (float)0.507568,
+   (float)0.300049, (float)0.508179, (float)0.711670,
+   (float)0.312012, (float)0.492676, (float)0.763428,
+   (float)0.329956, (float)0.541016, (float)0.795776,
+   (float)0.373779, (float)0.604614, (float)0.928833,
+   (float)0.210571, (float)0.452026, (float)0.755249,
+   (float)0.271118, (float)0.473267, (float)0.662476,
+   (float)0.285522, (float)0.436890, (float)0.634399,
+   (float)0.246704, (float)0.565552, (float)0.859009,
+   (float)0.270508, (float)0.406250, (float)0.553589,
+   (float)0.361450, (float)0.578491, (float)0.813843,
+   (float)0.342651, (float)0.482788, (float)0.622437,
+   (float)0.340332, (float)0.549438, (float)0.743164,
+   (float)0.200439, (float)0.336304, (float)0.540894,
+   (float)0.407837, (float)0.644775, (float)0.895142,
+   (float)0.294678, (float)0.454834, (float)0.699097,
+   (float)0.193115, (float)0.344482, (float)0.643188,
+   (float)0.275757, (float)0.420776, (float)0.598755,
+   (float)0.380493, (float)0.608643, (float)0.861084,
+   (float)0.222778, (float)0.426147, (float)0.676514,
+   
+   
+   (float)0.407471, (float)0.700195, (float)1.053101,
+   (float)0.218384, (float)0.377197, (float)0.669922,
+   (float)0.313232, (float)0.454102, (float)0.600952,
+   (float)0.347412, (float)0.571533, (float)0.874146,
+   (float)0.238037, (float)0.405396, (float)0.729492,
+   (float)0.223877, (float)0.412964, (float)0.822021,
+   (float)0.395264, (float)0.582153, (float)0.743896,
+   (float)0.247925, (float)0.485596, (float)0.720581,
+   (float)0.229126, (float)0.496582, (float)0.907715,
+   (float)0.260132, (float)0.566895, (float)1.012695,
+   (float)0.337402, (float)0.611572, (float)0.978149,
+   (float)0.267822, (float)0.447632, (float)0.769287,
+   (float)0.250610, (float)0.381714, (float)0.530029,
+   (float)0.430054, (float)0.805054, (float)1.221924,
+   (float)0.382568, (float)0.544067, (float)0.701660,
+   (float)0.383545, (float)0.710327, (float)1.149170,
+   (float)0.271362, (float)0.529053, (float)0.775513,
+   (float)0.246826, (float)0.393555, (float)0.588623,
+   (float)0.266846, (float)0.422119, (float)0.676758,
+   (float)0.311523, (float)0.580688, (float)0.838623,
+   (float)1.331177, (float)1.576782, (float)1.779541,
+   (float)1.160034, (float)1.401978, (float)1.768188,
+   (float)1.161865, (float)1.525146, (float)1.715332,
+   (float)0.759521, (float)0.913940, (float)1.119873,
+   (float)0.947144, (float)1.121338, (float)1.282471,
+   (float)1.015015, (float)1.557007, (float)1.804932,
+   (float)1.172974, (float)1.402100, (float)1.692627,
+   (float)1.087524, (float)1.474243, (float)1.665405,
+   (float)0.899536, (float)1.105225, (float)1.406250,
+   (float)1.148438, (float)1.484741, (float)1.796265,
+   (float)0.785645, (float)1.209839, (float)1.567749,
+   (float)0.867798, (float)1.166504, (float)1.450684,
+   (float)0.922485, (float)1.229858, (float)1.420898,
+   (float)0.791260, (float)1.123291, (float)1.409546,
+   (float)0.788940, (float)0.966064, (float)1.340332,
+   (float)1.051147, (float)1.272827, (float)1.556641,
+   (float)0.866821, (float)1.181152, (float)1.538818,
+   (float)0.906738, (float)1.373535, (float)1.607910,
+   (float)1.244751, (float)1.581421, (float)1.933838,
+   (float)0.913940, (float)1.337280, (float)1.539673,
+   (float)0.680542, (float)0.959229, (float)1.662720,
+   (float)0.887207, (float)1.430542, (float)1.800781,
+   (float)0.912598, (float)1.433594, (float)1.683960,
+   (float)0.860474, (float)1.060303, (float)1.455322,
+   (float)1.005127, (float)1.381104, (float)1.706909,
+   (float)0.800781, (float)1.363892, (float)1.829102,
+   (float)0.781860, (float)1.124390, (float)1.505981,
+   (float)1.003662, (float)1.471436, (float)1.684692,
+   (float)0.981323, (float)1.309570, (float)1.618042,
+   (float)1.228760, (float)1.554321, (float)1.756470,
+   (float)0.734375, (float)0.895752, (float)1.225586,
+   (float)0.841797, (float)1.055664, (float)1.249268,
+   (float)0.920166, (float)1.119385, (float)1.486206,
+   (float)0.894409, (float)1.539063, (float)1.828979,
+   
+   
+   (float)1.283691, (float)1.543335, (float)1.858276,
+   (float)0.676025, (float)0.933105, (float)1.490845,
+   (float)0.821289, (float)1.491821, (float)1.739868,
+   (float)0.923218, (float)1.144653, (float)1.580566,
+   (float)1.057251, (float)1.345581, (float)1.635864,
+   (float)0.888672, (float)1.074951, (float)1.353149,
+   (float)0.942749, (float)1.195435, (float)1.505493,
+   (float)1.492310, (float)1.788086, (float)2.039673,
+   (float)1.070313, (float)1.634399, (float)1.860962,
+   (float)1.253296, (float)1.488892, (float)1.686035,
+   (float)0.647095, (float)0.864014, (float)1.401855,
+   (float)0.866699, (float)1.254883, (float)1.453369,
+   (float)1.063965, (float)1.532593, (float)1.731323,
+   (float)1.167847, (float)1.521484, (float)1.884033,
+   (float)0.956055, (float)1.502075, (float)1.745605,
+   (float)0.928711, (float)1.288574, (float)1.479614,
+   (float)1.088013, (float)1.380737, (float)1.570801,
+   (float)0.905029, (float)1.186768, (float)1.371948,
+   (float)1.057861, (float)1.421021, (float)1.617432,
+   (float)1.108276, (float)1.312500, (float)1.501465,
+   (float)0.979492, (float)1.416992, (float)1.624268,
+   (float)1.276001, (float)1.661011, (float)2.007935,
+   (float)0.993042, (float)1.168579, (float)1.331665,
+   (float)0.778198, (float)0.944946, (float)1.235962,
+   (float)1.223755, (float)1.491333, (float)1.815674,
+   (float)0.852661, (float)1.350464, (float)1.722290,
+   (float)1.134766, (float)1.593140, (float)1.787354,
+   (float)1.051392, (float)1.339722, (float)1.531006,
+   (float)0.803589, (float)1.271240, (float)1.652100,
+   (float)0.755737, (float)1.143555, (float)1.639404,
+   (float)0.700928, (float)0.837280, (float)1.130371,
+   (float)0.942749, (float)1.197876, (float)1.669800,
+   (float)0.993286, (float)1.378296, (float)1.566528,
+   (float)0.801025, (float)1.095337, (float)1.298950,
+   (float)0.739990, (float)1.032959, (float)1.383667,
+   (float)0.845703, (float)1.072266, (float)1.543823,
+   (float)0.915649, (float)1.072266, (float)1.224487,
+   (float)1.021973, (float)1.226196, (float)1.481323,
+   (float)0.999878, (float)1.204102, (float)1.555908,
+   (float)0.722290, (float)0.913940, (float)1.340210,
+   (float)0.673340, (float)0.835938, (float)1.259521,
+   (float)0.832397, (float)1.208374, (float)1.394165,
+   (float)0.962158, (float)1.576172, (float)1.912842,
+   (float)1.166748, (float)1.370850, (float)1.556763,
+   (float)0.946289, (float)1.138550, (float)1.400391,
+   (float)1.035034, (float)1.218262, (float)1.386475,
+   (float)1.393799, (float)1.717773, (float)2.000244,
+   (float)0.972656, (float)1.260986, (float)1.760620,
+   (float)1.028198, (float)1.288452, (float)1.484619,
+   (float)0.773560, (float)1.258057, (float)1.756714,
+   (float)1.080322, (float)1.328003, (float)1.742676,
+   (float)0.823975, (float)1.450806, (float)1.917725,
+   (float)0.859009, (float)1.016602, (float)1.191895,
+   (float)0.843994, (float)1.131104, (float)1.645020,
+   
+   
+   (float)1.189697, (float)1.702759, (float)1.894409,
+   (float)1.346680, (float)1.763184, (float)2.066040,
+   (float)0.980469, (float)1.253784, (float)1.441650,
+   (float)1.338135, (float)1.641968, (float)1.932739,
+   (float)1.223267, (float)1.424194, (float)1.626465,
+   (float)0.765747, (float)1.004150, (float)1.579102,
+   (float)1.042847, (float)1.269165, (float)1.647461,
+   (float)0.968750, (float)1.257568, (float)1.555786,
+   (float)0.826294, (float)0.993408, (float)1.275146,
+   (float)0.742310, (float)0.950439, (float)1.430542,
+   (float)1.054321, (float)1.439819, (float)1.828003,
+   (float)1.072998, (float)1.261719, (float)1.441895,
+   (float)0.859375, (float)1.036377, (float)1.314819,
+   (float)0.895752, (float)1.267212, (float)1.605591,
+   (float)0.805420, (float)0.962891, (float)1.142334,
+   (float)0.795654, (float)1.005493, (float)1.468506,
+   (float)1.105347, (float)1.313843, (float)1.584839,
+   (float)0.792236, (float)1.221802, (float)1.465698,
+   (float)1.170532, (float)1.467651, (float)1.664063,
+   (float)0.838257, (float)1.153198, (float)1.342163,
+   (float)0.968018, (float)1.198242, (float)1.391235,
+   (float)1.250122, (float)1.623535, (float)1.823608,
+   (float)0.711670, (float)1.058350, (float)1.512085,
+   (float)1.204834, (float)1.454468, (float)1.739136,
+   (float)1.137451, (float)1.421753, (float)1.620117,
+   (float)0.820435, (float)1.322754, (float)1.578247,
+   (float)0.798706, (float)1.005005, (float)1.213867,
+   (float)0.980713, (float)1.324951, (float)1.512939,
+   (float)1.112305, (float)1.438843, (float)1.735596,
+   (float)1.135498, (float)1.356689, (float)1.635742,
+   (float)1.101318, (float)1.387451, (float)1.686523,
+   (float)0.849854, (float)1.276978, (float)1.523438,
+   (float)1.377930, (float)1.627563, (float)1.858154,
+   (float)0.884888, (float)1.095459, (float)1.287476,
+   (float)1.289795, (float)1.505859, (float)1.756592,
+   (float)0.817505, (float)1.384155, (float)1.650513,
+   (float)1.446655, (float)1.702148, (float)1.931885,
+   (float)0.835815, (float)1.023071, (float)1.385376,
+   (float)0.916626, (float)1.139038, (float)1.335327,
+   (float)0.980103, (float)1.174072, (float)1.453735,
+   (float)1.705688, (float)2.153809, (float)2.398315, (float)2.743408,
+   (float)1.797119, (float)2.016846, (float)2.445679, (float)2.701904,
+   (float)1.990356, (float)2.219116, (float)2.576416, (float)2.813477,
+   (float)1.849365, (float)2.190918, (float)2.611572, (float)2.835083,
+   (float)1.657959, (float)1.854370, (float)2.159058, (float)2.726196,
+   (float)1.437744, (float)1.897705, (float)2.253174, (float)2.655396,
+   (float)2.028687, (float)2.247314, (float)2.542358, (float)2.875854,
+   (float)1.736938, (float)1.922119, (float)2.185913, (float)2.743408,
+   (float)1.521606, (float)1.870972, (float)2.526855, (float)2.786987,
+   (float)1.841431, (float)2.050659, (float)2.463623, (float)2.857666,
+   (float)1.590088, (float)2.067261, (float)2.427979, (float)2.794434,
+   (float)1.746826, (float)2.057373, (float)2.320190, (float)2.800781,
+   (float)1.734619, (float)1.940552, (float)2.306030, (float)2.826416,
+   (float)1.786255, (float)2.204468, (float)2.457520, (float)2.795288,
+   
+   
+   (float)1.861084, (float)2.170532, (float)2.414551, (float)2.763672,
+   (float)2.001465, (float)2.307617, (float)2.552734, (float)2.811890,
+   (float)1.784424, (float)2.124146, (float)2.381592, (float)2.645508,
+   (float)1.888794, (float)2.135864, (float)2.418579, (float)2.861206,
+   (float)2.301147, (float)2.531250, (float)2.724976, (float)2.913086,
+   (float)1.837769, (float)2.051270, (float)2.261963, (float)2.553223,
+   (float)2.012939, (float)2.221191, (float)2.440186, (float)2.678101,
+   (float)1.429565, (float)1.858276, (float)2.582275, (float)2.845703,
+   (float)1.622803, (float)1.897705, (float)2.367310, (float)2.621094,
+   (float)1.581543, (float)1.960449, (float)2.515869, (float)2.736450,
+   (float)1.419434, (float)1.933960, (float)2.394653, (float)2.746704,
+   (float)1.721924, (float)2.059570, (float)2.421753, (float)2.769653,
+   (float)1.911011, (float)2.220703, (float)2.461060, (float)2.740723,
+   (float)1.581177, (float)1.860840, (float)2.516968, (float)2.874634,
+   (float)1.870361, (float)2.098755, (float)2.432373, (float)2.656494,
+   (float)2.059692, (float)2.279785, (float)2.495605, (float)2.729370,
+   (float)1.815674, (float)2.181519, (float)2.451538, (float)2.680542,
+   (float)1.407959, (float)1.768311, (float)2.343018, (float)2.668091,
+   (float)2.168701, (float)2.394653, (float)2.604736, (float)2.829346,
+   (float)1.636230, (float)1.865723, (float)2.329102, (float)2.824219,
+   (float)1.878906, (float)2.139526, (float)2.376709, (float)2.679810,
+   (float)1.765381, (float)1.971802, (float)2.195435, (float)2.586914,
+   (float)2.164795, (float)2.410889, (float)2.673706, (float)2.903198,
+   (float)2.071899, (float)2.331055, (float)2.645874, (float)2.907104,
+   (float)2.026001, (float)2.311523, (float)2.594849, (float)2.863892,
+   (float)1.948975, (float)2.180786, (float)2.514893, (float)2.797852,
+   (float)1.881836, (float)2.130859, (float)2.478149, (float)2.804199,
+   (float)2.238159, (float)2.452759, (float)2.652832, (float)2.868286,
+   (float)1.897949, (float)2.101685, (float)2.524292, (float)2.880127,
+   (float)1.856445, (float)2.074585, (float)2.541016, (float)2.791748,
+   (float)1.695557, (float)2.199097, (float)2.506226, (float)2.742676,
+   (float)1.612671, (float)1.877075, (float)2.435425, (float)2.732910,
+   (float)1.568848, (float)1.786499, (float)2.194580, (float)2.768555,
+   (float)1.953369, (float)2.164551, (float)2.486938, (float)2.874023,
+   (float)1.388306, (float)1.725342, (float)2.384521, (float)2.771851,
+   (float)2.115356, (float)2.337769, (float)2.592896, (float)2.864014,
+   (float)1.905762, (float)2.111328, (float)2.363525, (float)2.789307,
+   (float)1.882568, (float)2.332031, (float)2.598267, (float)2.827637,
+   (float)1.683594, (float)2.088745, (float)2.361938, (float)2.608643,
+   (float)1.874023, (float)2.182129, (float)2.536133, (float)2.766968,
+   (float)1.861938, (float)2.070435, (float)2.309692, (float)2.700562,
+   (float)1.722168, (float)2.107422, (float)2.477295, (float)2.837646,
+   (float)1.926880, (float)2.184692, (float)2.442627, (float)2.663818,
+   (float)2.123901, (float)2.337280, (float)2.553101, (float)2.777466,
+   (float)1.588135, (float)1.911499, (float)2.212769, (float)2.543945,
+   (float)2.053955, (float)2.370850, (float)2.712158, (float)2.939941,
+   (float)2.210449, (float)2.519653, (float)2.770386, (float)2.958618,
+   (float)2.199463, (float)2.474731, (float)2.718262, (float)2.919922,
+   (float)1.960083, (float)2.175415, (float)2.608032, (float)2.888794,
+   (float)1.953735, (float)2.185181, (float)2.428223, (float)2.809570,
+   (float)1.615234, (float)2.036499, (float)2.576538, (float)2.834595,
+   (float)1.621094, (float)2.028198, (float)2.431030, (float)2.664673,
+   (float)1.824951, (float)2.267456, (float)2.514526, (float)2.747925,
+   (float)1.994263, (float)2.229126, (float)2.475220, (float)2.833984,
+   
+   
+   (float)1.746338, (float)2.011353, (float)2.588257, (float)2.826904,
+   (float)1.562866, (float)2.135986, (float)2.471680, (float)2.687256,
+   (float)1.748901, (float)2.083496, (float)2.460938, (float)2.686279,
+   (float)1.758057, (float)2.131470, (float)2.636597, (float)2.891602,
+   (float)2.071289, (float)2.299072, (float)2.550781, (float)2.814331,
+   (float)1.839600, (float)2.094360, (float)2.496460, (float)2.723999,
+   (float)1.882202, (float)2.088257, (float)2.636841, (float)2.923096,
+   (float)1.957886, (float)2.153198, (float)2.384399, (float)2.615234,
+   (float)1.992920, (float)2.351196, (float)2.654419, (float)2.889771,
+   (float)2.012817, (float)2.262451, (float)2.643799, (float)2.903076,
+   (float)2.025635, (float)2.254761, (float)2.508423, (float)2.784058,
+   (float)2.316040, (float)2.589355, (float)2.794189, (float)2.963623,
+   (float)1.741211, (float)2.279541, (float)2.578491, (float)2.816284,
+   (float)1.845337, (float)2.055786, (float)2.348511, (float)2.822021,
+   (float)1.679932, (float)1.926514, (float)2.499756, (float)2.835693,
+   (float)1.722534, (float)1.946899, (float)2.448486, (float)2.728760,
+   (float)1.829834, (float)2.043213, (float)2.580444, (float)2.867676,
+   (float)1.676636, (float)2.071655, (float)2.322510, (float)2.704834,
+   (float)1.791504, (float)2.113525, (float)2.469727, (float)2.784058,
+   (float)1.977051, (float)2.215088, (float)2.497437, (float)2.726929,
+   (float)1.800171, (float)2.106689, (float)2.357788, (float)2.738892,
+   (float)1.827759, (float)2.170166, (float)2.525879, (float)2.852417,
+   (float)1.918335, (float)2.132813, (float)2.488403, (float)2.728149,
+   (float)1.916748, (float)2.225098, (float)2.542603, (float)2.857666,
+   (float)1.761230, (float)1.976074, (float)2.507446, (float)2.884521,
+   (float)2.053711, (float)2.367432, (float)2.608032, (float)2.837646,
+   (float)1.595337, (float)2.000977, (float)2.307129, (float)2.578247,
+   (float)1.470581, (float)2.031250, (float)2.375854, (float)2.647583,
+   (float)1.801392, (float)2.128052, (float)2.399780, (float)2.822876,
+   (float)1.853638, (float)2.066650, (float)2.429199, (float)2.751465,
+   (float)1.956299, (float)2.163696, (float)2.394775, (float)2.734253,
+   (float)1.963623, (float)2.275757, (float)2.585327, (float)2.865234,
+   (float)1.887451, (float)2.105469, (float)2.331787, (float)2.587402,
+   (float)2.120117, (float)2.443359, (float)2.733887, (float)2.941406,
+   (float)1.506348, (float)1.766968, (float)2.400513, (float)2.851807,
+   (float)1.664551, (float)1.981079, (float)2.375732, (float)2.774414,
+   (float)1.720703, (float)1.978882, (float)2.391479, (float)2.640991,
+   (float)1.483398, (float)1.814819, (float)2.434448, (float)2.722290,
+   (float)1.769043, (float)2.136597, (float)2.563721, (float)2.774414,
+   (float)1.810791, (float)2.049316, (float)2.373901, (float)2.613647,
+   (float)1.788330, (float)2.005981, (float)2.359131, (float)2.723145,
+   (float)1.785156, (float)1.993164, (float)2.399780, (float)2.832520,
+   (float)1.695313, (float)2.022949, (float)2.522583, (float)2.745117,
+   (float)1.584106, (float)1.965576, (float)2.299927, (float)2.715576,
+   (float)1.894897, (float)2.249878, (float)2.655884, (float)2.897705,
+   (float)1.720581, (float)1.995728, (float)2.299438, (float)2.557007,
+   (float)1.619385, (float)2.173950, (float)2.574219, (float)2.787964,
+   (float)1.883179, (float)2.220459, (float)2.474365, (float)2.825073,
+   (float)1.447632, (float)2.045044, (float)2.555542, (float)2.744873,
+   (float)1.502686, (float)2.156616, (float)2.653320, (float)2.846558,
+   (float)1.711548, (float)1.944092, (float)2.282959, (float)2.685791,
+   (float)1.499756, (float)1.867554, (float)2.341064, (float)2.578857,
+   (float)1.916870, (float)2.135132, (float)2.568237, (float)2.826050,
+   (float)1.498047, (float)1.711182, (float)2.223267, (float)2.755127,
+   
+   
+   (float)1.808716, (float)1.997559, (float)2.256470, (float)2.758545,
+   (float)2.088501, (float)2.402710, (float)2.667358, (float)2.890259,
+   (float)1.545044, (float)1.819214, (float)2.324097, (float)2.692993,
+   (float)1.796021, (float)2.012573, (float)2.505737, (float)2.784912,
+   (float)1.786499, (float)2.041748, (float)2.290405, (float)2.650757,
+   (float)1.938232, (float)2.264404, (float)2.529053, (float)2.796143
+   };
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/constants.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/constants.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/constants.h	Fri Sep 21 14:49:14 2007
@@ -1,74 +1,74 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       constants.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_CONSTANTS_H
-   #define __iLBC_CONSTANTS_H
-   
-   #include "iLBC_define.h"
-   
-   
-   /* ULP bit allocation */
-   
-   extern const iLBC_ULP_Inst_t ULP_20msTbl;
-   extern const iLBC_ULP_Inst_t ULP_30msTbl;
-   
-   /* high pass filters */
-   
-   extern float hpi_zero_coefsTbl[];
-   extern float hpi_pole_coefsTbl[];
-   extern float hpo_zero_coefsTbl[];
-   extern float hpo_pole_coefsTbl[];  
-   
-   /* low pass filters */
-   extern float lpFilt_coefsTbl[];
-   
-   /* LPC analysis and quantization */
-   
-   extern float lpc_winTbl[];
-   extern float lpc_asymwinTbl[];
-   extern float lpc_lagwinTbl[];
-   extern float lsfCbTbl[];
-   extern float lsfmeanTbl[];
-   extern int   dim_lsfCbTbl[];
-   extern int   size_lsfCbTbl[];
-   extern float lsf_weightTbl_30ms[]; 
-   extern float lsf_weightTbl_20ms[];
-   
-   /* state quantization tables */
-   
-   extern float state_sq3Tbl[];
-   extern float state_frgqTbl[];
-   
-   /* gain quantization tables */
-   
-   extern float gain_sq3Tbl[];
-   extern float gain_sq4Tbl[];
-   extern float gain_sq5Tbl[];
-   
-   /* adaptive codebook definitions */
-   
-   extern int search_rangeTbl[5][CB_NSTAGES];
-   extern int memLfTbl[];
-   extern int stMemLTbl;
-   extern float cbfiltersTbl[CB_FILTERLEN];
-   
-   
-   
-   /* enhancer definitions */
-   
-   extern float polyphaserTbl[];
-   extern float enh_plocsTbl[];
-   
-   #endif
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       constants.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_CONSTANTS_H
+   #define __iLBC_CONSTANTS_H
+   
+   #include "iLBC_define.h"
+   
+   
+   /* ULP bit allocation */
+   
+   extern const iLBC_ULP_Inst_t ULP_20msTbl;
+   extern const iLBC_ULP_Inst_t ULP_30msTbl;
+   
+   /* high pass filters */
+   
+   extern float hpi_zero_coefsTbl[];
+   extern float hpi_pole_coefsTbl[];
+   extern float hpo_zero_coefsTbl[];
+   extern float hpo_pole_coefsTbl[];  
+   
+   /* low pass filters */
+   extern float lpFilt_coefsTbl[];
+   
+   /* LPC analysis and quantization */
+   
+   extern float lpc_winTbl[];
+   extern float lpc_asymwinTbl[];
+   extern float lpc_lagwinTbl[];
+   extern float lsfCbTbl[];
+   extern float lsfmeanTbl[];
+   extern int   dim_lsfCbTbl[];
+   extern int   size_lsfCbTbl[];
+   extern float lsf_weightTbl_30ms[]; 
+   extern float lsf_weightTbl_20ms[];
+   
+   /* state quantization tables */
+   
+   extern float state_sq3Tbl[];
+   extern float state_frgqTbl[];
+   
+   /* gain quantization tables */
+   
+   extern float gain_sq3Tbl[];
+   extern float gain_sq4Tbl[];
+   extern float gain_sq5Tbl[];
+   
+   /* adaptive codebook definitions */
+   
+   extern int search_rangeTbl[5][CB_NSTAGES];
+   extern int memLfTbl[];
+   extern int stMemLTbl;
+   extern float cbfiltersTbl[CB_FILTERLEN];
+   
+   
+   
+   /* enhancer definitions */
+   
+   extern float polyphaserTbl[];
+   extern float enh_plocsTbl[];
+   
+   #endif
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/createCB.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/createCB.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/createCB.c	Fri Sep 21 14:49:14 2007
@@ -1,215 +1,215 @@
-   
-   
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       createCB.c
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include "iLBC_define.h"
-   #include "constants.h"
-   #include <string.h>
-   #include <math.h>
-   
-   /*----------------------------------------------------------------*
-    *  Construct an additional codebook vector by filtering the
-    *  initial codebook buffer. This vector is then used to expand
-    *  the codebook with an additional section.
-    *---------------------------------------------------------------*/
-   
-   void filteredCBvecs(
-       float *cbvectors,   /* (o) Codebook vectors for the 
-                                  higher section */
-       float *mem,         /* (i) Buffer to create codebook 
-                                  vector from */
-       int lMem        /* (i) Length of buffer */
-   ){
-       int j, k;
-       float *pp, *pp1;
-       float tempbuff2[CB_MEML+CB_FILTERLEN];
-       float *pos;
-   
-       memset(tempbuff2, 0, (CB_HALFFILTERLEN-1)*sizeof(float));
-       memcpy(&tempbuff2[CB_HALFFILTERLEN-1], mem, lMem*sizeof(float));
-       memset(&tempbuff2[lMem+CB_HALFFILTERLEN-1], 0, 
-           (CB_HALFFILTERLEN+1)*sizeof(float));
-   
-       /* Create codebook vector for higher section by filtering */
-   
-       /* do filtering */
-       pos=cbvectors;
-       memset(pos, 0, lMem*sizeof(float));
-       for (k=0; k<lMem; k++) {
-           pp=&tempbuff2[k];
-           pp1=&cbfiltersTbl[CB_FILTERLEN-1];
-           for (j=0;j<CB_FILTERLEN;j++) {
-               (*pos)+=(*pp++)*(*pp1--);
-           }
-           pos++;
-       }
-   }
-   
-   
-   
-   /*----------------------------------------------------------------*
-    *  Search the augmented part of the codebook to find the best
-    *  measure.
-    *----------------------------------------------------------------*/
-   
-   void searchAugmentedCB(
-       int low,        /* (i) Start index for the search */
-       int high,           /* (i) End index for the search */
-       int stage,          /* (i) Current stage */
-       int startIndex,     /* (i) Codebook index for the first 
-                                  aug vector */
-       float *target,      /* (i) Target vector for encoding */
-       float *buffer,      /* (i) Pointer to the end of the buffer for
-                                  augmented codebook construction */
-       float *max_measure, /* (i/o) Currently maximum measure */
-       int *best_index,/* (o) Currently the best index */
-       float *gain,    /* (o) Currently the best gain */
-       float *energy,      /* (o) Energy of augmented codebook 
-                                  vectors */
-       float *invenergy/* (o) Inv energy of augmented codebook 
-                                  vectors */
-   ) {
-       int icount, ilow, j, tmpIndex;
-       float *pp, *ppo, *ppi, *ppe, crossDot, alfa; 
-       float weighted, measure, nrjRecursive;
-       float ftmp;
-   
-       /* Compute the energy for the first (low-5) 
-          noninterpolated samples */
-       nrjRecursive = (float) 0.0;
-       pp = buffer - low + 1;
-       for (j=0; j<(low-5); j++) {
-           nrjRecursive += ( (*pp)*(*pp) );
-           pp++;
-       }
-       ppe = buffer - low;
-   
-   
-       for (icount=low; icount<=high; icount++) {
-   
-           /* Index of the codebook vector used for retrieving 
-              energy values */
-           tmpIndex = startIndex+icount-20;
-   
-           ilow = icount-4;
-               
-           /* Update the energy recursively to save complexity */
-           nrjRecursive = nrjRecursive + (*ppe)*(*ppe);
-           ppe--;
-           energy[tmpIndex] = nrjRecursive;
-   
-           /* Compute cross dot product for the first (low-5) 
-              samples */
-           crossDot = (float) 0.0;
-   
-   
-           pp = buffer-icount;
-           for (j=0; j<ilow; j++) {
-               crossDot += target[j]*(*pp++);
-           }
-   
-           /* interpolation */
-           alfa = (float) 0.2;
-           ppo = buffer-4;
-           ppi = buffer-icount-4;
-           for (j=ilow; j<icount; j++) {
-               weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi);
-               ppo++;
-               ppi++;
-               energy[tmpIndex] += weighted*weighted;
-               crossDot += target[j]*weighted;
-               alfa += (float)0.2;
-           }
-   
-           /* Compute energy and cross dot product for the 
-              remaining samples */
-           pp = buffer - icount;
-           for (j=icount; j<SUBL; j++) {
-               energy[tmpIndex] += (*pp)*(*pp);
-               crossDot += target[j]*(*pp++);
-           }
-           
-           if (energy[tmpIndex]>0.0) {
-               invenergy[tmpIndex]=(float)1.0/(energy[tmpIndex]+EPS);
-           } else {
-               invenergy[tmpIndex] = (float) 0.0;
-           }
-           
-           if (stage==0) {
-               measure = (float)-10000000.0;
-               
-               if (crossDot > 0.0) {
-                   measure = crossDot*crossDot*invenergy[tmpIndex];
-               }
-           }
-           else {
-               measure = crossDot*crossDot*invenergy[tmpIndex];
-           }
-       
-           /* check if measure is better */
-           ftmp = crossDot*invenergy[tmpIndex];
-           
-           if ((measure>*max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
-               *best_index = tmpIndex;
-               *max_measure = measure;
-               *gain = ftmp;
-           }
-       }
-   }
-   
-   
-   
-   
-   /*----------------------------------------------------------------*
-    *  Recreate a specific codebook vector from the augmented part.
-    *
-    *----------------------------------------------------------------*/
-   
-   void createAugmentedVec(
-       int index,      /* (i) Index for the augmented vector 
-                              to be created */
-       float *buffer,  /* (i) Pointer to the end of the buffer for
-                              augmented codebook construction */
-       float *cbVec/* (o) The construced codebook vector */
-   ) {
-       int ilow, j;
-       float *pp, *ppo, *ppi, alfa, alfa1, weighted;
-   
-       ilow = index-5;
-               
-       /* copy the first noninterpolated part */
-   
-       pp = buffer-index;
-       memcpy(cbVec,pp,sizeof(float)*index);
-   
-       /* interpolation */
-   
-       alfa1 = (float)0.2;
-       alfa = 0.0;
-       ppo = buffer-5;
-       ppi = buffer-index-5;
-       for (j=ilow; j<index; j++) {
-           weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi);
-           ppo++;
-           ppi++;
-           cbVec[j] = weighted;
-           alfa += alfa1;
-       }
-   
-       /* copy the second noninterpolated part */
-   
-       pp = buffer - index;
-       memcpy(cbVec+index,pp,sizeof(float)*(SUBL-index));
-   }
-   
-   
+   
+   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       createCB.c
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include "iLBC_define.h"
+   #include "constants.h"
+   #include <string.h>
+   #include <math.h>
+   
+   /*----------------------------------------------------------------*
+    *  Construct an additional codebook vector by filtering the
+    *  initial codebook buffer. This vector is then used to expand
+    *  the codebook with an additional section.
+    *---------------------------------------------------------------*/
+   
+   void filteredCBvecs(
+       float *cbvectors,   /* (o) Codebook vectors for the 
+                                  higher section */
+       float *mem,         /* (i) Buffer to create codebook 
+                                  vector from */
+       int lMem        /* (i) Length of buffer */
+   ){
+       int j, k;
+       float *pp, *pp1;
+       float tempbuff2[CB_MEML+CB_FILTERLEN];
+       float *pos;
+   
+       memset(tempbuff2, 0, (CB_HALFFILTERLEN-1)*sizeof(float));
+       memcpy(&tempbuff2[CB_HALFFILTERLEN-1], mem, lMem*sizeof(float));
+       memset(&tempbuff2[lMem+CB_HALFFILTERLEN-1], 0, 
+           (CB_HALFFILTERLEN+1)*sizeof(float));
+   
+       /* Create codebook vector for higher section by filtering */
+   
+       /* do filtering */
+       pos=cbvectors;
+       memset(pos, 0, lMem*sizeof(float));
+       for (k=0; k<lMem; k++) {
+           pp=&tempbuff2[k];
+           pp1=&cbfiltersTbl[CB_FILTERLEN-1];
+           for (j=0;j<CB_FILTERLEN;j++) {
+               (*pos)+=(*pp++)*(*pp1--);
+           }
+           pos++;
+       }
+   }
+   
+   
+   
+   /*----------------------------------------------------------------*
+    *  Search the augmented part of the codebook to find the best
+    *  measure.
+    *----------------------------------------------------------------*/
+   
+   void searchAugmentedCB(
+       int low,        /* (i) Start index for the search */
+       int high,           /* (i) End index for the search */
+       int stage,          /* (i) Current stage */
+       int startIndex,     /* (i) Codebook index for the first 
+                                  aug vector */
+       float *target,      /* (i) Target vector for encoding */
+       float *buffer,      /* (i) Pointer to the end of the buffer for
+                                  augmented codebook construction */
+       float *max_measure, /* (i/o) Currently maximum measure */
+       int *best_index,/* (o) Currently the best index */
+       float *gain,    /* (o) Currently the best gain */
+       float *energy,      /* (o) Energy of augmented codebook 
+                                  vectors */
+       float *invenergy/* (o) Inv energy of augmented codebook 
+                                  vectors */
+   ) {
+       int icount, ilow, j, tmpIndex;
+       float *pp, *ppo, *ppi, *ppe, crossDot, alfa; 
+       float weighted, measure, nrjRecursive;
+       float ftmp;
+   
+       /* Compute the energy for the first (low-5) 
+          noninterpolated samples */
+       nrjRecursive = (float) 0.0;
+       pp = buffer - low + 1;
+       for (j=0; j<(low-5); j++) {
+           nrjRecursive += ( (*pp)*(*pp) );
+           pp++;
+       }
+       ppe = buffer - low;
+   
+   
+       for (icount=low; icount<=high; icount++) {
+   
+           /* Index of the codebook vector used for retrieving 
+              energy values */
+           tmpIndex = startIndex+icount-20;
+   
+           ilow = icount-4;
+               
+           /* Update the energy recursively to save complexity */
+           nrjRecursive = nrjRecursive + (*ppe)*(*ppe);
+           ppe--;
+           energy[tmpIndex] = nrjRecursive;
+   
+           /* Compute cross dot product for the first (low-5) 
+              samples */
+           crossDot = (float) 0.0;
+   
+   
+           pp = buffer-icount;
+           for (j=0; j<ilow; j++) {
+               crossDot += target[j]*(*pp++);
+           }
+   
+           /* interpolation */
+           alfa = (float) 0.2;
+           ppo = buffer-4;
+           ppi = buffer-icount-4;
+           for (j=ilow; j<icount; j++) {
+               weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi);
+               ppo++;
+               ppi++;
+               energy[tmpIndex] += weighted*weighted;
+               crossDot += target[j]*weighted;
+               alfa += (float)0.2;
+           }
+   
+           /* Compute energy and cross dot product for the 
+              remaining samples */
+           pp = buffer - icount;
+           for (j=icount; j<SUBL; j++) {
+               energy[tmpIndex] += (*pp)*(*pp);
+               crossDot += target[j]*(*pp++);
+           }
+           
+           if (energy[tmpIndex]>0.0) {
+               invenergy[tmpIndex]=(float)1.0/(energy[tmpIndex]+EPS);
+           } else {
+               invenergy[tmpIndex] = (float) 0.0;
+           }
+           
+           if (stage==0) {
+               measure = (float)-10000000.0;
+               
+               if (crossDot > 0.0) {
+                   measure = crossDot*crossDot*invenergy[tmpIndex];
+               }
+           }
+           else {
+               measure = crossDot*crossDot*invenergy[tmpIndex];
+           }
+       
+           /* check if measure is better */
+           ftmp = crossDot*invenergy[tmpIndex];
+           
+           if ((measure>*max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
+               *best_index = tmpIndex;
+               *max_measure = measure;
+               *gain = ftmp;
+           }
+       }
+   }
+   
+   
+   
+   
+   /*----------------------------------------------------------------*
+    *  Recreate a specific codebook vector from the augmented part.
+    *
+    *----------------------------------------------------------------*/
+   
+   void createAugmentedVec(
+       int index,      /* (i) Index for the augmented vector 
+                              to be created */
+       float *buffer,  /* (i) Pointer to the end of the buffer for
+                              augmented codebook construction */
+       float *cbVec/* (o) The construced codebook vector */
+   ) {
+       int ilow, j;
+       float *pp, *ppo, *ppi, alfa, alfa1, weighted;
+   
+       ilow = index-5;
+               
+       /* copy the first noninterpolated part */
+   
+       pp = buffer-index;
+       memcpy(cbVec,pp,sizeof(float)*index);
+   
+       /* interpolation */
+   
+       alfa1 = (float)0.2;
+       alfa = 0.0;
+       ppo = buffer-5;
+       ppi = buffer-index-5;
+       for (j=ilow; j<index; j++) {
+           weighted = ((float)1.0-alfa)*(*ppo)+alfa*(*ppi);
+           ppo++;
+           ppi++;
+           cbVec[j] = weighted;
+           alfa += alfa1;
+       }
+   
+       /* copy the second noninterpolated part */
+   
+       pp = buffer - index;
+       memcpy(cbVec+index,pp,sizeof(float)*(SUBL-index));
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/createCB.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/createCB.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/createCB.h	Fri Sep 21 14:49:14 2007
@@ -1,56 +1,56 @@
-   
-   /******************************************************************
-   
-   
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       createCB.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_CREATECB_H
-   #define __iLBC_CREATECB_H
-   
-   void filteredCBvecs(
-       float *cbvectors,   /* (o) Codebook vector for the 
-                                  higher section */
-       float *mem,         /* (i) Buffer to create codebook 
-                                  vectors from */
-       int lMem        /* (i) Length of buffer */
-   );
-   
-   void searchAugmentedCB(
-       int low,        /* (i) Start index for the search */
-       int high,           /* (i) End index for the search */
-       int stage,          /* (i) Current stage */
-       int startIndex,     /* (i) CB index for the first 
-                                  augmented vector */
-       float *target,      /* (i) Target vector for encoding */
-       float *buffer,      /* (i) Pointer to the end of the 
-                                  buffer for augmented codebook 
-                                  construction */
-       float *max_measure, /* (i/o) Currently maximum measure */
-       int *best_index,/* (o) Currently the best index */
-       float *gain,    /* (o) Currently the best gain */
-       float *energy,      /* (o) Energy of augmented 
-                                  codebook vectors */
-       float *invenergy/* (o) Inv energy of aug codebook 
-                                  vectors */
-   );
-   
-   void createAugmentedVec(
-       int index,          /* (i) Index for the aug vector 
-                                  to be created */
-       float *buffer,      /* (i) Pointer to the end of the 
-                                  buffer for augmented codebook 
-                                  construction */
-       float *cbVec    /* (o) The construced codebook vector */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+   
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       createCB.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_CREATECB_H
+   #define __iLBC_CREATECB_H
+   
+   void filteredCBvecs(
+       float *cbvectors,   /* (o) Codebook vector for the 
+                                  higher section */
+       float *mem,         /* (i) Buffer to create codebook 
+                                  vectors from */
+       int lMem        /* (i) Length of buffer */
+   );
+   
+   void searchAugmentedCB(
+       int low,        /* (i) Start index for the search */
+       int high,           /* (i) End index for the search */
+       int stage,          /* (i) Current stage */
+       int startIndex,     /* (i) CB index for the first 
+                                  augmented vector */
+       float *target,      /* (i) Target vector for encoding */
+       float *buffer,      /* (i) Pointer to the end of the 
+                                  buffer for augmented codebook 
+                                  construction */
+       float *max_measure, /* (i/o) Currently maximum measure */
+       int *best_index,/* (o) Currently the best index */
+       float *gain,    /* (o) Currently the best gain */
+       float *energy,      /* (o) Energy of augmented 
+                                  codebook vectors */
+       float *invenergy/* (o) Inv energy of aug codebook 
+                                  vectors */
+   );
+   
+   void createAugmentedVec(
+       int index,          /* (i) Index for the aug vector 
+                                  to be created */
+       float *buffer,      /* (i) Pointer to the end of the 
+                                  buffer for augmented codebook 
+                                  construction */
+       float *cbVec    /* (o) The construced codebook vector */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/doCPLC.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/doCPLC.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/doCPLC.c	Fri Sep 21 14:49:14 2007
@@ -1,258 +1,258 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       doCPLC.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <string.h>
-   #include <stdio.h>
-   
-   #include "iLBC_define.h"
-   
-   /*----------------------------------------------------------------*
-    *  Compute cross correlation and pitch gain for pitch prediction
-    *  of last subframe at given lag.
-    *---------------------------------------------------------------*/
-   
-   void compCorr(
-       float *cc,      /* (o) cross correlation coefficient */
-       float *gc,      /* (o) gain */
-       float *pm,
-       float *buffer,  /* (i) signal buffer */
-       int lag,    /* (i) pitch lag */
-       int bLen,       /* (i) length of buffer */
-       int sRange      /* (i) correlation search length */
-   ){
-   
-   
-       int i;
-       float ftmp1, ftmp2, ftmp3;
-   
-       /* Guard against getting outside buffer */
-       if ((bLen-sRange-lag)<0) {
-           sRange=bLen-lag;
-       }
-   
-       ftmp1 = 0.0;
-       ftmp2 = 0.0;
-       ftmp3 = 0.0;
-       for (i=0; i<sRange; i++) {
-           ftmp1 += buffer[bLen-sRange+i] *
-               buffer[bLen-sRange+i-lag];
-           ftmp2 += buffer[bLen-sRange+i-lag] * 
-                   buffer[bLen-sRange+i-lag];
-           ftmp3 += buffer[bLen-sRange+i] * 
-                   buffer[bLen-sRange+i];
-       }
-   
-       if (ftmp2 > 0.0) {
-           *cc = ftmp1*ftmp1/ftmp2;
-           *gc = (float)fabs(ftmp1/ftmp2);
-           *pm=(float)fabs(ftmp1)/
-               ((float)sqrt(ftmp2)*(float)sqrt(ftmp3));
-       }
-       else {
-           *cc = 0.0;
-           *gc = 0.0;
-           *pm=0.0;
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  Packet loss concealment routine. Conceals a residual signal
-    *  and LP parameters. If no packet loss, update state.
-    *---------------------------------------------------------------*/
-   
-   void doThePLC(
-       float *PLCresidual, /* (o) concealed residual */ 
-       float *PLClpc,      /* (o) concealed LP parameters */  
-       int PLI,        /* (i) packet loss indicator 
-                                  0 - no PL, 1 = PL */ 
-       float *decresidual, /* (i) decoded residual */
-       float *lpc,         /* (i) decoded LPC (only used for no PL) */
-       int inlag,          /* (i) pitch lag */
-       iLBC_Dec_Inst_t *iLBCdec_inst 
-                           /* (i/o) decoder instance */
-   ){
-       int lag=20, randlag;
-       float gain, maxcc;
-       float use_gain;
-       float gain_comp, maxcc_comp, per, max_per;
-       int i, pick, use_lag;
-   
-   
-       float ftmp, randvec[BLOCKL_MAX], pitchfact, energy;
-               
-       /* Packet Loss */
-   
-       if (PLI == 1) {
-           
-           iLBCdec_inst->consPLICount += 1;
-           
-           /* if previous frame not lost, 
-              determine pitch pred. gain */
-           
-           if (iLBCdec_inst->prevPLI != 1) {
-   
-               /* Search around the previous lag to find the 
-                  best pitch period */
-               
-               lag=inlag-3;
-               compCorr(&maxcc, &gain, &max_per, 
-                   iLBCdec_inst->prevResidual,
-                   lag, iLBCdec_inst->blockl, 60);
-               for (i=inlag-2;i<=inlag+3;i++) {
-                   compCorr(&maxcc_comp, &gain_comp, &per,
-                       iLBCdec_inst->prevResidual,
-                       i, iLBCdec_inst->blockl, 60);
-                   
-                   if (maxcc_comp>maxcc) {
-                       maxcc=maxcc_comp;
-                       gain=gain_comp;
-                       lag=i;
-                       max_per=per;
-                   }
-               }
-               
-           }
-   
-           /* previous frame lost, use recorded lag and periodicity */
-   
-           else {
-               lag=iLBCdec_inst->prevLag;
-               max_per=iLBCdec_inst->per;
-           }
-           
-           /* downscaling */
-   
-           use_gain=1.0;
-           if (iLBCdec_inst->consPLICount*iLBCdec_inst->blockl>320)
-               use_gain=(float)0.9;
-           else if (iLBCdec_inst->consPLICount*
-                           iLBCdec_inst->blockl>2*320)
-               use_gain=(float)0.7;
-           else if (iLBCdec_inst->consPLICount*
-                           iLBCdec_inst->blockl>3*320)
-               use_gain=(float)0.5;
-           else if (iLBCdec_inst->consPLICount*
-   
-   
-                           iLBCdec_inst->blockl>4*320)
-               use_gain=(float)0.0;
-   
-           /* mix noise and pitch repeatition */
-           ftmp=(float)sqrt(max_per);
-           if (ftmp>(float)0.7)
-               pitchfact=(float)1.0;
-           else if (ftmp>(float)0.4)
-               pitchfact=(ftmp-(float)0.4)/((float)0.7-(float)0.4);
-           else
-               pitchfact=0.0;
-   
-   
-           /* avoid repetition of same pitch cycle */
-           use_lag=lag;
-           if (lag<80) {
-               use_lag=2*lag;
-           }
-   
-           /* compute concealed residual */
-   
-           energy = 0.0;
-           for (i=0; i<iLBCdec_inst->blockl; i++) {
-   
-               /* noise component */
-   
-               iLBCdec_inst->seed=(iLBCdec_inst->seed*69069L+1) & 
-                   (0x80000000L-1);
-               randlag = 50 + ((signed long) iLBCdec_inst->seed)%70;
-               pick = i - randlag;
-               
-               if (pick < 0) {
-                   randvec[i] = 
-                       iLBCdec_inst->prevResidual[
-                                   iLBCdec_inst->blockl+pick];
-               } else {
-                   randvec[i] =  randvec[pick];
-               }
-   
-               /* pitch repeatition component */
-               pick = i - use_lag;
-               
-               if (pick < 0) {
-                   PLCresidual[i] =  
-                       iLBCdec_inst->prevResidual[
-                                   iLBCdec_inst->blockl+pick];
-               } else {
-                   PLCresidual[i] = PLCresidual[pick];
-               }
-   
-               /* mix random and periodicity component */
-   
-               if (i<80)
-                   PLCresidual[i] = use_gain*(pitchfact * 
-   
-   
-                               PLCresidual[i] +
-                               ((float)1.0 - pitchfact) * randvec[i]);
-               else if (i<160)
-                   PLCresidual[i] = (float)0.95*use_gain*(pitchfact * 
-                               PLCresidual[i] +
-                               ((float)1.0 - pitchfact) * randvec[i]);
-               else
-                   PLCresidual[i] = (float)0.9*use_gain*(pitchfact * 
-                               PLCresidual[i] +
-                               ((float)1.0 - pitchfact) * randvec[i]);
-   
-               energy += PLCresidual[i] * PLCresidual[i];
-           }
-           
-           /* less than 30 dB, use only noise */
-           
-           if (sqrt(energy/(float)iLBCdec_inst->blockl) < 30.0) { 
-               gain=0.0;
-               for (i=0; i<iLBCdec_inst->blockl; i++) {
-                   PLCresidual[i] = randvec[i];
-               }
-           }
-   
-           /* use old LPC */
-   
-           memcpy(PLClpc,iLBCdec_inst->prevLpc,
-               (LPC_FILTERORDER+1)*sizeof(float));
-           
-       }
-   
-       /* no packet loss, copy input */
-   
-       else {
-           memcpy(PLCresidual, decresidual, 
-               iLBCdec_inst->blockl*sizeof(float));
-           memcpy(PLClpc, lpc, (LPC_FILTERORDER+1)*sizeof(float));
-           iLBCdec_inst->consPLICount = 0;
-       }
-       
-       /* update state */
-   
-       if (PLI) {
-           iLBCdec_inst->prevLag = lag;
-           iLBCdec_inst->per=max_per;
-       }
-   
-       iLBCdec_inst->prevPLI = PLI;
-       memcpy(iLBCdec_inst->prevLpc, PLClpc, 
-           (LPC_FILTERORDER+1)*sizeof(float));
-       memcpy(iLBCdec_inst->prevResidual, PLCresidual,
-           iLBCdec_inst->blockl*sizeof(float));
-   }
-   
-   
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       doCPLC.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <string.h>
+   #include <stdio.h>
+   
+   #include "iLBC_define.h"
+   
+   /*----------------------------------------------------------------*
+    *  Compute cross correlation and pitch gain for pitch prediction
+    *  of last subframe at given lag.
+    *---------------------------------------------------------------*/
+   
+   void compCorr(
+       float *cc,      /* (o) cross correlation coefficient */
+       float *gc,      /* (o) gain */
+       float *pm,
+       float *buffer,  /* (i) signal buffer */
+       int lag,    /* (i) pitch lag */
+       int bLen,       /* (i) length of buffer */
+       int sRange      /* (i) correlation search length */
+   ){
+   
+   
+       int i;
+       float ftmp1, ftmp2, ftmp3;
+   
+       /* Guard against getting outside buffer */
+       if ((bLen-sRange-lag)<0) {
+           sRange=bLen-lag;
+       }
+   
+       ftmp1 = 0.0;
+       ftmp2 = 0.0;
+       ftmp3 = 0.0;
+       for (i=0; i<sRange; i++) {
+           ftmp1 += buffer[bLen-sRange+i] *
+               buffer[bLen-sRange+i-lag];
+           ftmp2 += buffer[bLen-sRange+i-lag] * 
+                   buffer[bLen-sRange+i-lag];
+           ftmp3 += buffer[bLen-sRange+i] * 
+                   buffer[bLen-sRange+i];
+       }
+   
+       if (ftmp2 > 0.0) {
+           *cc = ftmp1*ftmp1/ftmp2;
+           *gc = (float)fabs(ftmp1/ftmp2);
+           *pm=(float)fabs(ftmp1)/
+               ((float)sqrt(ftmp2)*(float)sqrt(ftmp3));
+       }
+       else {
+           *cc = 0.0;
+           *gc = 0.0;
+           *pm=0.0;
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  Packet loss concealment routine. Conceals a residual signal
+    *  and LP parameters. If no packet loss, update state.
+    *---------------------------------------------------------------*/
+   
+   void doThePLC(
+       float *PLCresidual, /* (o) concealed residual */ 
+       float *PLClpc,      /* (o) concealed LP parameters */  
+       int PLI,        /* (i) packet loss indicator 
+                                  0 - no PL, 1 = PL */ 
+       float *decresidual, /* (i) decoded residual */
+       float *lpc,         /* (i) decoded LPC (only used for no PL) */
+       int inlag,          /* (i) pitch lag */
+       iLBC_Dec_Inst_t *iLBCdec_inst 
+                           /* (i/o) decoder instance */
+   ){
+       int lag=20, randlag;
+       float gain, maxcc;
+       float use_gain;
+       float gain_comp, maxcc_comp, per, max_per;
+       int i, pick, use_lag;
+   
+   
+       float ftmp, randvec[BLOCKL_MAX], pitchfact, energy;
+               
+       /* Packet Loss */
+   
+       if (PLI == 1) {
+           
+           iLBCdec_inst->consPLICount += 1;
+           
+           /* if previous frame not lost, 
+              determine pitch pred. gain */
+           
+           if (iLBCdec_inst->prevPLI != 1) {
+   
+               /* Search around the previous lag to find the 
+                  best pitch period */
+               
+               lag=inlag-3;
+               compCorr(&maxcc, &gain, &max_per, 
+                   iLBCdec_inst->prevResidual,
+                   lag, iLBCdec_inst->blockl, 60);
+               for (i=inlag-2;i<=inlag+3;i++) {
+                   compCorr(&maxcc_comp, &gain_comp, &per,
+                       iLBCdec_inst->prevResidual,
+                       i, iLBCdec_inst->blockl, 60);
+                   
+                   if (maxcc_comp>maxcc) {
+                       maxcc=maxcc_comp;
+                       gain=gain_comp;
+                       lag=i;
+                       max_per=per;
+                   }
+               }
+               
+           }
+   
+           /* previous frame lost, use recorded lag and periodicity */
+   
+           else {
+               lag=iLBCdec_inst->prevLag;
+               max_per=iLBCdec_inst->per;
+           }
+           
+           /* downscaling */
+   
+           use_gain=1.0;
+           if (iLBCdec_inst->consPLICount*iLBCdec_inst->blockl>320)
+               use_gain=(float)0.9;
+           else if (iLBCdec_inst->consPLICount*
+                           iLBCdec_inst->blockl>2*320)
+               use_gain=(float)0.7;
+           else if (iLBCdec_inst->consPLICount*
+                           iLBCdec_inst->blockl>3*320)
+               use_gain=(float)0.5;
+           else if (iLBCdec_inst->consPLICount*
+   
+   
+                           iLBCdec_inst->blockl>4*320)
+               use_gain=(float)0.0;
+   
+           /* mix noise and pitch repeatition */
+           ftmp=(float)sqrt(max_per);
+           if (ftmp>(float)0.7)
+               pitchfact=(float)1.0;
+           else if (ftmp>(float)0.4)
+               pitchfact=(ftmp-(float)0.4)/((float)0.7-(float)0.4);
+           else
+               pitchfact=0.0;
+   
+   
+           /* avoid repetition of same pitch cycle */
+           use_lag=lag;
+           if (lag<80) {
+               use_lag=2*lag;
+           }
+   
+           /* compute concealed residual */
+   
+           energy = 0.0;
+           for (i=0; i<iLBCdec_inst->blockl; i++) {
+   
+               /* noise component */
+   
+               iLBCdec_inst->seed=(iLBCdec_inst->seed*69069L+1) & 
+                   (0x80000000L-1);
+               randlag = 50 + ((signed long) iLBCdec_inst->seed)%70;
+               pick = i - randlag;
+               
+               if (pick < 0) {
+                   randvec[i] = 
+                       iLBCdec_inst->prevResidual[
+                                   iLBCdec_inst->blockl+pick];
+               } else {
+                   randvec[i] =  randvec[pick];
+               }
+   
+               /* pitch repeatition component */
+               pick = i - use_lag;
+               
+               if (pick < 0) {
+                   PLCresidual[i] =  
+                       iLBCdec_inst->prevResidual[
+                                   iLBCdec_inst->blockl+pick];
+               } else {
+                   PLCresidual[i] = PLCresidual[pick];
+               }
+   
+               /* mix random and periodicity component */
+   
+               if (i<80)
+                   PLCresidual[i] = use_gain*(pitchfact * 
+   
+   
+                               PLCresidual[i] +
+                               ((float)1.0 - pitchfact) * randvec[i]);
+               else if (i<160)
+                   PLCresidual[i] = (float)0.95*use_gain*(pitchfact * 
+                               PLCresidual[i] +
+                               ((float)1.0 - pitchfact) * randvec[i]);
+               else
+                   PLCresidual[i] = (float)0.9*use_gain*(pitchfact * 
+                               PLCresidual[i] +
+                               ((float)1.0 - pitchfact) * randvec[i]);
+   
+               energy += PLCresidual[i] * PLCresidual[i];
+           }
+           
+           /* less than 30 dB, use only noise */
+           
+           if (sqrt(energy/(float)iLBCdec_inst->blockl) < 30.0) { 
+               gain=0.0;
+               for (i=0; i<iLBCdec_inst->blockl; i++) {
+                   PLCresidual[i] = randvec[i];
+               }
+           }
+   
+           /* use old LPC */
+   
+           memcpy(PLClpc,iLBCdec_inst->prevLpc,
+               (LPC_FILTERORDER+1)*sizeof(float));
+           
+       }
+   
+       /* no packet loss, copy input */
+   
+       else {
+           memcpy(PLCresidual, decresidual, 
+               iLBCdec_inst->blockl*sizeof(float));
+           memcpy(PLClpc, lpc, (LPC_FILTERORDER+1)*sizeof(float));
+           iLBCdec_inst->consPLICount = 0;
+       }
+       
+       /* update state */
+   
+       if (PLI) {
+           iLBCdec_inst->prevLag = lag;
+           iLBCdec_inst->per=max_per;
+       }
+   
+       iLBCdec_inst->prevPLI = PLI;
+       memcpy(iLBCdec_inst->prevLpc, PLClpc, 
+           (LPC_FILTERORDER+1)*sizeof(float));
+       memcpy(iLBCdec_inst->prevResidual, PLCresidual,
+           iLBCdec_inst->blockl*sizeof(float));
+   }
+   
+   
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/doCPLC.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/doCPLC.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/doCPLC.h	Fri Sep 21 14:49:14 2007
@@ -1,32 +1,32 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       doCPLC.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_DOLPC_H
-   #define __iLBC_DOLPC_H
-   
-   void doThePLC(
-       float *PLCresidual, /* (o) concealed residual */ 
-       float *PLClpc,      /* (o) concealed LP parameters */  
-       int PLI,        /* (i) packet loss indicator 
-                                  0 - no PL, 1 = PL */ 
-       float *decresidual, /* (i) decoded residual */
-       float *lpc,         /* (i) decoded LPC (only used for no PL) */
-       int inlag,          /* (i) pitch lag */
-       iLBC_Dec_Inst_t *iLBCdec_inst 
-                           /* (i/o) decoder instance */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       doCPLC.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_DOLPC_H
+   #define __iLBC_DOLPC_H
+   
+   void doThePLC(
+       float *PLCresidual, /* (o) concealed residual */ 
+       float *PLClpc,      /* (o) concealed LP parameters */  
+       int PLI,        /* (i) packet loss indicator 
+                                  0 - no PL, 1 = PL */ 
+       float *decresidual, /* (i) decoded residual */
+       float *lpc,         /* (i) decoded LPC (only used for no PL) */
+       int inlag,          /* (i) pitch lag */
+       iLBC_Dec_Inst_t *iLBCdec_inst 
+                           /* (i/o) decoder instance */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/enhancer.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/enhancer.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/enhancer.c	Fri Sep 21 14:49:14 2007
@@ -1,664 +1,664 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       enhancer.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <string.h>
-   #include "iLBC_define.h"
-   #include "constants.h"
-   #include "filter.h"
-   
-   /*----------------------------------------------------------------*
-   
-   
-    * Find index in array such that the array element with said
-    * index is the element of said array closest to "value" 
-    * according to the squared-error criterion
-    *---------------------------------------------------------------*/
-   
-   void NearestNeighbor(
-       int   *index,   /* (o) index of array element closest 
-                              to value */
-       float *array,   /* (i) data array */
-       float value,/* (i) value */
-       int arlength/* (i) dimension of data array */
-   ){
-       int i;
-       float bestcrit,crit;
-   
-       crit=array[0]-value;
-       bestcrit=crit*crit;
-       *index=0;
-       for (i=1; i<arlength; i++) {
-           crit=array[i]-value;
-           crit=crit*crit;
-           
-           if (crit<bestcrit) {
-               bestcrit=crit;
-               *index=i;
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    * compute cross correlation between sequences
-    *---------------------------------------------------------------*/
-   
-   void mycorr1( 
-       float* corr,    /* (o) correlation of seq1 and seq2 */
-       float* seq1,    /* (i) first sequence */
-       int dim1,           /* (i) dimension first seq1 */
-       const float *seq2,  /* (i) second sequence */
-       int dim2        /* (i) dimension seq2 */
-   ){
-       int i,j;
-   
-       for (i=0; i<=dim1-dim2; i++) {
-           corr[i]=0.0;
-           for (j=0; j<dim2; j++) {
-               corr[i] += seq1[i+j] * seq2[j];
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    * upsample finite array assuming zeros outside bounds
-    *---------------------------------------------------------------*/
-   
-   
-   
-   void enh_upsample( 
-       float* useq1,   /* (o) upsampled output sequence */
-       float* seq1,/* (i) unupsampled sequence */
-       int dim1,       /* (i) dimension seq1 */
-       int hfl         /* (i) polyphase filter length=2*hfl+1 */
-   ){
-       float *pu,*ps;
-       int i,j,k,q,filterlength,hfl2;
-       const float *polyp[ENH_UPS0]; /* pointers to 
-                                        polyphase columns */
-       const float *pp;
-   
-       /* define pointers for filter */
-   
-       filterlength=2*hfl+1;
-       
-       if ( filterlength > dim1 ) {
-           hfl2=(int) (dim1/2);
-           for (j=0; j<ENH_UPS0; j++) {
-               polyp[j]=polyphaserTbl+j*filterlength+hfl-hfl2;
-           }
-           hfl=hfl2;
-           filterlength=2*hfl+1;
-       }
-       else {
-           for (j=0; j<ENH_UPS0; j++) {
-               polyp[j]=polyphaserTbl+j*filterlength;
-           }
-       }
-   
-       /* filtering: filter overhangs left side of sequence */
-   
-       pu=useq1;
-       for (i=hfl; i<filterlength; i++) { 
-           for (j=0; j<ENH_UPS0; j++) {
-               *pu=0.0;
-               pp = polyp[j];
-               ps = seq1+i;
-               for (k=0; k<=i; k++) {
-                   *pu += *ps-- * *pp++;
-               }
-               pu++;
-           }
-       }
-   
-       /* filtering: simple convolution=inner products */
-   
-       for (i=filterlength; i<dim1; i++) {
-           for (j=0;j<ENH_UPS0; j++){
-               *pu=0.0;
-               pp = polyp[j];
-               ps = seq1+i;
-               for (k=0; k<filterlength; k++) {
-                   *pu += *ps-- * *pp++;
-   
-   
-               }
-               pu++;
-           }
-       }
-   
-       /* filtering: filter overhangs right side of sequence */
-   
-       for (q=1; q<=hfl; q++) { 
-           for (j=0; j<ENH_UPS0; j++) {
-               *pu=0.0;
-               pp = polyp[j]+q;
-               ps = seq1+dim1-1;
-               for (k=0; k<filterlength-q; k++) {
-                   *pu += *ps-- * *pp++;
-               }
-               pu++;
-           }
-       }
-   }
-   
-   
-   /*----------------------------------------------------------------*
-    * find segment starting near idata+estSegPos that has highest 
-    * correlation with idata+centerStartPos through 
-    * idata+centerStartPos+ENH_BLOCKL-1 segment is found at a 
-    * resolution of ENH_UPSO times the original of the original 
-    * sampling rate
-    *---------------------------------------------------------------*/
-   
-   void refiner(
-       float *seg,         /* (o) segment array */
-       float *updStartPos, /* (o) updated start point */
-       float* idata,       /* (i) original data buffer */
-       int idatal,         /* (i) dimension of idata */
-       int centerStartPos, /* (i) beginning center segment */
-       float estSegPos,/* (i) estimated beginning other segment */
-       float period    /* (i) estimated pitch period */
-   ){
-       int estSegPosRounded,searchSegStartPos,searchSegEndPos,corrdim;
-       int tloc,tloc2,i,st,en,fraction;
-       float vect[ENH_VECTL],corrVec[ENH_CORRDIM],maxv;
-       float corrVecUps[ENH_CORRDIM*ENH_UPS0];
-   
-       /* defining array bounds */
-       
-       estSegPosRounded=(int)(estSegPos - 0.5);
-   
-       searchSegStartPos=estSegPosRounded-ENH_SLOP;
-       
-       if (searchSegStartPos<0) { 
-           searchSegStartPos=0;
-       }
-       searchSegEndPos=estSegPosRounded+ENH_SLOP;
-       
-   
-   
-       if (searchSegEndPos+ENH_BLOCKL >= idatal) { 
-           searchSegEndPos=idatal-ENH_BLOCKL-1;
-       }
-       corrdim=searchSegEndPos-searchSegStartPos+1;
-       
-       /* compute upsampled correlation (corr33) and find 
-          location of max */
-   
-       mycorr1(corrVec,idata+searchSegStartPos,
-           corrdim+ENH_BLOCKL-1,idata+centerStartPos,ENH_BLOCKL);
-       enh_upsample(corrVecUps,corrVec,corrdim,ENH_FL0);
-       tloc=0; maxv=corrVecUps[0];
-       for (i=1; i<ENH_UPS0*corrdim; i++) {
-           
-           if (corrVecUps[i]>maxv) {
-               tloc=i;
-               maxv=corrVecUps[i];
-           }
-       }
-       
-       /* make vector can be upsampled without ever running outside 
-          bounds */
-       
-       *updStartPos= (float)searchSegStartPos + 
-           (float)tloc/(float)ENH_UPS0+(float)1.0;
-       tloc2=(int)(tloc/ENH_UPS0);
-       
-       if (tloc>tloc2*ENH_UPS0) {
-           tloc2++;
-       }
-       st=searchSegStartPos+tloc2-ENH_FL0;
-       
-       if (st<0) {
-           memset(vect,0,-st*sizeof(float));
-           memcpy(&vect[-st],idata, (ENH_VECTL+st)*sizeof(float));
-       }
-       else {
-           en=st+ENH_VECTL;
-           
-           if (en>idatal) {
-               memcpy(vect, &idata[st], 
-                   (ENH_VECTL-(en-idatal))*sizeof(float));
-               memset(&vect[ENH_VECTL-(en-idatal)], 0, 
-                   (en-idatal)*sizeof(float));
-           }
-           else {
-               memcpy(vect, &idata[st], ENH_VECTL*sizeof(float));
-           }
-       }
-       fraction=tloc2*ENH_UPS0-tloc;
-       
-       /* compute the segment (this is actually a convolution) */
-   
-       mycorr1(seg,vect,ENH_VECTL,polyphaserTbl+(2*ENH_FL0+1)*fraction,
-   
-   
-           2*ENH_FL0+1);
-   }
-   
-   /*----------------------------------------------------------------*
-    * find the smoothed output data
-    *---------------------------------------------------------------*/
-   
-   void smath(
-       float *odata,   /* (o) smoothed output */
-       float *sseq,/* (i) said second sequence of waveforms */
-       int hl,         /* (i) 2*hl+1 is sseq dimension */
-       float alpha0/* (i) max smoothing energy fraction */
-   ){
-       int i,k;
-       float w00,w10,w11,A,B,C,*psseq,err,errs;
-       float surround[BLOCKL_MAX]; /* shape contributed by other than 
-                                      current */
-       float wt[2*ENH_HL+1];       /* waveform weighting to get 
-                                      surround shape */
-       float denom;
-       
-       /* create shape of contribution from all waveforms except the
-          current one */
-   
-       for (i=1; i<=2*hl+1; i++) {
-           wt[i-1] = (float)0.5*(1 - (float)cos(2*PI*i/(2*hl+2))); 
-       }
-       wt[hl]=0.0; /* for clarity, not used */
-       for (i=0; i<ENH_BLOCKL; i++) {
-           surround[i]=sseq[i]*wt[0];
-       }
-       for (k=1; k<hl; k++) {
-           psseq=sseq+k*ENH_BLOCKL;
-           for(i=0;i<ENH_BLOCKL; i++) {
-               surround[i]+=psseq[i]*wt[k];
-           }
-       }
-       for (k=hl+1; k<=2*hl; k++) {
-           psseq=sseq+k*ENH_BLOCKL;
-           for(i=0;i<ENH_BLOCKL; i++) {
-               surround[i]+=psseq[i]*wt[k];
-           }
-       }
-       
-       /* compute some inner products */
-   
-       w00 = w10 = w11 = 0.0;
-       psseq=sseq+hl*ENH_BLOCKL; /* current block  */
-       for (i=0; i<ENH_BLOCKL;i++) {
-           w00+=psseq[i]*psseq[i];
-           w11+=surround[i]*surround[i];
-           w10+=surround[i]*psseq[i];
-       }
-       
-   
-   
-       if (fabs(w11) < 1.0) {
-           w11=1.0;
-       }
-       C = (float)sqrt( w00/w11);
-       
-       /* first try enhancement without power-constraint */
-   
-       errs=0.0;
-       psseq=sseq+hl*ENH_BLOCKL;
-       for (i=0; i<ENH_BLOCKL; i++) {
-           odata[i]=C*surround[i];
-           err=psseq[i]-odata[i];
-           errs+=err*err;
-       }
-       
-       /* if constraint violated by first try, add constraint */ 
-       
-       if (errs > alpha0 * w00) {
-           if ( w00 < 1) {
-               w00=1;
-           }
-           denom = (w11*w00-w10*w10)/(w00*w00);
-           
-           if (denom > 0.0001) { /* eliminates numerical problems 
-                                    for if smooth */
-               A = (float)sqrt( (alpha0- alpha0*alpha0/4)/denom);
-               B = -alpha0/2 - A * w10/w00;
-               B = B+1;
-           }
-           else { /* essentially no difference between cycles; 
-                     smoothing not needed */
-               A= 0.0;
-               B= 1.0;
-           }
-           
-           /* create smoothed sequence */
-   
-           psseq=sseq+hl*ENH_BLOCKL;
-           for (i=0; i<ENH_BLOCKL; i++) {
-               odata[i]=A*surround[i]+B*psseq[i];
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    * get the pitch-synchronous sample sequence
-    *---------------------------------------------------------------*/
-   
-   void getsseq(
-       float *sseq,    /* (o) the pitch-synchronous sequence */
-       float *idata,       /* (i) original data */
-       int idatal,         /* (i) dimension of data */
-       int centerStartPos, /* (i) where current block starts */
-       float *period,      /* (i) rough-pitch-period array */
-   
-   
-       float *plocs,       /* (i) where periods of period array 
-                                  are taken */
-       int periodl,    /* (i) dimension period array */
-       int hl              /* (i) 2*hl+1 is the number of sequences */
-   ){
-       int i,centerEndPos,q;
-       float blockStartPos[2*ENH_HL+1];
-       int lagBlock[2*ENH_HL+1];
-       float plocs2[ENH_PLOCSL]; 
-       float *psseq;
-   
-       centerEndPos=centerStartPos+ENH_BLOCKL-1;
-       
-       /* present */
-   
-       NearestNeighbor(lagBlock+hl,plocs,
-           (float)0.5*(centerStartPos+centerEndPos),periodl);
-       
-       blockStartPos[hl]=(float)centerStartPos;
-       psseq=sseq+ENH_BLOCKL*hl;
-       memcpy(psseq, idata+centerStartPos, ENH_BLOCKL*sizeof(float));
-       
-       /* past */
-   
-       for (q=hl-1; q>=0; q--) {
-           blockStartPos[q]=blockStartPos[q+1]-period[lagBlock[q+1]];
-           NearestNeighbor(lagBlock+q,plocs,
-               blockStartPos[q]+
-               ENH_BLOCKL_HALF-period[lagBlock[q+1]], periodl);
-                               
-           
-           if (blockStartPos[q]-ENH_OVERHANG>=0) {
-               refiner(sseq+q*ENH_BLOCKL, blockStartPos+q, idata,
-                   idatal, centerStartPos, blockStartPos[q],
-                   period[lagBlock[q+1]]);
-           } else {
-               psseq=sseq+q*ENH_BLOCKL;
-               memset(psseq, 0, ENH_BLOCKL*sizeof(float));
-           }
-       }
-       
-       /* future */
-   
-       for (i=0; i<periodl; i++) {
-           plocs2[i]=plocs[i]-period[i];
-       }
-       for (q=hl+1; q<=2*hl; q++) { 
-           NearestNeighbor(lagBlock+q,plocs2,
-               blockStartPos[q-1]+ENH_BLOCKL_HALF,periodl);
-   
-           blockStartPos[q]=blockStartPos[q-1]+period[lagBlock[q]];
-           if (blockStartPos[q]+ENH_BLOCKL+ENH_OVERHANG<idatal) {
-               refiner(sseq+ENH_BLOCKL*q, blockStartPos+q, idata,
-                   idatal, centerStartPos, blockStartPos[q],
-   
-   
-                   period[lagBlock[q]]);
-           }
-           else {
-               psseq=sseq+q*ENH_BLOCKL;
-               memset(psseq, 0, ENH_BLOCKL*sizeof(float));
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    * perform enhancement on idata+centerStartPos through 
-    * idata+centerStartPos+ENH_BLOCKL-1
-    *---------------------------------------------------------------*/
-   
-   void enhancer(
-       float *odata,       /* (o) smoothed block, dimension blockl */
-       float *idata,       /* (i) data buffer used for enhancing */
-       int idatal,         /* (i) dimension idata */
-       int centerStartPos, /* (i) first sample current block 
-                                  within idata */
-       float alpha0,       /* (i) max correction-energy-fraction 
-                                 (in [0,1]) */
-       float *period,      /* (i) pitch period array */
-       float *plocs,       /* (i) locations where period array 
-                                  values valid */
-       int periodl         /* (i) dimension of period and plocs */
-   ){
-       float sseq[(2*ENH_HL+1)*ENH_BLOCKL];
-   
-       /* get said second sequence of segments */
-   
-       getsseq(sseq,idata,idatal,centerStartPos,period,
-           plocs,periodl,ENH_HL);
-   
-       /* compute the smoothed output from said second sequence */
-   
-       smath(odata,sseq,ENH_HL,alpha0);
-   
-   }
-   
-   /*----------------------------------------------------------------*
-    * cross correlation
-    *---------------------------------------------------------------*/
-   
-   float xCorrCoef( 
-       float *target,      /* (i) first array */
-       float *regressor,   /* (i) second array */
-       int subl        /* (i) dimension arrays */
-   ){
-       int i;
-       float ftmp1, ftmp2;
-           
-       ftmp1 = 0.0;
-       ftmp2 = 0.0;
-   
-   
-       for (i=0; i<subl; i++) {
-           ftmp1 += target[i]*regressor[i];
-           ftmp2 += regressor[i]*regressor[i]; 
-       }
-       
-       if (ftmp1 > 0.0) {
-           return (float)(ftmp1*ftmp1/ftmp2);
-       }
-       else {
-           return (float)0.0;
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    * interface for enhancer
-    *---------------------------------------------------------------*/
-   
-   int enhancerInterface(
-       float *out,                     /* (o) enhanced signal */
-       float *in,                      /* (i) unenhanced signal */
-       iLBC_Dec_Inst_t *iLBCdec_inst   /* (i) buffers etc */
-   ){
-       float *enh_buf, *enh_period;
-       int iblock, isample;
-       int lag=0, ilag, i, ioffset;
-       float cc, maxcc;
-       float ftmp1, ftmp2;
-       float *inPtr, *enh_bufPtr1, *enh_bufPtr2;
-       float plc_pred[ENH_BLOCKL];
-   
-       float lpState[6], downsampled[(ENH_NBLOCKS*ENH_BLOCKL+120)/2];
-       int inLen=ENH_NBLOCKS*ENH_BLOCKL+120;
-       int start, plc_blockl, inlag;
-   
-       enh_buf=iLBCdec_inst->enh_buf;
-       enh_period=iLBCdec_inst->enh_period;
-       
-       memmove(enh_buf, &enh_buf[iLBCdec_inst->blockl], 
-           (ENH_BUFL-iLBCdec_inst->blockl)*sizeof(float));
-                                                               
-       memcpy(&enh_buf[ENH_BUFL-iLBCdec_inst->blockl], in, 
-           iLBCdec_inst->blockl*sizeof(float));
-   
-       if (iLBCdec_inst->mode==30)
-           plc_blockl=ENH_BLOCKL;
-       else
-           plc_blockl=40;
-   
-       /* when 20 ms frame, move processing one block */
-       ioffset=0;
-       if (iLBCdec_inst->mode==20) ioffset=1;
-   
-       i=3-ioffset;
-       memmove(enh_period, &enh_period[i], 
-   
-   
-           (ENH_NBLOCKS_TOT-i)*sizeof(float));
-   
-       /* Set state information to the 6 samples right before 
-          the samples to be downsampled. */
-   
-       memcpy(lpState, 
-           enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-126, 
-           6*sizeof(float));
-   
-       /* Down sample a factor 2 to save computations */
-   
-       DownSample(enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-120,
-                   lpFilt_coefsTbl, inLen-ioffset*ENH_BLOCKL,
-                   lpState, downsampled);
-   
-       /* Estimate the pitch in the down sampled domain. */
-       for (iblock = 0; iblock<ENH_NBLOCKS-ioffset; iblock++) {
-           
-           lag = 10;
-           maxcc = xCorrCoef(downsampled+60+iblock*
-               ENH_BLOCKL_HALF, downsampled+60+iblock*
-               ENH_BLOCKL_HALF-lag, ENH_BLOCKL_HALF);
-           for (ilag=11; ilag<60; ilag++) {
-               cc = xCorrCoef(downsampled+60+iblock*
-                   ENH_BLOCKL_HALF, downsampled+60+iblock*
-                   ENH_BLOCKL_HALF-ilag, ENH_BLOCKL_HALF);
-               
-               if (cc > maxcc) {
-                   maxcc = cc;
-                   lag = ilag;
-               }
-           }
-   
-           /* Store the estimated lag in the non-downsampled domain */
-           enh_period[iblock+ENH_NBLOCKS_EXTRA+ioffset] = (float)lag*2;
-
-
-       }   
-   
-   
-       /* PLC was performed on the previous packet */
-       if (iLBCdec_inst->prev_enh_pl==1) {
-   
-           inlag=(int)enh_period[ENH_NBLOCKS_EXTRA+ioffset];
-   
-           lag = inlag-1;
-           maxcc = xCorrCoef(in, in+lag, plc_blockl);
-           for (ilag=inlag; ilag<=inlag+1; ilag++) {
-               cc = xCorrCoef(in, in+ilag, plc_blockl);
-               
-               if (cc > maxcc) {
-                   maxcc = cc;
-                   lag = ilag;
-               }
-           }
-   
-   
-   
-           enh_period[ENH_NBLOCKS_EXTRA+ioffset-1]=(float)lag;
-   
-           /* compute new concealed residual for the old lookahead,
-              mix the forward PLC with a backward PLC from 
-              the new frame */
-           
-           inPtr=&in[lag-1];
-           
-           enh_bufPtr1=&plc_pred[plc_blockl-1];
-           
-           if (lag>plc_blockl) {
-               start=plc_blockl;
-           } else {
-               start=lag;
-           }
-   
-           for (isample = start; isample>0; isample--) {
-               *enh_bufPtr1-- = *inPtr--;
-           }
-           
-           enh_bufPtr2=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl];
-           for (isample = (plc_blockl-1-lag); isample>=0; isample--) 
-{
-               *enh_bufPtr1-- = *enh_bufPtr2--;
-           }
-   
-           /* limit energy change */
-           ftmp2=0.0;
-           ftmp1=0.0;
-           for (i=0;i<plc_blockl;i++) {
-               ftmp2+=enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]*
-                   enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i];
-               ftmp1+=plc_pred[i]*plc_pred[i];
-           }
-           ftmp1=(float)sqrt(ftmp1/(float)plc_blockl);
-           ftmp2=(float)sqrt(ftmp2/(float)plc_blockl);
-           if (ftmp1>(float)2.0*ftmp2 && ftmp1>0.0) {
-               for (i=0;i<plc_blockl-10;i++) {
-                   plc_pred[i]*=(float)2.0*ftmp2/ftmp1;
-               }
-               for (i=plc_blockl-10;i<plc_blockl;i++) {
-                   plc_pred[i]*=(float)(i-plc_blockl+10)*
-                       ((float)1.0-(float)2.0*ftmp2/ftmp1)/(float)(10)+
-                       (float)2.0*ftmp2/ftmp1;
-               }
-           }
-       
-           enh_bufPtr1=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl];
-           for (i=0; i<plc_blockl; i++) {
-               ftmp1 = (float) (i+1) / (float) (plc_blockl+1);
-               *enh_bufPtr1 *= ftmp1;
-               *enh_bufPtr1 += ((float)1.0-ftmp1)*
-                                   plc_pred[plc_blockl-1-i];
-               enh_bufPtr1--;
-           }
-   
-   
-       }
-   
-       if (iLBCdec_inst->mode==20) {
-           /* Enhancer with 40 samples delay */
-           for (iblock = 0; iblock<2; iblock++) {
-               enhancer(out+iblock*ENH_BLOCKL, enh_buf, 
-                   ENH_BUFL, (5+iblock)*ENH_BLOCKL+40,
-                   ENH_ALPHA0, enh_period, enh_plocsTbl, 
-                       ENH_NBLOCKS_TOT);
-           }
-       } else if (iLBCdec_inst->mode==30) {
-           /* Enhancer with 80 samples delay */
-           for (iblock = 0; iblock<3; iblock++) {
-               enhancer(out+iblock*ENH_BLOCKL, enh_buf, 
-                   ENH_BUFL, (4+iblock)*ENH_BLOCKL,
-                   ENH_ALPHA0, enh_period, enh_plocsTbl, 
-                       ENH_NBLOCKS_TOT);
-           }
-       }
-   
-       return (lag*2);
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       enhancer.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <string.h>
+   #include "iLBC_define.h"
+   #include "constants.h"
+   #include "filter.h"
+   
+   /*----------------------------------------------------------------*
+   
+   
+    * Find index in array such that the array element with said
+    * index is the element of said array closest to "value" 
+    * according to the squared-error criterion
+    *---------------------------------------------------------------*/
+   
+   void NearestNeighbor(
+       int   *index,   /* (o) index of array element closest 
+                              to value */
+       float *array,   /* (i) data array */
+       float value,/* (i) value */
+       int arlength/* (i) dimension of data array */
+   ){
+       int i;
+       float bestcrit,crit;
+   
+       crit=array[0]-value;
+       bestcrit=crit*crit;
+       *index=0;
+       for (i=1; i<arlength; i++) {
+           crit=array[i]-value;
+           crit=crit*crit;
+           
+           if (crit<bestcrit) {
+               bestcrit=crit;
+               *index=i;
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    * compute cross correlation between sequences
+    *---------------------------------------------------------------*/
+   
+   void mycorr1( 
+       float* corr,    /* (o) correlation of seq1 and seq2 */
+       float* seq1,    /* (i) first sequence */
+       int dim1,           /* (i) dimension first seq1 */
+       const float *seq2,  /* (i) second sequence */
+       int dim2        /* (i) dimension seq2 */
+   ){
+       int i,j;
+   
+       for (i=0; i<=dim1-dim2; i++) {
+           corr[i]=0.0;
+           for (j=0; j<dim2; j++) {
+               corr[i] += seq1[i+j] * seq2[j];
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    * upsample finite array assuming zeros outside bounds
+    *---------------------------------------------------------------*/
+   
+   
+   
+   void enh_upsample( 
+       float* useq1,   /* (o) upsampled output sequence */
+       float* seq1,/* (i) unupsampled sequence */
+       int dim1,       /* (i) dimension seq1 */
+       int hfl         /* (i) polyphase filter length=2*hfl+1 */
+   ){
+       float *pu,*ps;
+       int i,j,k,q,filterlength,hfl2;
+       const float *polyp[ENH_UPS0]; /* pointers to 
+                                        polyphase columns */
+       const float *pp;
+   
+       /* define pointers for filter */
+   
+       filterlength=2*hfl+1;
+       
+       if ( filterlength > dim1 ) {
+           hfl2=(int) (dim1/2);
+           for (j=0; j<ENH_UPS0; j++) {
+               polyp[j]=polyphaserTbl+j*filterlength+hfl-hfl2;
+           }
+           hfl=hfl2;
+           filterlength=2*hfl+1;
+       }
+       else {
+           for (j=0; j<ENH_UPS0; j++) {
+               polyp[j]=polyphaserTbl+j*filterlength;
+           }
+       }
+   
+       /* filtering: filter overhangs left side of sequence */
+   
+       pu=useq1;
+       for (i=hfl; i<filterlength; i++) { 
+           for (j=0; j<ENH_UPS0; j++) {
+               *pu=0.0;
+               pp = polyp[j];
+               ps = seq1+i;
+               for (k=0; k<=i; k++) {
+                   *pu += *ps-- * *pp++;
+               }
+               pu++;
+           }
+       }
+   
+       /* filtering: simple convolution=inner products */
+   
+       for (i=filterlength; i<dim1; i++) {
+           for (j=0;j<ENH_UPS0; j++){
+               *pu=0.0;
+               pp = polyp[j];
+               ps = seq1+i;
+               for (k=0; k<filterlength; k++) {
+                   *pu += *ps-- * *pp++;
+   
+   
+               }
+               pu++;
+           }
+       }
+   
+       /* filtering: filter overhangs right side of sequence */
+   
+       for (q=1; q<=hfl; q++) { 
+           for (j=0; j<ENH_UPS0; j++) {
+               *pu=0.0;
+               pp = polyp[j]+q;
+               ps = seq1+dim1-1;
+               for (k=0; k<filterlength-q; k++) {
+                   *pu += *ps-- * *pp++;
+               }
+               pu++;
+           }
+       }
+   }
+   
+   
+   /*----------------------------------------------------------------*
+    * find segment starting near idata+estSegPos that has highest 
+    * correlation with idata+centerStartPos through 
+    * idata+centerStartPos+ENH_BLOCKL-1 segment is found at a 
+    * resolution of ENH_UPSO times the original of the original 
+    * sampling rate
+    *---------------------------------------------------------------*/
+   
+   void refiner(
+       float *seg,         /* (o) segment array */
+       float *updStartPos, /* (o) updated start point */
+       float* idata,       /* (i) original data buffer */
+       int idatal,         /* (i) dimension of idata */
+       int centerStartPos, /* (i) beginning center segment */
+       float estSegPos,/* (i) estimated beginning other segment */
+       float period    /* (i) estimated pitch period */
+   ){
+       int estSegPosRounded,searchSegStartPos,searchSegEndPos,corrdim;
+       int tloc,tloc2,i,st,en,fraction;
+       float vect[ENH_VECTL],corrVec[ENH_CORRDIM],maxv;
+       float corrVecUps[ENH_CORRDIM*ENH_UPS0];
+   
+       /* defining array bounds */
+       
+       estSegPosRounded=(int)(estSegPos - 0.5);
+   
+       searchSegStartPos=estSegPosRounded-ENH_SLOP;
+       
+       if (searchSegStartPos<0) { 
+           searchSegStartPos=0;
+       }
+       searchSegEndPos=estSegPosRounded+ENH_SLOP;
+       
+   
+   
+       if (searchSegEndPos+ENH_BLOCKL >= idatal) { 
+           searchSegEndPos=idatal-ENH_BLOCKL-1;
+       }
+       corrdim=searchSegEndPos-searchSegStartPos+1;
+       
+       /* compute upsampled correlation (corr33) and find 
+          location of max */
+   
+       mycorr1(corrVec,idata+searchSegStartPos,
+           corrdim+ENH_BLOCKL-1,idata+centerStartPos,ENH_BLOCKL);
+       enh_upsample(corrVecUps,corrVec,corrdim,ENH_FL0);
+       tloc=0; maxv=corrVecUps[0];
+       for (i=1; i<ENH_UPS0*corrdim; i++) {
+           
+           if (corrVecUps[i]>maxv) {
+               tloc=i;
+               maxv=corrVecUps[i];
+           }
+       }
+       
+       /* make vector can be upsampled without ever running outside 
+          bounds */
+       
+       *updStartPos= (float)searchSegStartPos + 
+           (float)tloc/(float)ENH_UPS0+(float)1.0;
+       tloc2=(int)(tloc/ENH_UPS0);
+       
+       if (tloc>tloc2*ENH_UPS0) {
+           tloc2++;
+       }
+       st=searchSegStartPos+tloc2-ENH_FL0;
+       
+       if (st<0) {
+           memset(vect,0,-st*sizeof(float));
+           memcpy(&vect[-st],idata, (ENH_VECTL+st)*sizeof(float));
+       }
+       else {
+           en=st+ENH_VECTL;
+           
+           if (en>idatal) {
+               memcpy(vect, &idata[st], 
+                   (ENH_VECTL-(en-idatal))*sizeof(float));
+               memset(&vect[ENH_VECTL-(en-idatal)], 0, 
+                   (en-idatal)*sizeof(float));
+           }
+           else {
+               memcpy(vect, &idata[st], ENH_VECTL*sizeof(float));
+           }
+       }
+       fraction=tloc2*ENH_UPS0-tloc;
+       
+       /* compute the segment (this is actually a convolution) */
+   
+       mycorr1(seg,vect,ENH_VECTL,polyphaserTbl+(2*ENH_FL0+1)*fraction,
+   
+   
+           2*ENH_FL0+1);
+   }
+   
+   /*----------------------------------------------------------------*
+    * find the smoothed output data
+    *---------------------------------------------------------------*/
+   
+   void smath(
+       float *odata,   /* (o) smoothed output */
+       float *sseq,/* (i) said second sequence of waveforms */
+       int hl,         /* (i) 2*hl+1 is sseq dimension */
+       float alpha0/* (i) max smoothing energy fraction */
+   ){
+       int i,k;
+       float w00,w10,w11,A,B,C,*psseq,err,errs;
+       float surround[BLOCKL_MAX]; /* shape contributed by other than 
+                                      current */
+       float wt[2*ENH_HL+1];       /* waveform weighting to get 
+                                      surround shape */
+       float denom;
+       
+       /* create shape of contribution from all waveforms except the
+          current one */
+   
+       for (i=1; i<=2*hl+1; i++) {
+           wt[i-1] = (float)0.5*(1 - (float)cos(2*PI*i/(2*hl+2))); 
+       }
+       wt[hl]=0.0; /* for clarity, not used */
+       for (i=0; i<ENH_BLOCKL; i++) {
+           surround[i]=sseq[i]*wt[0];
+       }
+       for (k=1; k<hl; k++) {
+           psseq=sseq+k*ENH_BLOCKL;
+           for(i=0;i<ENH_BLOCKL; i++) {
+               surround[i]+=psseq[i]*wt[k];
+           }
+       }
+       for (k=hl+1; k<=2*hl; k++) {
+           psseq=sseq+k*ENH_BLOCKL;
+           for(i=0;i<ENH_BLOCKL; i++) {
+               surround[i]+=psseq[i]*wt[k];
+           }
+       }
+       
+       /* compute some inner products */
+   
+       w00 = w10 = w11 = 0.0;
+       psseq=sseq+hl*ENH_BLOCKL; /* current block  */
+       for (i=0; i<ENH_BLOCKL;i++) {
+           w00+=psseq[i]*psseq[i];
+           w11+=surround[i]*surround[i];
+           w10+=surround[i]*psseq[i];
+       }
+       
+   
+   
+       if (fabs(w11) < 1.0) {
+           w11=1.0;
+       }
+       C = (float)sqrt( w00/w11);
+       
+       /* first try enhancement without power-constraint */
+   
+       errs=0.0;
+       psseq=sseq+hl*ENH_BLOCKL;
+       for (i=0; i<ENH_BLOCKL; i++) {
+           odata[i]=C*surround[i];
+           err=psseq[i]-odata[i];
+           errs+=err*err;
+       }
+       
+       /* if constraint violated by first try, add constraint */ 
+       
+       if (errs > alpha0 * w00) {
+           if ( w00 < 1) {
+               w00=1;
+           }
+           denom = (w11*w00-w10*w10)/(w00*w00);
+           
+           if (denom > 0.0001) { /* eliminates numerical problems 
+                                    for if smooth */
+               A = (float)sqrt( (alpha0- alpha0*alpha0/4)/denom);
+               B = -alpha0/2 - A * w10/w00;
+               B = B+1;
+           }
+           else { /* essentially no difference between cycles; 
+                     smoothing not needed */
+               A= 0.0;
+               B= 1.0;
+           }
+           
+           /* create smoothed sequence */
+   
+           psseq=sseq+hl*ENH_BLOCKL;
+           for (i=0; i<ENH_BLOCKL; i++) {
+               odata[i]=A*surround[i]+B*psseq[i];
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    * get the pitch-synchronous sample sequence
+    *---------------------------------------------------------------*/
+   
+   void getsseq(
+       float *sseq,    /* (o) the pitch-synchronous sequence */
+       float *idata,       /* (i) original data */
+       int idatal,         /* (i) dimension of data */
+       int centerStartPos, /* (i) where current block starts */
+       float *period,      /* (i) rough-pitch-period array */
+   
+   
+       float *plocs,       /* (i) where periods of period array 
+                                  are taken */
+       int periodl,    /* (i) dimension period array */
+       int hl              /* (i) 2*hl+1 is the number of sequences */
+   ){
+       int i,centerEndPos,q;
+       float blockStartPos[2*ENH_HL+1];
+       int lagBlock[2*ENH_HL+1];
+       float plocs2[ENH_PLOCSL]; 
+       float *psseq;
+   
+       centerEndPos=centerStartPos+ENH_BLOCKL-1;
+       
+       /* present */
+   
+       NearestNeighbor(lagBlock+hl,plocs,
+           (float)0.5*(centerStartPos+centerEndPos),periodl);
+       
+       blockStartPos[hl]=(float)centerStartPos;
+       psseq=sseq+ENH_BLOCKL*hl;
+       memcpy(psseq, idata+centerStartPos, ENH_BLOCKL*sizeof(float));
+       
+       /* past */
+   
+       for (q=hl-1; q>=0; q--) {
+           blockStartPos[q]=blockStartPos[q+1]-period[lagBlock[q+1]];
+           NearestNeighbor(lagBlock+q,plocs,
+               blockStartPos[q]+
+               ENH_BLOCKL_HALF-period[lagBlock[q+1]], periodl);
+                               
+           
+           if (blockStartPos[q]-ENH_OVERHANG>=0) {
+               refiner(sseq+q*ENH_BLOCKL, blockStartPos+q, idata,
+                   idatal, centerStartPos, blockStartPos[q],
+                   period[lagBlock[q+1]]);
+           } else {
+               psseq=sseq+q*ENH_BLOCKL;
+               memset(psseq, 0, ENH_BLOCKL*sizeof(float));
+           }
+       }
+       
+       /* future */
+   
+       for (i=0; i<periodl; i++) {
+           plocs2[i]=plocs[i]-period[i];
+       }
+       for (q=hl+1; q<=2*hl; q++) { 
+           NearestNeighbor(lagBlock+q,plocs2,
+               blockStartPos[q-1]+ENH_BLOCKL_HALF,periodl);
+   
+           blockStartPos[q]=blockStartPos[q-1]+period[lagBlock[q]];
+           if (blockStartPos[q]+ENH_BLOCKL+ENH_OVERHANG<idatal) {
+               refiner(sseq+ENH_BLOCKL*q, blockStartPos+q, idata,
+                   idatal, centerStartPos, blockStartPos[q],
+   
+   
+                   period[lagBlock[q]]);
+           }
+           else {
+               psseq=sseq+q*ENH_BLOCKL;
+               memset(psseq, 0, ENH_BLOCKL*sizeof(float));
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    * perform enhancement on idata+centerStartPos through 
+    * idata+centerStartPos+ENH_BLOCKL-1
+    *---------------------------------------------------------------*/
+   
+   void enhancer(
+       float *odata,       /* (o) smoothed block, dimension blockl */
+       float *idata,       /* (i) data buffer used for enhancing */
+       int idatal,         /* (i) dimension idata */
+       int centerStartPos, /* (i) first sample current block 
+                                  within idata */
+       float alpha0,       /* (i) max correction-energy-fraction 
+                                 (in [0,1]) */
+       float *period,      /* (i) pitch period array */
+       float *plocs,       /* (i) locations where period array 
+                                  values valid */
+       int periodl         /* (i) dimension of period and plocs */
+   ){
+       float sseq[(2*ENH_HL+1)*ENH_BLOCKL];
+   
+       /* get said second sequence of segments */
+   
+       getsseq(sseq,idata,idatal,centerStartPos,period,
+           plocs,periodl,ENH_HL);
+   
+       /* compute the smoothed output from said second sequence */
+   
+       smath(odata,sseq,ENH_HL,alpha0);
+   
+   }
+   
+   /*----------------------------------------------------------------*
+    * cross correlation
+    *---------------------------------------------------------------*/
+   
+   float xCorrCoef( 
+       float *target,      /* (i) first array */
+       float *regressor,   /* (i) second array */
+       int subl        /* (i) dimension arrays */
+   ){
+       int i;
+       float ftmp1, ftmp2;
+           
+       ftmp1 = 0.0;
+       ftmp2 = 0.0;
+   
+   
+       for (i=0; i<subl; i++) {
+           ftmp1 += target[i]*regressor[i];
+           ftmp2 += regressor[i]*regressor[i]; 
+       }
+       
+       if (ftmp1 > 0.0) {
+           return (float)(ftmp1*ftmp1/ftmp2);
+       }
+       else {
+           return (float)0.0;
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    * interface for enhancer
+    *---------------------------------------------------------------*/
+   
+   int enhancerInterface(
+       float *out,                     /* (o) enhanced signal */
+       float *in,                      /* (i) unenhanced signal */
+       iLBC_Dec_Inst_t *iLBCdec_inst   /* (i) buffers etc */
+   ){
+       float *enh_buf, *enh_period;
+       int iblock, isample;
+       int lag=0, ilag, i, ioffset;
+       float cc, maxcc;
+       float ftmp1, ftmp2;
+       float *inPtr, *enh_bufPtr1, *enh_bufPtr2;
+       float plc_pred[ENH_BLOCKL];
+   
+       float lpState[6], downsampled[(ENH_NBLOCKS*ENH_BLOCKL+120)/2];
+       int inLen=ENH_NBLOCKS*ENH_BLOCKL+120;
+       int start, plc_blockl, inlag;
+   
+       enh_buf=iLBCdec_inst->enh_buf;
+       enh_period=iLBCdec_inst->enh_period;
+       
+       memmove(enh_buf, &enh_buf[iLBCdec_inst->blockl], 
+           (ENH_BUFL-iLBCdec_inst->blockl)*sizeof(float));
+                                                               
+       memcpy(&enh_buf[ENH_BUFL-iLBCdec_inst->blockl], in, 
+           iLBCdec_inst->blockl*sizeof(float));
+   
+       if (iLBCdec_inst->mode==30)
+           plc_blockl=ENH_BLOCKL;
+       else
+           plc_blockl=40;
+   
+       /* when 20 ms frame, move processing one block */
+       ioffset=0;
+       if (iLBCdec_inst->mode==20) ioffset=1;
+   
+       i=3-ioffset;
+       memmove(enh_period, &enh_period[i], 
+   
+   
+           (ENH_NBLOCKS_TOT-i)*sizeof(float));
+   
+       /* Set state information to the 6 samples right before 
+          the samples to be downsampled. */
+   
+       memcpy(lpState, 
+           enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-126, 
+           6*sizeof(float));
+   
+       /* Down sample a factor 2 to save computations */
+   
+       DownSample(enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-120,
+                   lpFilt_coefsTbl, inLen-ioffset*ENH_BLOCKL,
+                   lpState, downsampled);
+   
+       /* Estimate the pitch in the down sampled domain. */
+       for (iblock = 0; iblock<ENH_NBLOCKS-ioffset; iblock++) {
+           
+           lag = 10;
+           maxcc = xCorrCoef(downsampled+60+iblock*
+               ENH_BLOCKL_HALF, downsampled+60+iblock*
+               ENH_BLOCKL_HALF-lag, ENH_BLOCKL_HALF);
+           for (ilag=11; ilag<60; ilag++) {
+               cc = xCorrCoef(downsampled+60+iblock*
+                   ENH_BLOCKL_HALF, downsampled+60+iblock*
+                   ENH_BLOCKL_HALF-ilag, ENH_BLOCKL_HALF);
+               
+               if (cc > maxcc) {
+                   maxcc = cc;
+                   lag = ilag;
+               }
+           }
+   
+           /* Store the estimated lag in the non-downsampled domain */
+           enh_period[iblock+ENH_NBLOCKS_EXTRA+ioffset] = (float)lag*2;
+
+
+       }   
+   
+   
+       /* PLC was performed on the previous packet */
+       if (iLBCdec_inst->prev_enh_pl==1) {
+   
+           inlag=(int)enh_period[ENH_NBLOCKS_EXTRA+ioffset];
+   
+           lag = inlag-1;
+           maxcc = xCorrCoef(in, in+lag, plc_blockl);
+           for (ilag=inlag; ilag<=inlag+1; ilag++) {
+               cc = xCorrCoef(in, in+ilag, plc_blockl);
+               
+               if (cc > maxcc) {
+                   maxcc = cc;
+                   lag = ilag;
+               }
+           }
+   
+   
+   
+           enh_period[ENH_NBLOCKS_EXTRA+ioffset-1]=(float)lag;
+   
+           /* compute new concealed residual for the old lookahead,
+              mix the forward PLC with a backward PLC from 
+              the new frame */
+           
+           inPtr=&in[lag-1];
+           
+           enh_bufPtr1=&plc_pred[plc_blockl-1];
+           
+           if (lag>plc_blockl) {
+               start=plc_blockl;
+           } else {
+               start=lag;
+           }
+   
+           for (isample = start; isample>0; isample--) {
+               *enh_bufPtr1-- = *inPtr--;
+           }
+           
+           enh_bufPtr2=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl];
+           for (isample = (plc_blockl-1-lag); isample>=0; isample--) 
+{
+               *enh_bufPtr1-- = *enh_bufPtr2--;
+           }
+   
+           /* limit energy change */
+           ftmp2=0.0;
+           ftmp1=0.0;
+           for (i=0;i<plc_blockl;i++) {
+               ftmp2+=enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]*
+                   enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i];
+               ftmp1+=plc_pred[i]*plc_pred[i];
+           }
+           ftmp1=(float)sqrt(ftmp1/(float)plc_blockl);
+           ftmp2=(float)sqrt(ftmp2/(float)plc_blockl);
+           if (ftmp1>(float)2.0*ftmp2 && ftmp1>0.0) {
+               for (i=0;i<plc_blockl-10;i++) {
+                   plc_pred[i]*=(float)2.0*ftmp2/ftmp1;
+               }
+               for (i=plc_blockl-10;i<plc_blockl;i++) {
+                   plc_pred[i]*=(float)(i-plc_blockl+10)*
+                       ((float)1.0-(float)2.0*ftmp2/ftmp1)/(float)(10)+
+                       (float)2.0*ftmp2/ftmp1;
+               }
+           }
+       
+           enh_bufPtr1=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl];
+           for (i=0; i<plc_blockl; i++) {
+               ftmp1 = (float) (i+1) / (float) (plc_blockl+1);
+               *enh_bufPtr1 *= ftmp1;
+               *enh_bufPtr1 += ((float)1.0-ftmp1)*
+                                   plc_pred[plc_blockl-1-i];
+               enh_bufPtr1--;
+           }
+   
+   
+       }
+   
+       if (iLBCdec_inst->mode==20) {
+           /* Enhancer with 40 samples delay */
+           for (iblock = 0; iblock<2; iblock++) {
+               enhancer(out+iblock*ENH_BLOCKL, enh_buf, 
+                   ENH_BUFL, (5+iblock)*ENH_BLOCKL+40,
+                   ENH_ALPHA0, enh_period, enh_plocsTbl, 
+                       ENH_NBLOCKS_TOT);
+           }
+       } else if (iLBCdec_inst->mode==30) {
+           /* Enhancer with 80 samples delay */
+           for (iblock = 0; iblock<3; iblock++) {
+               enhancer(out+iblock*ENH_BLOCKL, enh_buf, 
+                   ENH_BUFL, (4+iblock)*ENH_BLOCKL,
+                   ENH_ALPHA0, enh_period, enh_plocsTbl, 
+                       ENH_NBLOCKS_TOT);
+           }
+       }
+   
+       return (lag*2);
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/enhancer.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/enhancer.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/enhancer.h	Fri Sep 21 14:49:14 2007
@@ -1,33 +1,33 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       enhancer.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __ENHANCER_H
-   #define __ENHANCER_H
-   
-   #include "iLBC_define.h"
-   
-   float xCorrCoef( 
-       float *target,      /* (i) first array */
-       float *regressor,   /* (i) second array */
-       int subl        /* (i) dimension arrays */
-   );
-   
-   int enhancerInterface(
-       float *out,         /* (o) the enhanced recidual signal */
-       float *in,          /* (i) the recidual signal to enhance */
-       iLBC_Dec_Inst_t *iLBCdec_inst 
-                           /* (i/o) the decoder state structure */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       enhancer.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __ENHANCER_H
+   #define __ENHANCER_H
+   
+   #include "iLBC_define.h"
+   
+   float xCorrCoef( 
+       float *target,      /* (i) first array */
+       float *regressor,   /* (i) second array */
+       int subl        /* (i) dimension arrays */
+   );
+   
+   int enhancerInterface(
+       float *out,         /* (o) the enhanced recidual signal */
+       float *in,          /* (i) the recidual signal to enhance */
+       iLBC_Dec_Inst_t *iLBCdec_inst 
+                           /* (i/o) the decoder state structure */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/filter.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/filter.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/filter.c	Fri Sep 21 14:49:14 2007
@@ -1,167 +1,167 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       filter.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   
-   
-   #include "iLBC_define.h"
-   
-   /*----------------------------------------------------------------*
-    *  all-pole filter
-    *---------------------------------------------------------------*/
-   
-   void AllPoleFilter(
-       float *InOut,   /* (i/o) on entrance InOut[-orderCoef] to 
-                              InOut[-1] contain the state of the 
-                              filter (delayed samples). InOut[0] to 
-                              InOut[lengthInOut-1] contain the filter
-                              input, on en exit InOut[-orderCoef] to
-                              InOut[-1] is unchanged and InOut[0] to
-                              InOut[lengthInOut-1] contain filtered 
-                              samples */
-       float *Coef,/* (i) filter coefficients, Coef[0] is assumed 
-                              to be 1.0 */
-       int lengthInOut,/* (i) number of input/output samples */
-       int orderCoef   /* (i) number of filter coefficients */
-   ){  
-       int n,k;
-       
-       for(n=0;n<lengthInOut;n++){
-           for(k=1;k<=orderCoef;k++){
-               *InOut -= Coef[k]*InOut[-k];
-           }
-           InOut++;
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  all-zero filter                         
-    *---------------------------------------------------------------*/
-   
-   void AllZeroFilter(
-       float *In,      /* (i) In[0] to In[lengthInOut-1] contain 
-                              filter input samples */
-       float *Coef,/* (i) filter coefficients (Coef[0] is assumed 
-                              to be 1.0) */
-       int lengthInOut,/* (i) number of input/output samples */
-       int orderCoef,  /* (i) number of filter coefficients */
-       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
-                              contain the filter state, on exit Out[0]
-                              to Out[lengthInOut-1] contain filtered
-                              samples */
-   ){  
-       int n,k;
-       
-       for(n=0;n<lengthInOut;n++){
-           *Out = Coef[0]*In[0];
-           for(k=1;k<=orderCoef;k++){
-               *Out += Coef[k]*In[-k];
-           }
-   
-   
-           Out++;
-           In++;
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  pole-zero filter
-    *---------------------------------------------------------------*/
-   
-   void ZeroPoleFilter(
-       float *In,      /* (i) In[0] to In[lengthInOut-1] contain 
-                              filter input samples In[-orderCoef] to 
-                              In[-1] contain state of all-zero 
-                              section */
-       float *ZeroCoef,/* (i) filter coefficients for all-zero 
-                              section (ZeroCoef[0] is assumed to 
-                              be 1.0) */
-       float *PoleCoef,/* (i) filter coefficients for all-pole section
-                              (ZeroCoef[0] is assumed to be 1.0) */
-       int lengthInOut,/* (i) number of input/output samples */
-       int orderCoef,  /* (i) number of filter coefficients */
-       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
-                              contain state of all-pole section. On 
-                              exit Out[0] to Out[lengthInOut-1] 
-                              contain filtered samples */
-   ){
-       AllZeroFilter(In,ZeroCoef,lengthInOut,orderCoef,Out);
-       AllPoleFilter(Out,PoleCoef,lengthInOut,orderCoef);
-   }
-   
-   /*----------------------------------------------------------------*
-    * downsample (LP filter and decimation)
-    *---------------------------------------------------------------*/
-   
-   void DownSample (
-       float  *In,     /* (i) input samples */
-       float  *Coef,   /* (i) filter coefficients */
-       int lengthIn,   /* (i) number of input samples */ 
-       float  *state,  /* (i) filter state */
-       float  *Out     /* (o) downsampled output */
-   ){
-       float   o;
-       float *Out_ptr = Out;
-       float *Coef_ptr, *In_ptr;
-       float *state_ptr;
-       int i, j, stop;
-   
-       /* LP filter and decimate at the same time */
-   
-       for (i = DELAY_DS; i < lengthIn; i+=FACTOR_DS)
-       {
-           Coef_ptr = &Coef[0];
-           In_ptr = &In[i];
-           state_ptr = &state[FILTERORDER_DS-2];
-   
-   
-   
-           o = (float)0.0;
-           
-           stop = (i < FILTERORDER_DS) ? i + 1 : FILTERORDER_DS;
-   
-           for (j = 0; j < stop; j++) 
-           {
-               o += *Coef_ptr++ * (*In_ptr--);
-           }
-           for (j = i + 1; j < FILTERORDER_DS; j++) 
-           {
-               o += *Coef_ptr++ * (*state_ptr--);
-           }
-   
-           *Out_ptr++ = o;
-       }
-   
-       /* Get the last part (use zeros as input for the future) */
-   
-       for (i=(lengthIn+FACTOR_DS); i<(lengthIn+DELAY_DS); 
-               i+=FACTOR_DS) {
-   
-           o=(float)0.0;
-           
-           if (i<lengthIn) {
-               Coef_ptr = &Coef[0];
-               In_ptr = &In[i];
-               for (j=0; j<FILTERORDER_DS; j++) {
-                       o += *Coef_ptr++ * (*Out_ptr--);
-               }
-           } else {
-               Coef_ptr = &Coef[i-lengthIn];
-               In_ptr = &In[lengthIn-1];
-               for (j=0; j<FILTERORDER_DS-(i-lengthIn); j++) {
-                       o += *Coef_ptr++ * (*In_ptr--);
-               }
-           }
-           *Out_ptr++ = o;
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       filter.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   
+   
+   #include "iLBC_define.h"
+   
+   /*----------------------------------------------------------------*
+    *  all-pole filter
+    *---------------------------------------------------------------*/
+   
+   void AllPoleFilter(
+       float *InOut,   /* (i/o) on entrance InOut[-orderCoef] to 
+                              InOut[-1] contain the state of the 
+                              filter (delayed samples). InOut[0] to 
+                              InOut[lengthInOut-1] contain the filter
+                              input, on en exit InOut[-orderCoef] to
+                              InOut[-1] is unchanged and InOut[0] to
+                              InOut[lengthInOut-1] contain filtered 
+                              samples */
+       float *Coef,/* (i) filter coefficients, Coef[0] is assumed 
+                              to be 1.0 */
+       int lengthInOut,/* (i) number of input/output samples */
+       int orderCoef   /* (i) number of filter coefficients */
+   ){  
+       int n,k;
+       
+       for(n=0;n<lengthInOut;n++){
+           for(k=1;k<=orderCoef;k++){
+               *InOut -= Coef[k]*InOut[-k];
+           }
+           InOut++;
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  all-zero filter                         
+    *---------------------------------------------------------------*/
+   
+   void AllZeroFilter(
+       float *In,      /* (i) In[0] to In[lengthInOut-1] contain 
+                              filter input samples */
+       float *Coef,/* (i) filter coefficients (Coef[0] is assumed 
+                              to be 1.0) */
+       int lengthInOut,/* (i) number of input/output samples */
+       int orderCoef,  /* (i) number of filter coefficients */
+       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+                              contain the filter state, on exit Out[0]
+                              to Out[lengthInOut-1] contain filtered
+                              samples */
+   ){  
+       int n,k;
+       
+       for(n=0;n<lengthInOut;n++){
+           *Out = Coef[0]*In[0];
+           for(k=1;k<=orderCoef;k++){
+               *Out += Coef[k]*In[-k];
+           }
+   
+   
+           Out++;
+           In++;
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  pole-zero filter
+    *---------------------------------------------------------------*/
+   
+   void ZeroPoleFilter(
+       float *In,      /* (i) In[0] to In[lengthInOut-1] contain 
+                              filter input samples In[-orderCoef] to 
+                              In[-1] contain state of all-zero 
+                              section */
+       float *ZeroCoef,/* (i) filter coefficients for all-zero 
+                              section (ZeroCoef[0] is assumed to 
+                              be 1.0) */
+       float *PoleCoef,/* (i) filter coefficients for all-pole section
+                              (ZeroCoef[0] is assumed to be 1.0) */
+       int lengthInOut,/* (i) number of input/output samples */
+       int orderCoef,  /* (i) number of filter coefficients */
+       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+                              contain state of all-pole section. On 
+                              exit Out[0] to Out[lengthInOut-1] 
+                              contain filtered samples */
+   ){
+       AllZeroFilter(In,ZeroCoef,lengthInOut,orderCoef,Out);
+       AllPoleFilter(Out,PoleCoef,lengthInOut,orderCoef);
+   }
+   
+   /*----------------------------------------------------------------*
+    * downsample (LP filter and decimation)
+    *---------------------------------------------------------------*/
+   
+   void DownSample (
+       float  *In,     /* (i) input samples */
+       float  *Coef,   /* (i) filter coefficients */
+       int lengthIn,   /* (i) number of input samples */ 
+       float  *state,  /* (i) filter state */
+       float  *Out     /* (o) downsampled output */
+   ){
+       float   o;
+       float *Out_ptr = Out;
+       float *Coef_ptr, *In_ptr;
+       float *state_ptr;
+       int i, j, stop;
+   
+       /* LP filter and decimate at the same time */
+   
+       for (i = DELAY_DS; i < lengthIn; i+=FACTOR_DS)
+       {
+           Coef_ptr = &Coef[0];
+           In_ptr = &In[i];
+           state_ptr = &state[FILTERORDER_DS-2];
+   
+   
+   
+           o = (float)0.0;
+           
+           stop = (i < FILTERORDER_DS) ? i + 1 : FILTERORDER_DS;
+   
+           for (j = 0; j < stop; j++) 
+           {
+               o += *Coef_ptr++ * (*In_ptr--);
+           }
+           for (j = i + 1; j < FILTERORDER_DS; j++) 
+           {
+               o += *Coef_ptr++ * (*state_ptr--);
+           }
+   
+           *Out_ptr++ = o;
+       }
+   
+       /* Get the last part (use zeros as input for the future) */
+   
+       for (i=(lengthIn+FACTOR_DS); i<(lengthIn+DELAY_DS); 
+               i+=FACTOR_DS) {
+   
+           o=(float)0.0;
+           
+           if (i<lengthIn) {
+               Coef_ptr = &Coef[0];
+               In_ptr = &In[i];
+               for (j=0; j<FILTERORDER_DS; j++) {
+                       o += *Coef_ptr++ * (*Out_ptr--);
+               }
+           } else {
+               Coef_ptr = &Coef[i-lengthIn];
+               In_ptr = &In[lengthIn-1];
+               for (j=0; j<FILTERORDER_DS-(i-lengthIn); j++) {
+                       o += *Coef_ptr++ * (*In_ptr--);
+               }
+           }
+           *Out_ptr++ = o;
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/filter.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/filter.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/filter.h	Fri Sep 21 14:49:14 2007
@@ -1,73 +1,73 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       filter.h
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_FILTER_H
-   #define __iLBC_FILTER_H
-   
-   void AllPoleFilter(
-       float *InOut,   /* (i/o) on entrance InOut[-orderCoef] to 
-                              InOut[-1] contain the state of the 
-                              filter (delayed samples). InOut[0] to 
-                              InOut[lengthInOut-1] contain the filter 
-                              input, on en exit InOut[-orderCoef] to 
-                              InOut[-1] is unchanged and InOut[0] to 
-                              InOut[lengthInOut-1] contain filtered 
-                              samples */
-       float *Coef,/* (i) filter coefficients, Coef[0] is assumed 
-                              to be 1.0 */
-       int lengthInOut,/* (i) number of input/output samples */
-       int orderCoef   /* (i) number of filter coefficients */
-   );
-   
-   
-   
-   void AllZeroFilter(
-       float *In,      /* (i) In[0] to In[lengthInOut-1] contain 
-                              filter input samples */
-       float *Coef,/* (i) filter coefficients (Coef[0] is assumed 
-                              to be 1.0) */
-       int lengthInOut,/* (i) number of input/output samples */
-       int orderCoef,  /* (i) number of filter coefficients */
-       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
-                              contain the filter state, on exit Out[0] 
-                              to Out[lengthInOut-1] contain filtered 
-                              samples */
-   );
-   
-   void ZeroPoleFilter(
-       float *In,      /* (i) In[0] to In[lengthInOut-1] contain filter
-                              input samples In[-orderCoef] to In[-1] 
-                              contain state of all-zero section */
-       float *ZeroCoef,/* (i) filter coefficients for all-zero 
-                              section (ZeroCoef[0] is assumed to 
-                              be 1.0) */
-       float *PoleCoef,/* (i) filter coefficients for all-pole section
-                              (ZeroCoef[0] is assumed to be 1.0) */
-       int lengthInOut,/* (i) number of input/output samples */
-       int orderCoef,  /* (i) number of filter coefficients */
-       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
-                              contain state of all-pole section. On
-                              exit Out[0] to Out[lengthInOut-1] 
-                              contain filtered samples */
-   );
-   
-   void DownSample (
-       float  *In,     /* (i) input samples */
-       float  *Coef,   /* (i) filter coefficients */
-       int lengthIn,   /* (i) number of input samples */ 
-       float  *state,  /* (i) filter state */
-       float  *Out     /* (o) downsampled output */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       filter.h
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_FILTER_H
+   #define __iLBC_FILTER_H
+   
+   void AllPoleFilter(
+       float *InOut,   /* (i/o) on entrance InOut[-orderCoef] to 
+                              InOut[-1] contain the state of the 
+                              filter (delayed samples). InOut[0] to 
+                              InOut[lengthInOut-1] contain the filter 
+                              input, on en exit InOut[-orderCoef] to 
+                              InOut[-1] is unchanged and InOut[0] to 
+                              InOut[lengthInOut-1] contain filtered 
+                              samples */
+       float *Coef,/* (i) filter coefficients, Coef[0] is assumed 
+                              to be 1.0 */
+       int lengthInOut,/* (i) number of input/output samples */
+       int orderCoef   /* (i) number of filter coefficients */
+   );
+   
+   
+   
+   void AllZeroFilter(
+       float *In,      /* (i) In[0] to In[lengthInOut-1] contain 
+                              filter input samples */
+       float *Coef,/* (i) filter coefficients (Coef[0] is assumed 
+                              to be 1.0) */
+       int lengthInOut,/* (i) number of input/output samples */
+       int orderCoef,  /* (i) number of filter coefficients */
+       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+                              contain the filter state, on exit Out[0] 
+                              to Out[lengthInOut-1] contain filtered 
+                              samples */
+   );
+   
+   void ZeroPoleFilter(
+       float *In,      /* (i) In[0] to In[lengthInOut-1] contain filter
+                              input samples In[-orderCoef] to In[-1] 
+                              contain state of all-zero section */
+       float *ZeroCoef,/* (i) filter coefficients for all-zero 
+                              section (ZeroCoef[0] is assumed to 
+                              be 1.0) */
+       float *PoleCoef,/* (i) filter coefficients for all-pole section
+                              (ZeroCoef[0] is assumed to be 1.0) */
+       int lengthInOut,/* (i) number of input/output samples */
+       int orderCoef,  /* (i) number of filter coefficients */
+       float *Out      /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+                              contain state of all-pole section. On
+                              exit Out[0] to Out[lengthInOut-1] 
+                              contain filtered samples */
+   );
+   
+   void DownSample (
+       float  *In,     /* (i) input samples */
+       float  *Coef,   /* (i) filter coefficients */
+       int lengthIn,   /* (i) number of input samples */ 
+       float  *state,  /* (i) filter state */
+       float  *Out     /* (o) downsampled output */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/gainquant.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/gainquant.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/gainquant.c	Fri Sep 21 14:49:14 2007
@@ -1,106 +1,106 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       gainquant.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   
-   
-   ******************************************************************/
-   
-   #include <string.h>
-   #include <math.h>
-   #include "constants.h"
-   #include "filter.h"
-   
-   /*----------------------------------------------------------------*
-    *  quantizer for the gain in the gain-shape coding of residual
-    *---------------------------------------------------------------*/
-   
-   float gainquant(/* (o) quantized gain value */
-       float in,       /* (i) gain value */
-       float maxIn,/* (i) maximum of gain value */
-       int cblen,      /* (i) number of quantization indices */
-       int *index      /* (o) quantization index */
-   ){
-       int i, tindex;
-       float minmeasure,measure, *cb, scale;
-   
-       /* ensure a lower bound on the scaling factor */
-   
-       scale=maxIn;
-       
-       if (scale<0.1) {
-           scale=(float)0.1;
-       }
-   
-       /* select the quantization table */
-       
-       if (cblen == 8) {
-           cb = gain_sq3Tbl;
-       } else if (cblen == 16) {
-           cb = gain_sq4Tbl;
-       } else  {
-           cb = gain_sq5Tbl;
-       }
-   
-       /* select the best index in the quantization table */
-       
-       minmeasure=10000000.0;
-       tindex=0;
-       for (i=0; i<cblen; i++) {
-           measure=(in-scale*cb[i])*(in-scale*cb[i]);
-           
-           if (measure<minmeasure) {
-               tindex=i;
-               minmeasure=measure;
-           }
-       }
-       *index=tindex;
-          
-       /* return the quantized value */
-       
-   
-   
-       return scale*cb[tindex];
-   }
-   
-   /*----------------------------------------------------------------*
-    *  decoder for quantized gains in the gain-shape coding of 
-    *  residual                          
-    *---------------------------------------------------------------*/
-   
-   float gaindequant(  /* (o) quantized gain value */
-       int index,      /* (i) quantization index */
-       float maxIn,/* (i) maximum of unquantized gain */
-       int cblen       /* (i) number of quantization indices */
-   ){
-       float scale;
-   
-       /* obtain correct scale factor */
-   
-       scale=(float)fabs(maxIn);
-       
-       if (scale<0.1) {
-           scale=(float)0.1;
-       }
-   
-       /* select the quantization table and return the decoded value */
-   
-       if (cblen==8) {
-           return scale*gain_sq3Tbl[index];
-       } else if (cblen==16) {
-           return scale*gain_sq4Tbl[index];
-       }
-       else if (cblen==32) {
-           return scale*gain_sq5Tbl[index];
-       }
-   
-       return 0.0;
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       gainquant.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   
+   
+   ******************************************************************/
+   
+   #include <string.h>
+   #include <math.h>
+   #include "constants.h"
+   #include "filter.h"
+   
+   /*----------------------------------------------------------------*
+    *  quantizer for the gain in the gain-shape coding of residual
+    *---------------------------------------------------------------*/
+   
+   float gainquant(/* (o) quantized gain value */
+       float in,       /* (i) gain value */
+       float maxIn,/* (i) maximum of gain value */
+       int cblen,      /* (i) number of quantization indices */
+       int *index      /* (o) quantization index */
+   ){
+       int i, tindex;
+       float minmeasure,measure, *cb, scale;
+   
+       /* ensure a lower bound on the scaling factor */
+   
+       scale=maxIn;
+       
+       if (scale<0.1) {
+           scale=(float)0.1;
+       }
+   
+       /* select the quantization table */
+       
+       if (cblen == 8) {
+           cb = gain_sq3Tbl;
+       } else if (cblen == 16) {
+           cb = gain_sq4Tbl;
+       } else  {
+           cb = gain_sq5Tbl;
+       }
+   
+       /* select the best index in the quantization table */
+       
+       minmeasure=10000000.0;
+       tindex=0;
+       for (i=0; i<cblen; i++) {
+           measure=(in-scale*cb[i])*(in-scale*cb[i]);
+           
+           if (measure<minmeasure) {
+               tindex=i;
+               minmeasure=measure;
+           }
+       }
+       *index=tindex;
+          
+       /* return the quantized value */
+       
+   
+   
+       return scale*cb[tindex];
+   }
+   
+   /*----------------------------------------------------------------*
+    *  decoder for quantized gains in the gain-shape coding of 
+    *  residual                          
+    *---------------------------------------------------------------*/
+   
+   float gaindequant(  /* (o) quantized gain value */
+       int index,      /* (i) quantization index */
+       float maxIn,/* (i) maximum of unquantized gain */
+       int cblen       /* (i) number of quantization indices */
+   ){
+       float scale;
+   
+       /* obtain correct scale factor */
+   
+       scale=(float)fabs(maxIn);
+       
+       if (scale<0.1) {
+           scale=(float)0.1;
+       }
+   
+       /* select the quantization table and return the decoded value */
+   
+       if (cblen==8) {
+           return scale*gain_sq3Tbl[index];
+       } else if (cblen==16) {
+           return scale*gain_sq4Tbl[index];
+       }
+       else if (cblen==32) {
+           return scale*gain_sq5Tbl[index];
+       }
+   
+       return 0.0;
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/gainquant.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/gainquant.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/gainquant.h	Fri Sep 21 14:49:14 2007
@@ -1,31 +1,31 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       gainquant.h                                         
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_GAINQUANT_H
-   #define __iLBC_GAINQUANT_H
-   
-   float gainquant(/* (o) quantized gain value */
-       float in,       /* (i) gain value */
-       float maxIn,/* (i) maximum of gain value */
-       int cblen,      /* (i) number of quantization indices */
-       int *index      /* (o) quantization index */
-   );
-   
-   float gaindequant(  /* (o) quantized gain value */
-       int index,      /* (i) quantization index */
-       float maxIn,/* (i) maximum of unquantized gain */
-       int cblen       /* (i) number of quantization indices */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       gainquant.h                                         
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_GAINQUANT_H
+   #define __iLBC_GAINQUANT_H
+   
+   float gainquant(/* (o) quantized gain value */
+       float in,       /* (i) gain value */
+       float maxIn,/* (i) maximum of gain value */
+       int cblen,      /* (i) number of quantization indices */
+       int *index      /* (o) quantization index */
+   );
+   
+   float gaindequant(  /* (o) quantized gain value */
+       int index,      /* (i) quantization index */
+       float maxIn,/* (i) maximum of unquantized gain */
+       int cblen       /* (i) number of quantization indices */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/getCBvec.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/getCBvec.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/getCBvec.c	Fri Sep 21 14:49:14 2007
@@ -1,180 +1,180 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       getCBvec.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include "iLBC_define.h"
-   #include "constants.h"
-   #include <string.h>
-   
-   /*----------------------------------------------------------------*
-    *  Construct codebook vector for given index.
-    *---------------------------------------------------------------*/
-   
-   void getCBvec(
-       float *cbvec,   /* (o) Constructed codebook vector */
-       float *mem,     /* (i) Codebook buffer */
-       int index,      /* (i) Codebook index */
-       int lMem,       /* (i) Length of codebook buffer */
-       int cbveclen/* (i) Codebook vector length */
-   ){
-       int j, k, n, memInd, sFilt;
-       float tmpbuf[CB_MEML];
-       int base_size;
-       int ilow, ihigh;
-       float alfa, alfa1;
-   
-       /* Determine size of codebook sections */
-   
-       base_size=lMem-cbveclen+1;
-       
-       if (cbveclen==SUBL) {
-           base_size+=cbveclen/2;
-       }
-   
-       /* No filter -> First codebook section */
-   
-   
-       
-       if (index<lMem-cbveclen+1) {
-   
-           /* first non-interpolated vectors */
-   
-           k=index+cbveclen;
-           /* get vector */
-           memcpy(cbvec, mem+lMem-k, cbveclen*sizeof(float));
-   
-       } else if (index < base_size) {
-   
-           k=2*(index-(lMem-cbveclen+1))+cbveclen;
-       
-           ihigh=k/2;
-           ilow=ihigh-5;
-   
-           /* Copy first noninterpolated part */
-   
-           memcpy(cbvec, mem+lMem-k/2, ilow*sizeof(float));
-   
-           /* interpolation */
-   
-           alfa1=(float)0.2;
-           alfa=0.0;
-           for (j=ilow; j<ihigh; j++) {
-               cbvec[j]=((float)1.0-alfa)*mem[lMem-k/2+j]+
-                   alfa*mem[lMem-k+j];
-               alfa+=alfa1;
-           }
-   
-           /* Copy second noninterpolated part */
-   
-           memcpy(cbvec+ihigh, mem+lMem-k+ihigh, 
-               (cbveclen-ihigh)*sizeof(float));
-   
-       }
-   
-       /* Higher codebbok section based on filtering */
-   
-       else {
-   
-           /* first non-interpolated vectors */
-   
-           if (index-base_size<lMem-cbveclen+1) {
-               float tempbuff2[CB_MEML+CB_FILTERLEN+1];
-               float *pos;
-               float *pp, *pp1;
-   
-               memset(tempbuff2, 0,
-                   CB_HALFFILTERLEN*sizeof(float));
-               memcpy(&tempbuff2[CB_HALFFILTERLEN], mem,
-                   lMem*sizeof(float));
-               memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0,
-                   (CB_HALFFILTERLEN+1)*sizeof(float));
-   
-   
-   
-               k=index-base_size+cbveclen;
-               sFilt=lMem-k;
-               memInd=sFilt+1-CB_HALFFILTERLEN;
-   
-               /* do filtering */
-               pos=cbvec;
-               memset(pos, 0, cbveclen*sizeof(float));
-               for (n=0; n<cbveclen; n++) {
-                   pp=&tempbuff2[memInd+n+CB_HALFFILTERLEN];
-                   pp1=&cbfiltersTbl[CB_FILTERLEN-1];
-                   for (j=0; j<CB_FILTERLEN; j++) {
-                       (*pos)+=(*pp++)*(*pp1--);
-                   }
-                   pos++;
-               }
-           }
-   
-           /* interpolated vectors */
-   
-           else {
-               float tempbuff2[CB_MEML+CB_FILTERLEN+1];
-   
-               float *pos;
-               float *pp, *pp1;
-               int i;
-   
-               memset(tempbuff2, 0,
-                   CB_HALFFILTERLEN*sizeof(float));
-               memcpy(&tempbuff2[CB_HALFFILTERLEN], mem,
-                   lMem*sizeof(float));
-               memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0,
-                   (CB_HALFFILTERLEN+1)*sizeof(float));
-   
-               k=2*(index-base_size-
-                   (lMem-cbveclen+1))+cbveclen;
-               sFilt=lMem-k;
-               memInd=sFilt+1-CB_HALFFILTERLEN;
-   
-               /* do filtering */
-               pos=&tmpbuf[sFilt];
-               memset(pos, 0, k*sizeof(float));
-               for (i=0; i<k; i++) {
-                   pp=&tempbuff2[memInd+i+CB_HALFFILTERLEN];
-                   pp1=&cbfiltersTbl[CB_FILTERLEN-1];
-                   for (j=0; j<CB_FILTERLEN; j++) {
-                       (*pos)+=(*pp++)*(*pp1--);
-                   }
-                   pos++;
-               }
-   
-               ihigh=k/2;
-               ilow=ihigh-5;
-   
-   
-   
-               /* Copy first noninterpolated part */
-   
-               memcpy(cbvec, tmpbuf+lMem-k/2, 
-                   ilow*sizeof(float));
-   
-               /* interpolation */
-   
-               alfa1=(float)0.2;
-               alfa=0.0;
-               for (j=ilow; j<ihigh; j++) {
-                   cbvec[j]=((float)1.0-alfa)*
-                       tmpbuf[lMem-k/2+j]+alfa*tmpbuf[lMem-k+j];
-                   alfa+=alfa1;
-               }
-   
-               /* Copy second noninterpolated part */
-   
-               memcpy(cbvec+ihigh, tmpbuf+lMem-k+ihigh, 
-                   (cbveclen-ihigh)*sizeof(float));
-           }
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       getCBvec.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include "iLBC_define.h"
+   #include "constants.h"
+   #include <string.h>
+   
+   /*----------------------------------------------------------------*
+    *  Construct codebook vector for given index.
+    *---------------------------------------------------------------*/
+   
+   void getCBvec(
+       float *cbvec,   /* (o) Constructed codebook vector */
+       float *mem,     /* (i) Codebook buffer */
+       int index,      /* (i) Codebook index */
+       int lMem,       /* (i) Length of codebook buffer */
+       int cbveclen/* (i) Codebook vector length */
+   ){
+       int j, k, n, memInd, sFilt;
+       float tmpbuf[CB_MEML];
+       int base_size;
+       int ilow, ihigh;
+       float alfa, alfa1;
+   
+       /* Determine size of codebook sections */
+   
+       base_size=lMem-cbveclen+1;
+       
+       if (cbveclen==SUBL) {
+           base_size+=cbveclen/2;
+       }
+   
+       /* No filter -> First codebook section */
+   
+   
+       
+       if (index<lMem-cbveclen+1) {
+   
+           /* first non-interpolated vectors */
+   
+           k=index+cbveclen;
+           /* get vector */
+           memcpy(cbvec, mem+lMem-k, cbveclen*sizeof(float));
+   
+       } else if (index < base_size) {
+   
+           k=2*(index-(lMem-cbveclen+1))+cbveclen;
+       
+           ihigh=k/2;
+           ilow=ihigh-5;
+   
+           /* Copy first noninterpolated part */
+   
+           memcpy(cbvec, mem+lMem-k/2, ilow*sizeof(float));
+   
+           /* interpolation */
+   
+           alfa1=(float)0.2;
+           alfa=0.0;
+           for (j=ilow; j<ihigh; j++) {
+               cbvec[j]=((float)1.0-alfa)*mem[lMem-k/2+j]+
+                   alfa*mem[lMem-k+j];
+               alfa+=alfa1;
+           }
+   
+           /* Copy second noninterpolated part */
+   
+           memcpy(cbvec+ihigh, mem+lMem-k+ihigh, 
+               (cbveclen-ihigh)*sizeof(float));
+   
+       }
+   
+       /* Higher codebbok section based on filtering */
+   
+       else {
+   
+           /* first non-interpolated vectors */
+   
+           if (index-base_size<lMem-cbveclen+1) {
+               float tempbuff2[CB_MEML+CB_FILTERLEN+1];
+               float *pos;
+               float *pp, *pp1;
+   
+               memset(tempbuff2, 0,
+                   CB_HALFFILTERLEN*sizeof(float));
+               memcpy(&tempbuff2[CB_HALFFILTERLEN], mem,
+                   lMem*sizeof(float));
+               memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0,
+                   (CB_HALFFILTERLEN+1)*sizeof(float));
+   
+   
+   
+               k=index-base_size+cbveclen;
+               sFilt=lMem-k;
+               memInd=sFilt+1-CB_HALFFILTERLEN;
+   
+               /* do filtering */
+               pos=cbvec;
+               memset(pos, 0, cbveclen*sizeof(float));
+               for (n=0; n<cbveclen; n++) {
+                   pp=&tempbuff2[memInd+n+CB_HALFFILTERLEN];
+                   pp1=&cbfiltersTbl[CB_FILTERLEN-1];
+                   for (j=0; j<CB_FILTERLEN; j++) {
+                       (*pos)+=(*pp++)*(*pp1--);
+                   }
+                   pos++;
+               }
+           }
+   
+           /* interpolated vectors */
+   
+           else {
+               float tempbuff2[CB_MEML+CB_FILTERLEN+1];
+   
+               float *pos;
+               float *pp, *pp1;
+               int i;
+   
+               memset(tempbuff2, 0,
+                   CB_HALFFILTERLEN*sizeof(float));
+               memcpy(&tempbuff2[CB_HALFFILTERLEN], mem,
+                   lMem*sizeof(float));
+               memset(&tempbuff2[lMem+CB_HALFFILTERLEN], 0,
+                   (CB_HALFFILTERLEN+1)*sizeof(float));
+   
+               k=2*(index-base_size-
+                   (lMem-cbveclen+1))+cbveclen;
+               sFilt=lMem-k;
+               memInd=sFilt+1-CB_HALFFILTERLEN;
+   
+               /* do filtering */
+               pos=&tmpbuf[sFilt];
+               memset(pos, 0, k*sizeof(float));
+               for (i=0; i<k; i++) {
+                   pp=&tempbuff2[memInd+i+CB_HALFFILTERLEN];
+                   pp1=&cbfiltersTbl[CB_FILTERLEN-1];
+                   for (j=0; j<CB_FILTERLEN; j++) {
+                       (*pos)+=(*pp++)*(*pp1--);
+                   }
+                   pos++;
+               }
+   
+               ihigh=k/2;
+               ilow=ihigh-5;
+   
+   
+   
+               /* Copy first noninterpolated part */
+   
+               memcpy(cbvec, tmpbuf+lMem-k/2, 
+                   ilow*sizeof(float));
+   
+               /* interpolation */
+   
+               alfa1=(float)0.2;
+               alfa=0.0;
+               for (j=ilow; j<ihigh; j++) {
+                   cbvec[j]=((float)1.0-alfa)*
+                       tmpbuf[lMem-k/2+j]+alfa*tmpbuf[lMem-k+j];
+                   alfa+=alfa1;
+               }
+   
+               /* Copy second noninterpolated part */
+   
+               memcpy(cbvec+ihigh, tmpbuf+lMem-k+ihigh, 
+                   (cbveclen-ihigh)*sizeof(float));
+           }
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/getCBvec.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/getCBvec.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/getCBvec.h	Fri Sep 21 14:49:14 2007
@@ -1,28 +1,28 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       getCBvec.h                 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_GETCBVEC_H
-   #define __iLBC_GETCBVEC_H
-   
-   
-   
-   void getCBvec(
-       float *cbvec,   /* (o) Constructed codebook vector */
-       float *mem,     /* (i) Codebook buffer */
-       int index,      /* (i) Codebook index */
-       int lMem,       /* (i) Length of codebook buffer */
-       int cbveclen/* (i) Codebook vector length */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       getCBvec.h                 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_GETCBVEC_H
+   #define __iLBC_GETCBVEC_H
+   
+   
+   
+   void getCBvec(
+       float *cbvec,   /* (o) Constructed codebook vector */
+       float *mem,     /* (i) Codebook buffer */
+       int index,      /* (i) Codebook index */
+       int lMem,       /* (i) Length of codebook buffer */
+       int cbveclen/* (i) Codebook vector length */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/helpfun.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/helpfun.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/helpfun.c	Fri Sep 21 14:49:14 2007
@@ -1,307 +1,307 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       helpfun.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   
-   #include "iLBC_define.h"
-   #include "constants.h"
-   
-   /*----------------------------------------------------------------*
-    *  calculation of auto correlation 
-    *---------------------------------------------------------------*/
-   
-   void autocorr( 
-       float *r,       /* (o) autocorrelation vector */
-       const float *x, /* (i) data vector */
-       int N,          /* (i) length of data vector */
-       int order       /* largest lag for calculated 
-                          autocorrelations */
-   ){
-       int     lag, n;
-       float   sum;
-       
-       for (lag = 0; lag <= order; lag++) {
-           sum = 0;
-           for (n = 0; n < N - lag; n++) {
-               sum += x[n] * x[n+lag];
-           }
-           r[lag] = sum;
-       }
-   }
-   
-   
-   
-   /*----------------------------------------------------------------*
-    *  window multiplication  
-    *---------------------------------------------------------------*/
-   
-   void window( 
-       float *z,       /* (o) the windowed data */
-       const float *x, /* (i) the original data vector */
-       const float *y, /* (i) the window */
-       int N           /* (i) length of all vectors */
-   ){
-       int     i;
-       
-       for (i = 0; i < N; i++) {
-           z[i] = x[i] * y[i];
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  levinson-durbin solution for lpc coefficients
-    *---------------------------------------------------------------*/
-   
-   void levdurb( 
-       float *a,       /* (o) lpc coefficient vector starting 
-                              with 1.0 */
-       float *k,       /* (o) reflection coefficients */
-       float *r,       /* (i) autocorrelation vector */
-       int order       /* (i) order of lpc filter */
-   ){
-       float  sum, alpha;
-       int     m, m_h, i;
-   
-       a[0] = 1.0;
-       
-       if (r[0] < EPS) { /* if r[0] <= 0, set LPC coeff. to zero */
-           for (i = 0; i < order; i++) {
-               k[i] = 0;
-               a[i+1] = 0;
-           }   
-       } else {
-           a[1] = k[0] = -r[1]/r[0];
-           alpha = r[0] + r[1] * k[0];
-           for (m = 1; m < order; m++){
-               sum = r[m + 1];
-               for (i = 0; i < m; i++){
-                   sum += a[i+1] * r[m - i];
-               }
-               k[m] = -sum / alpha;
-               alpha += k[m] * sum;
-               m_h = (m + 1) >> 1;
-               for (i = 0; i < m_h; i++){
-                   sum = a[i+1] + k[m] * a[m - i];
-                   a[m - i] += k[m] * a[i+1];
-                   a[i+1] = sum;
-   
-   
-               }
-               a[m+1] = k[m];
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  interpolation between vectors 
-    *---------------------------------------------------------------*/
-   
-   void interpolate( 
-       float *out,      /* (o) the interpolated vector */
-       float *in1,     /* (i) the first vector for the 
-                              interpolation */
-       float *in2,     /* (i) the second vector for the 
-                              interpolation */
-       float coef,      /* (i) interpolation weights */
-       int length      /* (i) length of all vectors */
-   ){
-       int i;
-       float invcoef;
-   
-       invcoef = (float)1.0 - coef;
-       for (i = 0; i < length; i++) {
-           out[i] = coef * in1[i] + invcoef * in2[i];
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  lpc bandwidth expansion                   
-    *---------------------------------------------------------------*/
-   
-   void bwexpand( 
-       float *out,      /* (o) the bandwidth expanded lpc 
-                              coefficients */
-       float *in,      /* (i) the lpc coefficients before bandwidth 
-                              expansion */
-       float coef,     /* (i) the bandwidth expansion factor */
-       int length      /* (i) the length of lpc coefficient vectors */
-   ){
-       int i;
-       float  chirp;
-       
-       chirp = coef;
-       
-       out[0] = in[0];
-       for (i = 1; i < length; i++) {
-           out[i] = chirp * in[i];
-           chirp *= coef;
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  vector quantization 
-   
-   
-    *---------------------------------------------------------------*/
-   
-   void vq( 
-       float *Xq,      /* (o) the quantized vector */
-       int *index,     /* (o) the quantization index */
-       const float *CB,/* (i) the vector quantization codebook */
-       float *X,       /* (i) the vector to quantize */
-       int n_cb,       /* (i) the number of vectors in the codebook */
-       int dim         /* (i) the dimension of all vectors */
-   ){
-       int     i, j;
-       int     pos, minindex;
-       float   dist, tmp, mindist;
-   
-       pos = 0;
-       mindist = FLOAT_MAX;
-       minindex = 0;
-       for (j = 0; j < n_cb; j++) {
-           dist = X[0] - CB[pos];
-           dist *= dist;
-           for (i = 1; i < dim; i++) {
-               tmp = X[i] - CB[pos + i];
-               dist += tmp*tmp;
-           }
-           
-           if (dist < mindist) {
-               mindist = dist;
-               minindex = j;
-           }
-           pos += dim;
-       }
-       for (i = 0; i < dim; i++) {
-           Xq[i] = CB[minindex*dim + i];
-       }
-       *index = minindex;
-   }
-   
-   /*----------------------------------------------------------------*
-    *  split vector quantization 
-    *---------------------------------------------------------------*/
-   
-   void SplitVQ( 
-       float *qX,      /* (o) the quantized vector */
-       int *index,     /* (o) a vector of indexes for all vector
-                              codebooks in the split */
-       float *X,       /* (i) the vector to quantize */
-       const float *CB,/* (i) the quantizer codebook */
-       int nsplit,     /* the number of vector splits */
-       const int *dim, /* the dimension of X and qX */
-       const int *cbsize /* the number of vectors in the codebook */
-   ){
-       int    cb_pos, X_pos, i;
-       
-       cb_pos = 0;
-   
-   
-       X_pos= 0;
-       for (i = 0; i < nsplit; i++) {
-           vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos, 
-               cbsize[i], dim[i]);
-           X_pos += dim[i];
-           cb_pos += dim[i] * cbsize[i];
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  scalar quantization 
-    *---------------------------------------------------------------*/
-   
-   void sort_sq( 
-       float *xq,      /* (o) the quantized value */
-       int *index,     /* (o) the quantization index */
-       float x,    /* (i) the value to quantize */
-       const float *cb,/* (i) the quantization codebook */
-       int cb_size      /* (i) the size of the quantization codebook */
-   ){
-       int i;
-       
-       if (x <= cb[0]) {
-           *index = 0;
-           *xq = cb[0];
-       } else {
-           i = 0;
-           while ((x > cb[i]) && i < cb_size - 1) {
-               i++;
-           }
-           
-           if (x > ((cb[i] + cb[i - 1])/2)) {
-               *index = i;
-               *xq = cb[i];
-           } else {
-               *index = i - 1;
-               *xq = cb[i - 1];
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  check for stability of lsf coefficients
-    *---------------------------------------------------------------*/
-   
-   int LSF_check(    /* (o) 1 for stable lsf vectors and 0 for
-                              nonstable ones */
-       float *lsf,     /* (i) a table of lsf vectors */
-       int dim,    /* (i) the dimension of each lsf vector */
-       int NoAn    /* (i) the number of lsf vectors in the 
-                              table */
-   ){
-       int k,n,m, Nit=2, change=0,pos;
-       float tmp;
-   
-   
-       static float eps=(float)0.039; /* 50 Hz */
-       static float eps2=(float)0.0195;
-       static float maxlsf=(float)3.14; /* 4000 Hz */
-       static float minlsf=(float)0.01; /* 0 Hz */
-       
-       /* LSF separation check*/
-   
-       for (n=0; n<Nit; n++) { /* Run through a couple of times */
-           for (m=0; m<NoAn; m++) { /* Number of analyses per frame */
-               for (k=0; k<(dim-1); k++) {
-                   pos=m*dim+k;
-                   
-                   if ((lsf[pos+1]-lsf[pos])<eps) {
-                       
-                       if (lsf[pos+1]<lsf[pos]) {
-                           tmp=lsf[pos+1];
-                           lsf[pos+1]= lsf[pos]+eps2;
-                           lsf[pos]= lsf[pos+1]-eps2;
-                       } else {
-                           lsf[pos]-=eps2;
-                           lsf[pos+1]+=eps2;
-                       }
-                       change=1;
-                   }
-                   
-                   if (lsf[pos]<minlsf) { 
-                       lsf[pos]=minlsf;
-                       change=1;
-                   }
-                   
-                   if (lsf[pos]>maxlsf) { 
-                       lsf[pos]=maxlsf;
-                       change=1;
-                   }               
-               }
-           }
-       }
-       
-       return change;  
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       helpfun.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   
+   #include "iLBC_define.h"
+   #include "constants.h"
+   
+   /*----------------------------------------------------------------*
+    *  calculation of auto correlation 
+    *---------------------------------------------------------------*/
+   
+   void autocorr( 
+       float *r,       /* (o) autocorrelation vector */
+       const float *x, /* (i) data vector */
+       int N,          /* (i) length of data vector */
+       int order       /* largest lag for calculated 
+                          autocorrelations */
+   ){
+       int     lag, n;
+       float   sum;
+       
+       for (lag = 0; lag <= order; lag++) {
+           sum = 0;
+           for (n = 0; n < N - lag; n++) {
+               sum += x[n] * x[n+lag];
+           }
+           r[lag] = sum;
+       }
+   }
+   
+   
+   
+   /*----------------------------------------------------------------*
+    *  window multiplication  
+    *---------------------------------------------------------------*/
+   
+   void window( 
+       float *z,       /* (o) the windowed data */
+       const float *x, /* (i) the original data vector */
+       const float *y, /* (i) the window */
+       int N           /* (i) length of all vectors */
+   ){
+       int     i;
+       
+       for (i = 0; i < N; i++) {
+           z[i] = x[i] * y[i];
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  levinson-durbin solution for lpc coefficients
+    *---------------------------------------------------------------*/
+   
+   void levdurb( 
+       float *a,       /* (o) lpc coefficient vector starting 
+                              with 1.0 */
+       float *k,       /* (o) reflection coefficients */
+       float *r,       /* (i) autocorrelation vector */
+       int order       /* (i) order of lpc filter */
+   ){
+       float  sum, alpha;
+       int     m, m_h, i;
+   
+       a[0] = 1.0;
+       
+       if (r[0] < EPS) { /* if r[0] <= 0, set LPC coeff. to zero */
+           for (i = 0; i < order; i++) {
+               k[i] = 0;
+               a[i+1] = 0;
+           }   
+       } else {
+           a[1] = k[0] = -r[1]/r[0];
+           alpha = r[0] + r[1] * k[0];
+           for (m = 1; m < order; m++){
+               sum = r[m + 1];
+               for (i = 0; i < m; i++){
+                   sum += a[i+1] * r[m - i];
+               }
+               k[m] = -sum / alpha;
+               alpha += k[m] * sum;
+               m_h = (m + 1) >> 1;
+               for (i = 0; i < m_h; i++){
+                   sum = a[i+1] + k[m] * a[m - i];
+                   a[m - i] += k[m] * a[i+1];
+                   a[i+1] = sum;
+   
+   
+               }
+               a[m+1] = k[m];
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  interpolation between vectors 
+    *---------------------------------------------------------------*/
+   
+   void interpolate( 
+       float *out,      /* (o) the interpolated vector */
+       float *in1,     /* (i) the first vector for the 
+                              interpolation */
+       float *in2,     /* (i) the second vector for the 
+                              interpolation */
+       float coef,      /* (i) interpolation weights */
+       int length      /* (i) length of all vectors */
+   ){
+       int i;
+       float invcoef;
+   
+       invcoef = (float)1.0 - coef;
+       for (i = 0; i < length; i++) {
+           out[i] = coef * in1[i] + invcoef * in2[i];
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  lpc bandwidth expansion                   
+    *---------------------------------------------------------------*/
+   
+   void bwexpand( 
+       float *out,      /* (o) the bandwidth expanded lpc 
+                              coefficients */
+       float *in,      /* (i) the lpc coefficients before bandwidth 
+                              expansion */
+       float coef,     /* (i) the bandwidth expansion factor */
+       int length      /* (i) the length of lpc coefficient vectors */
+   ){
+       int i;
+       float  chirp;
+       
+       chirp = coef;
+       
+       out[0] = in[0];
+       for (i = 1; i < length; i++) {
+           out[i] = chirp * in[i];
+           chirp *= coef;
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  vector quantization 
+   
+   
+    *---------------------------------------------------------------*/
+   
+   void vq( 
+       float *Xq,      /* (o) the quantized vector */
+       int *index,     /* (o) the quantization index */
+       const float *CB,/* (i) the vector quantization codebook */
+       float *X,       /* (i) the vector to quantize */
+       int n_cb,       /* (i) the number of vectors in the codebook */
+       int dim         /* (i) the dimension of all vectors */
+   ){
+       int     i, j;
+       int     pos, minindex;
+       float   dist, tmp, mindist;
+   
+       pos = 0;
+       mindist = FLOAT_MAX;
+       minindex = 0;
+       for (j = 0; j < n_cb; j++) {
+           dist = X[0] - CB[pos];
+           dist *= dist;
+           for (i = 1; i < dim; i++) {
+               tmp = X[i] - CB[pos + i];
+               dist += tmp*tmp;
+           }
+           
+           if (dist < mindist) {
+               mindist = dist;
+               minindex = j;
+           }
+           pos += dim;
+       }
+       for (i = 0; i < dim; i++) {
+           Xq[i] = CB[minindex*dim + i];
+       }
+       *index = minindex;
+   }
+   
+   /*----------------------------------------------------------------*
+    *  split vector quantization 
+    *---------------------------------------------------------------*/
+   
+   void SplitVQ( 
+       float *qX,      /* (o) the quantized vector */
+       int *index,     /* (o) a vector of indexes for all vector
+                              codebooks in the split */
+       float *X,       /* (i) the vector to quantize */
+       const float *CB,/* (i) the quantizer codebook */
+       int nsplit,     /* the number of vector splits */
+       const int *dim, /* the dimension of X and qX */
+       const int *cbsize /* the number of vectors in the codebook */
+   ){
+       int    cb_pos, X_pos, i;
+       
+       cb_pos = 0;
+   
+   
+       X_pos= 0;
+       for (i = 0; i < nsplit; i++) {
+           vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos, 
+               cbsize[i], dim[i]);
+           X_pos += dim[i];
+           cb_pos += dim[i] * cbsize[i];
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  scalar quantization 
+    *---------------------------------------------------------------*/
+   
+   void sort_sq( 
+       float *xq,      /* (o) the quantized value */
+       int *index,     /* (o) the quantization index */
+       float x,    /* (i) the value to quantize */
+       const float *cb,/* (i) the quantization codebook */
+       int cb_size      /* (i) the size of the quantization codebook */
+   ){
+       int i;
+       
+       if (x <= cb[0]) {
+           *index = 0;
+           *xq = cb[0];
+       } else {
+           i = 0;
+           while ((x > cb[i]) && i < cb_size - 1) {
+               i++;
+           }
+           
+           if (x > ((cb[i] + cb[i - 1])/2)) {
+               *index = i;
+               *xq = cb[i];
+           } else {
+               *index = i - 1;
+               *xq = cb[i - 1];
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  check for stability of lsf coefficients
+    *---------------------------------------------------------------*/
+   
+   int LSF_check(    /* (o) 1 for stable lsf vectors and 0 for
+                              nonstable ones */
+       float *lsf,     /* (i) a table of lsf vectors */
+       int dim,    /* (i) the dimension of each lsf vector */
+       int NoAn    /* (i) the number of lsf vectors in the 
+                              table */
+   ){
+       int k,n,m, Nit=2, change=0,pos;
+       float tmp;
+   
+   
+       static float eps=(float)0.039; /* 50 Hz */
+       static float eps2=(float)0.0195;
+       static float maxlsf=(float)3.14; /* 4000 Hz */
+       static float minlsf=(float)0.01; /* 0 Hz */
+       
+       /* LSF separation check*/
+   
+       for (n=0; n<Nit; n++) { /* Run through a couple of times */
+           for (m=0; m<NoAn; m++) { /* Number of analyses per frame */
+               for (k=0; k<(dim-1); k++) {
+                   pos=m*dim+k;
+                   
+                   if ((lsf[pos+1]-lsf[pos])<eps) {
+                       
+                       if (lsf[pos+1]<lsf[pos]) {
+                           tmp=lsf[pos+1];
+                           lsf[pos+1]= lsf[pos]+eps2;
+                           lsf[pos]= lsf[pos+1]-eps2;
+                       } else {
+                           lsf[pos]-=eps2;
+                           lsf[pos+1]+=eps2;
+                       }
+                       change=1;
+                   }
+                   
+                   if (lsf[pos]<minlsf) { 
+                       lsf[pos]=minlsf;
+                       change=1;
+                   }
+                   
+                   if (lsf[pos]>maxlsf) { 
+                       lsf[pos]=maxlsf;
+                       change=1;
+                   }               
+               }
+           }
+       }
+       
+       return change;  
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/helpfun.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/helpfun.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/helpfun.h	Fri Sep 21 14:49:14 2007
@@ -1,101 +1,101 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       helpfun.h         
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_HELPFUN_H
-   #define __iLBC_HELPFUN_H
-   
-   void autocorr( 
-       float *r,       /* (o) autocorrelation vector */
-       const float *x, /* (i) data vector */
-       int N,          /* (i) length of data vector */
-       int order       /* largest lag for calculated 
-                          autocorrelations */
-   );
-   
-   void window( 
-       float *z,       /* (o) the windowed data */
-       const float *x, /* (i) the original data vector */
-       const float *y, /* (i) the window */
-       int N           /* (i) length of all vectors */
-   );
-   
-   
-   
-   void levdurb( 
-       float *a,       /* (o) lpc coefficient vector starting 
-                              with 1.0 */
-       float *k,       /* (o) reflection coefficients */
-       float *r,       /* (i) autocorrelation vector */
-       int order       /* (i) order of lpc filter */
-   );
-   
-   void interpolate( 
-       float *out,     /* (o) the interpolated vector */
-       float *in1,     /* (i) the first vector for the 
-                              interpolation */
-       float *in2,     /* (i) the second vector for the 
-                              interpolation */
-       float coef,     /* (i) interpolation weights */
-       int length      /* (i) length of all vectors */
-   );
-              
-   void bwexpand( 
-       float *out,     /* (o) the bandwidth expanded lpc 
-                              coefficients */
-       float *in,      /* (i) the lpc coefficients before bandwidth
-                              expansion */
-       float coef,     /* (i) the bandwidth expansion factor */
-       int length      /* (i) the length of lpc coefficient vectors */
-   );
-   
-   void vq( 
-       float *Xq,      /* (o) the quantized vector */
-       int *index,     /* (o) the quantization index */
-       const float *CB,/* (i) the vector quantization codebook */
-       float *X,       /* (i) the vector to quantize */
-       int n_cb,       /* (i) the number of vectors in the codebook */
-       int dim         /* (i) the dimension of all vectors */
-   );  
-   
-   void SplitVQ( 
-       float *qX,      /* (o) the quantized vector */
-       int *index,     /* (o) a vector of indexes for all vector
-                              codebooks in the split */
-       float *X,       /* (i) the vector to quantize */
-       const float *CB,/* (i) the quantizer codebook */
-       int nsplit,     /* the number of vector splits */
-       const int *dim, /* the dimension of X and qX */
-       const int *cbsize /* the number of vectors in the codebook */
-   );
-   
-   
-   void sort_sq( 
-       float *xq,      /* (o) the quantized value */
-       int *index,     /* (o) the quantization index */
-       float x,    /* (i) the value to quantize */
-       const float *cb,/* (i) the quantization codebook */
-   
-   
-       int cb_size     /* (i) the size of the quantization codebook */
-   );
-   
-   int LSF_check(      /* (o) 1 for stable lsf vectors and 0 for 
-                              nonstable ones */
-       float *lsf,     /* (i) a table of lsf vectors */
-       int dim,    /* (i) the dimension of each lsf vector */
-       int NoAn    /* (i) the number of lsf vectors in the 
-                              table */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       helpfun.h         
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_HELPFUN_H
+   #define __iLBC_HELPFUN_H
+   
+   void autocorr( 
+       float *r,       /* (o) autocorrelation vector */
+       const float *x, /* (i) data vector */
+       int N,          /* (i) length of data vector */
+       int order       /* largest lag for calculated 
+                          autocorrelations */
+   );
+   
+   void window( 
+       float *z,       /* (o) the windowed data */
+       const float *x, /* (i) the original data vector */
+       const float *y, /* (i) the window */
+       int N           /* (i) length of all vectors */
+   );
+   
+   
+   
+   void levdurb( 
+       float *a,       /* (o) lpc coefficient vector starting 
+                              with 1.0 */
+       float *k,       /* (o) reflection coefficients */
+       float *r,       /* (i) autocorrelation vector */
+       int order       /* (i) order of lpc filter */
+   );
+   
+   void interpolate( 
+       float *out,     /* (o) the interpolated vector */
+       float *in1,     /* (i) the first vector for the 
+                              interpolation */
+       float *in2,     /* (i) the second vector for the 
+                              interpolation */
+       float coef,     /* (i) interpolation weights */
+       int length      /* (i) length of all vectors */
+   );
+              
+   void bwexpand( 
+       float *out,     /* (o) the bandwidth expanded lpc 
+                              coefficients */
+       float *in,      /* (i) the lpc coefficients before bandwidth
+                              expansion */
+       float coef,     /* (i) the bandwidth expansion factor */
+       int length      /* (i) the length of lpc coefficient vectors */
+   );
+   
+   void vq( 
+       float *Xq,      /* (o) the quantized vector */
+       int *index,     /* (o) the quantization index */
+       const float *CB,/* (i) the vector quantization codebook */
+       float *X,       /* (i) the vector to quantize */
+       int n_cb,       /* (i) the number of vectors in the codebook */
+       int dim         /* (i) the dimension of all vectors */
+   );  
+   
+   void SplitVQ( 
+       float *qX,      /* (o) the quantized vector */
+       int *index,     /* (o) a vector of indexes for all vector
+                              codebooks in the split */
+       float *X,       /* (i) the vector to quantize */
+       const float *CB,/* (i) the quantizer codebook */
+       int nsplit,     /* the number of vector splits */
+       const int *dim, /* the dimension of X and qX */
+       const int *cbsize /* the number of vectors in the codebook */
+   );
+   
+   
+   void sort_sq( 
+       float *xq,      /* (o) the quantized value */
+       int *index,     /* (o) the quantization index */
+       float x,    /* (i) the value to quantize */
+       const float *cb,/* (i) the quantization codebook */
+   
+   
+       int cb_size     /* (i) the size of the quantization codebook */
+   );
+   
+   int LSF_check(      /* (o) 1 for stable lsf vectors and 0 for 
+                              nonstable ones */
+       float *lsf,     /* (i) a table of lsf vectors */
+       int dim,    /* (i) the dimension of each lsf vector */
+       int NoAn    /* (i) the number of lsf vectors in the 
+                              table */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/hpInput.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/hpInput.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/hpInput.c	Fri Sep 21 14:49:14 2007
@@ -1,59 +1,59 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       hpInput.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include "constants.h"
-   
-   /*----------------------------------------------------------------*
-    *  Input high-pass filter                          
-    *---------------------------------------------------------------*/
-   
-   void hpInput( 
-       float *In,  /* (i) vector to filter */
-       int len,    /* (i) length of vector to filter */
-       float *Out, /* (o) the resulting filtered vector */
-       float *mem  /* (i/o) the filter state */
-   ){
-       int i;
-       float *pi, *po;
-   
-       /* all-zero section*/
-   
-       pi = &In[0];
-       po = &Out[0];
-       for (i=0; i<len; i++) {
-           *po = hpi_zero_coefsTbl[0] * (*pi);
-           *po += hpi_zero_coefsTbl[1] * mem[0];
-           *po += hpi_zero_coefsTbl[2] * mem[1];
-   
-           mem[1] = mem[0];
-           mem[0] = *pi;
-           po++;
-   
-   
-           pi++;
-   
-       }
-   
-       /* all-pole section*/
-   
-       po = &Out[0];
-       for (i=0; i<len; i++) {
-           *po -= hpi_pole_coefsTbl[1] * mem[2];
-           *po -= hpi_pole_coefsTbl[2] * mem[3];
-   
-           mem[3] = mem[2];
-           mem[2] = *po;
-           po++;
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       hpInput.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include "constants.h"
+   
+   /*----------------------------------------------------------------*
+    *  Input high-pass filter                          
+    *---------------------------------------------------------------*/
+   
+   void hpInput( 
+       float *In,  /* (i) vector to filter */
+       int len,    /* (i) length of vector to filter */
+       float *Out, /* (o) the resulting filtered vector */
+       float *mem  /* (i/o) the filter state */
+   ){
+       int i;
+       float *pi, *po;
+   
+       /* all-zero section*/
+   
+       pi = &In[0];
+       po = &Out[0];
+       for (i=0; i<len; i++) {
+           *po = hpi_zero_coefsTbl[0] * (*pi);
+           *po += hpi_zero_coefsTbl[1] * mem[0];
+           *po += hpi_zero_coefsTbl[2] * mem[1];
+   
+           mem[1] = mem[0];
+           mem[0] = *pi;
+           po++;
+   
+   
+           pi++;
+   
+       }
+   
+       /* all-pole section*/
+   
+       po = &Out[0];
+       for (i=0; i<len; i++) {
+           *po -= hpi_pole_coefsTbl[1] * mem[2];
+           *po -= hpi_pole_coefsTbl[2] * mem[3];
+   
+           mem[3] = mem[2];
+           mem[2] = *po;
+           po++;
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/hpInput.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/hpInput.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/hpInput.h	Fri Sep 21 14:49:14 2007
@@ -1,27 +1,27 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       hpInput.h        
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   
-   
-   #ifndef __iLBC_HPINPUT_H
-   #define __iLBC_HPINPUT_H
-   
-   void hpInput( 
-       float *In,  /* (i) vector to filter */
-       int len,    /* (i) length of vector to filter */
-       float *Out, /* (o) the resulting filtered vector */
-       float *mem  /* (i/o) the filter state */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       hpInput.h        
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   
+   
+   #ifndef __iLBC_HPINPUT_H
+   #define __iLBC_HPINPUT_H
+   
+   void hpInput( 
+       float *In,  /* (i) vector to filter */
+       int len,    /* (i) length of vector to filter */
+       float *Out, /* (o) the resulting filtered vector */
+       float *mem  /* (i/o) the filter state */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/hpOutput.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/hpOutput.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/hpOutput.c	Fri Sep 21 14:49:14 2007
@@ -1,59 +1,59 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       hpOutput.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   
-   
-   ******************************************************************/
-   
-   #include "constants.h"
-   
-   /*----------------------------------------------------------------*
-    *  Output high-pass filter                          
-    *---------------------------------------------------------------*/
-   
-   void hpOutput(
-       float *In,  /* (i) vector to filter */
-       int len,/* (i) length of vector to filter */
-       float *Out, /* (o) the resulting filtered vector */
-       float *mem  /* (i/o) the filter state */
-   ){
-       int i;
-       float *pi, *po;
-   
-       /* all-zero section*/
-   
-       pi = &In[0];
-       po = &Out[0];
-       for (i=0; i<len; i++) {
-           *po = hpo_zero_coefsTbl[0] * (*pi);
-           *po += hpo_zero_coefsTbl[1] * mem[0];
-           *po += hpo_zero_coefsTbl[2] * mem[1];
-   
-           mem[1] = mem[0];
-           mem[0] = *pi;
-           po++;
-           pi++;
-   
-       }
-   
-       /* all-pole section*/
-   
-       po = &Out[0];
-       for (i=0; i<len; i++) {
-           *po -= hpo_pole_coefsTbl[1] * mem[2];
-           *po -= hpo_pole_coefsTbl[2] * mem[3];
-   
-           mem[3] = mem[2];
-           mem[2] = *po;
-           po++;
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       hpOutput.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   
+   
+   ******************************************************************/
+   
+   #include "constants.h"
+   
+   /*----------------------------------------------------------------*
+    *  Output high-pass filter                          
+    *---------------------------------------------------------------*/
+   
+   void hpOutput(
+       float *In,  /* (i) vector to filter */
+       int len,/* (i) length of vector to filter */
+       float *Out, /* (o) the resulting filtered vector */
+       float *mem  /* (i/o) the filter state */
+   ){
+       int i;
+       float *pi, *po;
+   
+       /* all-zero section*/
+   
+       pi = &In[0];
+       po = &Out[0];
+       for (i=0; i<len; i++) {
+           *po = hpo_zero_coefsTbl[0] * (*pi);
+           *po += hpo_zero_coefsTbl[1] * mem[0];
+           *po += hpo_zero_coefsTbl[2] * mem[1];
+   
+           mem[1] = mem[0];
+           mem[0] = *pi;
+           po++;
+           pi++;
+   
+       }
+   
+       /* all-pole section*/
+   
+       po = &Out[0];
+       for (i=0; i<len; i++) {
+           *po -= hpo_pole_coefsTbl[1] * mem[2];
+           *po -= hpo_pole_coefsTbl[2] * mem[3];
+   
+           mem[3] = mem[2];
+           mem[2] = *po;
+           po++;
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/hpOutput.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/hpOutput.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/hpOutput.h	Fri Sep 21 14:49:14 2007
@@ -1,25 +1,25 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       hpOutput.h       
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_HPOUTPUT_H
-   #define __iLBC_HPOUTPUT_H
-   
-   void hpOutput(
-       float *In,  /* (i) vector to filter */
-       int len,/* (i) length of vector to filter */
-       float *Out, /* (o) the resulting filtered vector */
-       float *mem  /* (i/o) the filter state */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       hpOutput.h       
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_HPOUTPUT_H
+   #define __iLBC_HPOUTPUT_H
+   
+   void hpOutput(
+       float *In,  /* (i) vector to filter */
+       int len,/* (i) length of vector to filter */
+       float *Out, /* (o) the resulting filtered vector */
+       float *mem  /* (i/o) the filter state */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.c	Fri Sep 21 14:49:14 2007
@@ -1,107 +1,107 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       iCBConstruct.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   
-   #include "iLBC_define.h"
-   #include "gainquant.h"
-   #include "getCBvec.h"
-   
-   /*----------------------------------------------------------------*
-    *  Convert the codebook indexes to make the search easier
-    *---------------------------------------------------------------*/
-   
-   
-   
-   void index_conv_enc(
-       int *index          /* (i/o) Codebook indexes */
-   ){
-       int k;
-   
-       for (k=1; k<CB_NSTAGES; k++) {
-           
-           if ((index[k]>=108)&&(index[k]<172)) {
-               index[k]-=64;
-           } else if (index[k]>=236) {
-               index[k]-=128;
-           } else {
-               /* ERROR */
-           }
-       }
-   }
-   
-   void index_conv_dec(
-       int *index          /* (i/o) Codebook indexes */
-   ){
-       int k;
-   
-       for (k=1; k<CB_NSTAGES; k++) {
-           
-           if ((index[k]>=44)&&(index[k]<108)) {
-               index[k]+=64;
-           } else if ((index[k]>=108)&&(index[k]<128)) {
-               index[k]+=128;
-           } else {
-               /* ERROR */
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  Construct decoded vector from codebook and gains.
-    *---------------------------------------------------------------*/
-   
-   void iCBConstruct(
-       float *decvector,   /* (o) Decoded vector */
-       int *index,         /* (i) Codebook indices */
-       int *gain_index,/* (i) Gain quantization indices */
-       float *mem,         /* (i) Buffer for codevector construction */
-       int lMem,           /* (i) Length of buffer */
-       int veclen,         /* (i) Length of vector */
-       int nStages         /* (i) Number of codebook stages */
-   ){
-       int j,k;
-       float gain[CB_NSTAGES];
-       float cbvec[SUBL];
-   
-       /* gain de-quantization */
-   
-       gain[0] = gaindequant(gain_index[0], 1.0, 32);
-   
-   
-       if (nStages > 1) {
-           gain[1] = gaindequant(gain_index[1], 
-               (float)fabs(gain[0]), 16);  
-       }
-       if (nStages > 2) {
-           gain[2] = gaindequant(gain_index[2], 
-               (float)fabs(gain[1]), 8);
-       }
-   
-       /* codebook vector construction and construction of 
-       total vector */
-   
-       getCBvec(cbvec, mem, index[0], lMem, veclen);
-       for (j=0;j<veclen;j++){
-           decvector[j] = gain[0]*cbvec[j];
-       }
-       if (nStages > 1) {
-           for (k=1; k<nStages; k++) {
-               getCBvec(cbvec, mem, index[k], lMem, veclen);
-               for (j=0;j<veclen;j++) {
-                   decvector[j] += gain[k]*cbvec[j];
-               }
-           }
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       iCBConstruct.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   
+   #include "iLBC_define.h"
+   #include "gainquant.h"
+   #include "getCBvec.h"
+   
+   /*----------------------------------------------------------------*
+    *  Convert the codebook indexes to make the search easier
+    *---------------------------------------------------------------*/
+   
+   
+   
+   void index_conv_enc(
+       int *index          /* (i/o) Codebook indexes */
+   ){
+       int k;
+   
+       for (k=1; k<CB_NSTAGES; k++) {
+           
+           if ((index[k]>=108)&&(index[k]<172)) {
+               index[k]-=64;
+           } else if (index[k]>=236) {
+               index[k]-=128;
+           } else {
+               /* ERROR */
+           }
+       }
+   }
+   
+   void index_conv_dec(
+       int *index          /* (i/o) Codebook indexes */
+   ){
+       int k;
+   
+       for (k=1; k<CB_NSTAGES; k++) {
+           
+           if ((index[k]>=44)&&(index[k]<108)) {
+               index[k]+=64;
+           } else if ((index[k]>=108)&&(index[k]<128)) {
+               index[k]+=128;
+           } else {
+               /* ERROR */
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  Construct decoded vector from codebook and gains.
+    *---------------------------------------------------------------*/
+   
+   void iCBConstruct(
+       float *decvector,   /* (o) Decoded vector */
+       int *index,         /* (i) Codebook indices */
+       int *gain_index,/* (i) Gain quantization indices */
+       float *mem,         /* (i) Buffer for codevector construction */
+       int lMem,           /* (i) Length of buffer */
+       int veclen,         /* (i) Length of vector */
+       int nStages         /* (i) Number of codebook stages */
+   ){
+       int j,k;
+       float gain[CB_NSTAGES];
+       float cbvec[SUBL];
+   
+       /* gain de-quantization */
+   
+       gain[0] = gaindequant(gain_index[0], 1.0, 32);
+   
+   
+       if (nStages > 1) {
+           gain[1] = gaindequant(gain_index[1], 
+               (float)fabs(gain[0]), 16);  
+       }
+       if (nStages > 2) {
+           gain[2] = gaindequant(gain_index[2], 
+               (float)fabs(gain[1]), 8);
+       }
+   
+       /* codebook vector construction and construction of 
+       total vector */
+   
+       getCBvec(cbvec, mem, index[0], lMem, veclen);
+       for (j=0;j<veclen;j++){
+           decvector[j] = gain[0]*cbvec[j];
+       }
+       if (nStages > 1) {
+           for (k=1; k<nStages; k++) {
+               getCBvec(cbvec, mem, index[k], lMem, veclen);
+               for (j=0;j<veclen;j++) {
+                   decvector[j] += gain[k]*cbvec[j];
+               }
+           }
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iCBConstruct.h	Fri Sep 21 14:49:14 2007
@@ -1,38 +1,38 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-   
-   
-       iCBConstruct.h   
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_ICBCONSTRUCT_H
-   #define __iLBC_ICBCONSTRUCT_H
-   
-   void index_conv_enc(
-       int *index          /* (i/o) Codebook indexes */
-   );
-   
-   void index_conv_dec(
-       int *index          /* (i/o) Codebook indexes */
-   );
-   
-   void iCBConstruct(
-       float *decvector,   /* (o) Decoded vector */
-       int *index,         /* (i) Codebook indices */
-       int *gain_index,/* (i) Gain quantization indices */
-       float *mem,         /* (i) Buffer for codevector construction */
-       int lMem,           /* (i) Length of buffer */
-       int veclen,         /* (i) Length of vector */
-       int nStages         /* (i) Number of codebook stages */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+   
+   
+       iCBConstruct.h   
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_ICBCONSTRUCT_H
+   #define __iLBC_ICBCONSTRUCT_H
+   
+   void index_conv_enc(
+       int *index          /* (i/o) Codebook indexes */
+   );
+   
+   void index_conv_dec(
+       int *index          /* (i/o) Codebook indexes */
+   );
+   
+   void iCBConstruct(
+       float *decvector,   /* (o) Decoded vector */
+       int *index,         /* (i) Codebook indices */
+       int *gain_index,/* (i) Gain quantization indices */
+       float *mem,         /* (i) Buffer for codevector construction */
+       int lMem,           /* (i) Length of buffer */
+       int veclen,         /* (i) Length of vector */
+       int nStages         /* (i) Number of codebook stages */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.c	Fri Sep 21 14:49:14 2007
@@ -1,477 +1,477 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       iCBSearch.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <string.h>
-   
-   #include "iLBC_define.h"
-   #include "gainquant.h"
-   #include "createCB.h"
-   #include "filter.h"
-   #include "constants.h"
-   
-   /*----------------------------------------------------------------*
-    *  Search routine for codebook encoding and gain quantization.
-    *---------------------------------------------------------------*/
-   
-   void iCBSearch(
-       iLBC_Enc_Inst_t *iLBCenc_inst, 
-                           /* (i) the encoder state structure */
-       int *index,         /* (o) Codebook indices */
-       int *gain_index,/* (o) Gain quantization indices */
-       float *intarget,/* (i) Target vector for encoding */    
-       float *mem,         /* (i) Buffer for codebook construction */
-       int lMem,           /* (i) Length of buffer */
-       int lTarget,    /* (i) Length of vector */
-       int nStages,    /* (i) Number of codebook stages */
-       float *weightDenum, /* (i) weighting filter coefficients */
-       float *weightState, /* (i) weighting filter state */
-       int block           /* (i) the sub-block number */
-   ){
-       int i, j, icount, stage, best_index, range, counter;
-       float max_measure, gain, measure, crossDot, ftmp;
-       float gains[CB_NSTAGES];
-       float target[SUBL];
-       int base_index, sInd, eInd, base_size;
-       int sIndAug=0, eIndAug=0;
-       float buf[CB_MEML+SUBL+2*LPC_FILTERORDER];
-   
-   
-       float invenergy[CB_EXPAND*128], energy[CB_EXPAND*128];
-       float *pp, *ppi=0, *ppo=0, *ppe=0;
-       float cbvectors[CB_MEML];
-       float tene, cene, cvec[SUBL];
-       float aug_vec[SUBL];
-   
-       memset(cvec,0,SUBL*sizeof(float));  
-   
-       /* Determine size of codebook sections */
-   
-       base_size=lMem-lTarget+1;
-       
-       if (lTarget==SUBL) {
-           base_size=lMem-lTarget+1+lTarget/2;
-       }
-   
-       /* setup buffer for weighting */
-   
-       memcpy(buf,weightState,sizeof(float)*LPC_FILTERORDER);
-       memcpy(buf+LPC_FILTERORDER,mem,lMem*sizeof(float));
-       memcpy(buf+LPC_FILTERORDER+lMem,intarget,lTarget*sizeof(float));
-   
-       /* weighting */
-   
-       AllPoleFilter(buf+LPC_FILTERORDER, weightDenum, 
-           lMem+lTarget, LPC_FILTERORDER);
-       
-       /* Construct the codebook and target needed */
-   
-       memcpy(target, buf+LPC_FILTERORDER+lMem, lTarget*sizeof(float));
-   
-       tene=0.0;
-       for (i=0; i<lTarget; i++) {
-           tene+=target[i]*target[i];
-       }
-   
-       /* Prepare search over one more codebook section. This section 
-          is created by filtering the original buffer with a filter. */
-           
-       filteredCBvecs(cbvectors, buf+LPC_FILTERORDER, lMem);
-   
-       /* The Main Loop over stages */
-   
-       for (stage=0; stage<nStages; stage++) {
-   
-           range = search_rangeTbl[block][stage];
-   
-           /* initialize search measure */
-   
-           max_measure = (float)-10000000.0;
-           gain = (float)0.0;
-           best_index = 0;
-   
-           /* Compute cross dot product between the target 
-   
-   
-              and the CB memory */
-   
-           crossDot=0.0;
-           pp=buf+LPC_FILTERORDER+lMem-lTarget;
-           for (j=0; j<lTarget; j++) {
-               crossDot += target[j]*(*pp++);
-           }       
-           
-           if (stage==0) {
-   
-               /* Calculate energy in the first block of 
-                 'lTarget' sampels. */
-               ppe = energy;
-               ppi = buf+LPC_FILTERORDER+lMem-lTarget-1;
-               ppo = buf+LPC_FILTERORDER+lMem-1;
-   
-               *ppe=0.0;
-               pp=buf+LPC_FILTERORDER+lMem-lTarget;
-               for (j=0; j<lTarget; j++) {
-                   *ppe+=(*pp)*(*pp++);
-               }
-               
-               if (*ppe>0.0) {
-                   invenergy[0] = (float) 1.0 / (*ppe + EPS);
-               } else {
-                   invenergy[0] = (float) 0.0; 
-               }
-               ppe++;
-   
-               measure=(float)-10000000.0; 
-               
-               if (crossDot > 0.0) {
-                      measure = crossDot*crossDot*invenergy[0];
-               }
-           }
-           else {
-               measure = crossDot*crossDot*invenergy[0];
-           }
-   
-           /* check if measure is better */
-           ftmp = crossDot*invenergy[0];
-           
-           if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
-               best_index = 0;
-               max_measure = measure;
-               gain = ftmp;
-           }
-   
-           /* loop over the main first codebook section, 
-              full search */
-   
-           for (icount=1; icount<range; icount++) {
-   
-               /* calculate measure */
-   
-   
-   
-               crossDot=0.0;
-               pp = buf+LPC_FILTERORDER+lMem-lTarget-icount;
-   
-               for (j=0; j<lTarget; j++) {
-                   crossDot += target[j]*(*pp++);
-               }
-               
-               if (stage==0) {
-                   *ppe++ = energy[icount-1] + (*ppi)*(*ppi) - 
-                       (*ppo)*(*ppo);
-                   ppo--;
-                   ppi--;
-                   
-                   if (energy[icount]>0.0) {
-                       invenergy[icount] = 
-                           (float)1.0/(energy[icount]+EPS);
-                   } else {
-                       invenergy[icount] = (float) 0.0;
-                   }
-   
-                   measure=(float)-10000000.0;
-                   
-                   if (crossDot > 0.0) {
-                       measure = crossDot*crossDot*invenergy[icount];
-                   }
-               }
-               else {
-                   measure = crossDot*crossDot*invenergy[icount];
-               }
-   
-               /* check if measure is better */
-               ftmp = crossDot*invenergy[icount];
-   
-               if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
-                   best_index = icount;
-                   max_measure = measure;
-                   gain = ftmp;
-               }
-           }
-   
-           /* Loop over augmented part in the first codebook 
-            * section, full search.
-            * The vectors are interpolated.
-            */
-           
-           if (lTarget==SUBL) {        
-               
-               /* Search for best possible cb vector and 
-                  compute the CB-vectors' energy. */
-               searchAugmentedCB(20, 39, stage, base_size-lTarget/2, 
-                   target, buf+LPC_FILTERORDER+lMem,
-                   &max_measure, &best_index, &gain, energy, 
-                   invenergy);
-   
-   
-           }
-   
-           /* set search range for following codebook sections */
-   
-           base_index=best_index;
-   
-           /* unrestricted search */
-   
-           if (CB_RESRANGE == -1) {
-               sInd=0;
-               eInd=range-1;
-               sIndAug=20;
-               eIndAug=39;
-           }
-   
-           /* restriced search around best index from first 
-           codebook section */
-   
-           else {
-               /* Initialize search indices */
-               sIndAug=0;
-               eIndAug=0;
-               sInd=base_index-CB_RESRANGE/2;
-               eInd=sInd+CB_RESRANGE;
-               
-               if (lTarget==SUBL) {
-   
-                   if (sInd<0) {
-                       
-                       sIndAug = 40 + sInd;
-                       eIndAug = 39;
-                       sInd=0;
-   
-                   } else if ( base_index < (base_size-20) ) {
-                       
-                       if (eInd > range) {
-                           sInd -= (eInd-range);
-                           eInd = range;
-                       }
-                   } else { /* base_index >= (base_size-20) */
-                       
-                       if (sInd < (base_size-20)) {
-                           sIndAug = 20;
-                           sInd = 0;
-                           eInd = 0;
-                           eIndAug = 19 + CB_RESRANGE;
-                           
-                           if(eIndAug > 39) {
-                               eInd = eIndAug-39;
-                               eIndAug = 39;
-                           }
-                       } else {
-                           sIndAug = 20 + sInd - (base_size-20);
-                           eIndAug = 39;
-   
-   
-                           sInd = 0;
-                           eInd = CB_RESRANGE - (eIndAug-sIndAug+1);
-                       }
-                   }
-   
-               } else { /* lTarget = 22 or 23 */
-                   
-                   if (sInd < 0) {
-                       eInd -= sInd;
-                       sInd = 0;
-                   }
-                   
-                   if(eInd > range) {
-                       sInd -= (eInd - range);
-                       eInd = range;
-                   }
-               }
-           }
-   
-           /* search of higher codebook section */
-   
-           /* index search range */
-           counter = sInd;
-           sInd += base_size;
-           eInd += base_size;
-           
-           
-           if (stage==0) {
-               ppe = energy+base_size;
-               *ppe=0.0;
-   
-               pp=cbvectors+lMem-lTarget;
-               for (j=0; j<lTarget; j++) {
-                   *ppe+=(*pp)*(*pp++);
-               }
-   
-               ppi = cbvectors + lMem - 1 - lTarget;
-               ppo = cbvectors + lMem - 1;
-               
-               for (j=0; j<(range-1); j++) {
-                   *(ppe+1) = *ppe + (*ppi)*(*ppi) - (*ppo)*(*ppo);
-                   ppo--;
-                   ppi--;
-                   ppe++;
-               }
-           }
-   
-           /* loop over search range */
-   
-           for (icount=sInd; icount<eInd; icount++) {
-   
-               /* calculate measure */
-   
-               crossDot=0.0;
-   
-   
-               pp=cbvectors + lMem - (counter++) - lTarget;
-   
-               for (j=0;j<lTarget;j++) {
-                   crossDot += target[j]*(*pp++);
-               }
-               
-               if (energy[icount]>0.0) {
-                   invenergy[icount] =(float)1.0/(energy[icount]+EPS);
-               } else {
-                   invenergy[icount] =(float)0.0;
-               }
-               
-               if (stage==0) {
-   
-                   measure=(float)-10000000.0;
-                   
-                   if (crossDot > 0.0) {
-                       measure = crossDot*crossDot*
-                           invenergy[icount];
-                   }
-               }
-               else {
-                   measure = crossDot*crossDot*invenergy[icount];
-               }
-   
-               /* check if measure is better */
-               ftmp = crossDot*invenergy[icount];
-   
-               if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
-                   best_index = icount;
-                   max_measure = measure;
-                   gain = ftmp;
-               }
-           }
-   
-           /* Search the augmented CB inside the limited range. */
-           
-           if ((lTarget==SUBL)&&(sIndAug!=0)) {
-               searchAugmentedCB(sIndAug, eIndAug, stage, 
-                   2*base_size-20, target, cbvectors+lMem,
-                   &max_measure, &best_index, &gain, energy, 
-                   invenergy);
-           }
-   
-           /* record best index */
-   
-           index[stage] = best_index;
-   
-           /* gain quantization */
-   
-           if (stage==0){
-               
-               if (gain<0.0){
-                   gain = 0.0;
-   
-   
-               }
-               
-               if (gain>CB_MAXGAIN) {
-                   gain = (float)CB_MAXGAIN;
-               }
-               gain = gainquant(gain, 1.0, 32, &gain_index[stage]);
-           }
-           else {
-               if (stage==1) {
-                   gain = gainquant(gain, (float)fabs(gains[stage-1]),
-                       16, &gain_index[stage]);
-               } else {
-                   gain = gainquant(gain, (float)fabs(gains[stage-1]),
-                       8, &gain_index[stage]);
-               }
-           }
-   
-           /* Extract the best (according to measure) 
-              codebook vector */
-           
-           if (lTarget==(STATE_LEN-iLBCenc_inst->state_short_len)) {
-               
-               if (index[stage]<base_size) {
-                   pp=buf+LPC_FILTERORDER+lMem-lTarget-index[stage];
-               } else {
-                   pp=cbvectors+lMem-lTarget-
-                       index[stage]+base_size;
-               }
-           } else {
-               
-               if (index[stage]<base_size) {
-                   if (index[stage]<(base_size-20)) {
-                       pp=buf+LPC_FILTERORDER+lMem-
-                           lTarget-index[stage];
-                   } else {
-                       createAugmentedVec(index[stage]-base_size+40,
-                               buf+LPC_FILTERORDER+lMem,aug_vec);
-                       pp=aug_vec;
-                   }
-               } else {
-                   int filterno, position;
-   
-                   filterno=index[stage]/base_size;
-                   position=index[stage]-filterno*base_size;
-   
-                   
-                   if (position<(base_size-20)) {
-                       pp=cbvectors+filterno*lMem-lTarget-
-                           index[stage]+filterno*base_size;
-                   } else {
-                       createAugmentedVec(
-                           index[stage]-(filterno+1)*base_size+40,
-                           cbvectors+filterno*lMem,aug_vec);
-                       pp=aug_vec;
-   
-   
-                   }
-               }
-           }
-   
-           /* Subtract the best codebook vector, according 
-              to measure, from the target vector */
-   
-           for (j=0;j<lTarget;j++) {
-               cvec[j] += gain*(*pp);
-               target[j] -= gain*(*pp++);
-           }
-   
-           /* record quantized gain */
-   
-           gains[stage]=gain;
-   
-       }/* end of Main Loop. for (stage=0;... */
-   
-       /* Gain adjustment for energy matching */
-       cene=0.0;
-       for (i=0; i<lTarget; i++) {
-           cene+=cvec[i]*cvec[i];
-       }
-       j=gain_index[0];
-   
-       for (i=gain_index[0]; i<32; i++) {
-           ftmp=cene*gain_sq5Tbl[i]*gain_sq5Tbl[i];
-           
-           if ((ftmp<(tene*gains[0]*gains[0])) && 
-               (gain_sq5Tbl[j]<(2.0*gains[0]))) {
-               j=i;
-           }
-       }
-       gain_index[0]=j;
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       iCBSearch.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <string.h>
+   
+   #include "iLBC_define.h"
+   #include "gainquant.h"
+   #include "createCB.h"
+   #include "filter.h"
+   #include "constants.h"
+   
+   /*----------------------------------------------------------------*
+    *  Search routine for codebook encoding and gain quantization.
+    *---------------------------------------------------------------*/
+   
+   void iCBSearch(
+       iLBC_Enc_Inst_t *iLBCenc_inst, 
+                           /* (i) the encoder state structure */
+       int *index,         /* (o) Codebook indices */
+       int *gain_index,/* (o) Gain quantization indices */
+       float *intarget,/* (i) Target vector for encoding */    
+       float *mem,         /* (i) Buffer for codebook construction */
+       int lMem,           /* (i) Length of buffer */
+       int lTarget,    /* (i) Length of vector */
+       int nStages,    /* (i) Number of codebook stages */
+       float *weightDenum, /* (i) weighting filter coefficients */
+       float *weightState, /* (i) weighting filter state */
+       int block           /* (i) the sub-block number */
+   ){
+       int i, j, icount, stage, best_index, range, counter;
+       float max_measure, gain, measure, crossDot, ftmp;
+       float gains[CB_NSTAGES];
+       float target[SUBL];
+       int base_index, sInd, eInd, base_size;
+       int sIndAug=0, eIndAug=0;
+       float buf[CB_MEML+SUBL+2*LPC_FILTERORDER];
+   
+   
+       float invenergy[CB_EXPAND*128], energy[CB_EXPAND*128];
+       float *pp, *ppi=0, *ppo=0, *ppe=0;
+       float cbvectors[CB_MEML];
+       float tene, cene, cvec[SUBL];
+       float aug_vec[SUBL];
+   
+       memset(cvec,0,SUBL*sizeof(float));  
+   
+       /* Determine size of codebook sections */
+   
+       base_size=lMem-lTarget+1;
+       
+       if (lTarget==SUBL) {
+           base_size=lMem-lTarget+1+lTarget/2;
+       }
+   
+       /* setup buffer for weighting */
+   
+       memcpy(buf,weightState,sizeof(float)*LPC_FILTERORDER);
+       memcpy(buf+LPC_FILTERORDER,mem,lMem*sizeof(float));
+       memcpy(buf+LPC_FILTERORDER+lMem,intarget,lTarget*sizeof(float));
+   
+       /* weighting */
+   
+       AllPoleFilter(buf+LPC_FILTERORDER, weightDenum, 
+           lMem+lTarget, LPC_FILTERORDER);
+       
+       /* Construct the codebook and target needed */
+   
+       memcpy(target, buf+LPC_FILTERORDER+lMem, lTarget*sizeof(float));
+   
+       tene=0.0;
+       for (i=0; i<lTarget; i++) {
+           tene+=target[i]*target[i];
+       }
+   
+       /* Prepare search over one more codebook section. This section 
+          is created by filtering the original buffer with a filter. */
+           
+       filteredCBvecs(cbvectors, buf+LPC_FILTERORDER, lMem);
+   
+       /* The Main Loop over stages */
+   
+       for (stage=0; stage<nStages; stage++) {
+   
+           range = search_rangeTbl[block][stage];
+   
+           /* initialize search measure */
+   
+           max_measure = (float)-10000000.0;
+           gain = (float)0.0;
+           best_index = 0;
+   
+           /* Compute cross dot product between the target 
+   
+   
+              and the CB memory */
+   
+           crossDot=0.0;
+           pp=buf+LPC_FILTERORDER+lMem-lTarget;
+           for (j=0; j<lTarget; j++) {
+               crossDot += target[j]*(*pp++);
+           }       
+           
+           if (stage==0) {
+   
+               /* Calculate energy in the first block of 
+                 'lTarget' sampels. */
+               ppe = energy;
+               ppi = buf+LPC_FILTERORDER+lMem-lTarget-1;
+               ppo = buf+LPC_FILTERORDER+lMem-1;
+   
+               *ppe=0.0;
+               pp=buf+LPC_FILTERORDER+lMem-lTarget;
+               for (j=0; j<lTarget; j++) {
+                   *ppe+=(*pp)*(*pp++);
+               }
+               
+               if (*ppe>0.0) {
+                   invenergy[0] = (float) 1.0 / (*ppe + EPS);
+               } else {
+                   invenergy[0] = (float) 0.0; 
+               }
+               ppe++;
+   
+               measure=(float)-10000000.0; 
+               
+               if (crossDot > 0.0) {
+                      measure = crossDot*crossDot*invenergy[0];
+               }
+           }
+           else {
+               measure = crossDot*crossDot*invenergy[0];
+           }
+   
+           /* check if measure is better */
+           ftmp = crossDot*invenergy[0];
+           
+           if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
+               best_index = 0;
+               max_measure = measure;
+               gain = ftmp;
+           }
+   
+           /* loop over the main first codebook section, 
+              full search */
+   
+           for (icount=1; icount<range; icount++) {
+   
+               /* calculate measure */
+   
+   
+   
+               crossDot=0.0;
+               pp = buf+LPC_FILTERORDER+lMem-lTarget-icount;
+   
+               for (j=0; j<lTarget; j++) {
+                   crossDot += target[j]*(*pp++);
+               }
+               
+               if (stage==0) {
+                   *ppe++ = energy[icount-1] + (*ppi)*(*ppi) - 
+                       (*ppo)*(*ppo);
+                   ppo--;
+                   ppi--;
+                   
+                   if (energy[icount]>0.0) {
+                       invenergy[icount] = 
+                           (float)1.0/(energy[icount]+EPS);
+                   } else {
+                       invenergy[icount] = (float) 0.0;
+                   }
+   
+                   measure=(float)-10000000.0;
+                   
+                   if (crossDot > 0.0) {
+                       measure = crossDot*crossDot*invenergy[icount];
+                   }
+               }
+               else {
+                   measure = crossDot*crossDot*invenergy[icount];
+               }
+   
+               /* check if measure is better */
+               ftmp = crossDot*invenergy[icount];
+   
+               if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
+                   best_index = icount;
+                   max_measure = measure;
+                   gain = ftmp;
+               }
+           }
+   
+           /* Loop over augmented part in the first codebook 
+            * section, full search.
+            * The vectors are interpolated.
+            */
+           
+           if (lTarget==SUBL) {        
+               
+               /* Search for best possible cb vector and 
+                  compute the CB-vectors' energy. */
+               searchAugmentedCB(20, 39, stage, base_size-lTarget/2, 
+                   target, buf+LPC_FILTERORDER+lMem,
+                   &max_measure, &best_index, &gain, energy, 
+                   invenergy);
+   
+   
+           }
+   
+           /* set search range for following codebook sections */
+   
+           base_index=best_index;
+   
+           /* unrestricted search */
+   
+           if (CB_RESRANGE == -1) {
+               sInd=0;
+               eInd=range-1;
+               sIndAug=20;
+               eIndAug=39;
+           }
+   
+           /* restriced search around best index from first 
+           codebook section */
+   
+           else {
+               /* Initialize search indices */
+               sIndAug=0;
+               eIndAug=0;
+               sInd=base_index-CB_RESRANGE/2;
+               eInd=sInd+CB_RESRANGE;
+               
+               if (lTarget==SUBL) {
+   
+                   if (sInd<0) {
+                       
+                       sIndAug = 40 + sInd;
+                       eIndAug = 39;
+                       sInd=0;
+   
+                   } else if ( base_index < (base_size-20) ) {
+                       
+                       if (eInd > range) {
+                           sInd -= (eInd-range);
+                           eInd = range;
+                       }
+                   } else { /* base_index >= (base_size-20) */
+                       
+                       if (sInd < (base_size-20)) {
+                           sIndAug = 20;
+                           sInd = 0;
+                           eInd = 0;
+                           eIndAug = 19 + CB_RESRANGE;
+                           
+                           if(eIndAug > 39) {
+                               eInd = eIndAug-39;
+                               eIndAug = 39;
+                           }
+                       } else {
+                           sIndAug = 20 + sInd - (base_size-20);
+                           eIndAug = 39;
+   
+   
+                           sInd = 0;
+                           eInd = CB_RESRANGE - (eIndAug-sIndAug+1);
+                       }
+                   }
+   
+               } else { /* lTarget = 22 or 23 */
+                   
+                   if (sInd < 0) {
+                       eInd -= sInd;
+                       sInd = 0;
+                   }
+                   
+                   if(eInd > range) {
+                       sInd -= (eInd - range);
+                       eInd = range;
+                   }
+               }
+           }
+   
+           /* search of higher codebook section */
+   
+           /* index search range */
+           counter = sInd;
+           sInd += base_size;
+           eInd += base_size;
+           
+           
+           if (stage==0) {
+               ppe = energy+base_size;
+               *ppe=0.0;
+   
+               pp=cbvectors+lMem-lTarget;
+               for (j=0; j<lTarget; j++) {
+                   *ppe+=(*pp)*(*pp++);
+               }
+   
+               ppi = cbvectors + lMem - 1 - lTarget;
+               ppo = cbvectors + lMem - 1;
+               
+               for (j=0; j<(range-1); j++) {
+                   *(ppe+1) = *ppe + (*ppi)*(*ppi) - (*ppo)*(*ppo);
+                   ppo--;
+                   ppi--;
+                   ppe++;
+               }
+           }
+   
+           /* loop over search range */
+   
+           for (icount=sInd; icount<eInd; icount++) {
+   
+               /* calculate measure */
+   
+               crossDot=0.0;
+   
+   
+               pp=cbvectors + lMem - (counter++) - lTarget;
+   
+               for (j=0;j<lTarget;j++) {
+                   crossDot += target[j]*(*pp++);
+               }
+               
+               if (energy[icount]>0.0) {
+                   invenergy[icount] =(float)1.0/(energy[icount]+EPS);
+               } else {
+                   invenergy[icount] =(float)0.0;
+               }
+               
+               if (stage==0) {
+   
+                   measure=(float)-10000000.0;
+                   
+                   if (crossDot > 0.0) {
+                       measure = crossDot*crossDot*
+                           invenergy[icount];
+                   }
+               }
+               else {
+                   measure = crossDot*crossDot*invenergy[icount];
+               }
+   
+               /* check if measure is better */
+               ftmp = crossDot*invenergy[icount];
+   
+               if ((measure>max_measure) && (fabs(ftmp)<CB_MAXGAIN)) {
+                   best_index = icount;
+                   max_measure = measure;
+                   gain = ftmp;
+               }
+           }
+   
+           /* Search the augmented CB inside the limited range. */
+           
+           if ((lTarget==SUBL)&&(sIndAug!=0)) {
+               searchAugmentedCB(sIndAug, eIndAug, stage, 
+                   2*base_size-20, target, cbvectors+lMem,
+                   &max_measure, &best_index, &gain, energy, 
+                   invenergy);
+           }
+   
+           /* record best index */
+   
+           index[stage] = best_index;
+   
+           /* gain quantization */
+   
+           if (stage==0){
+               
+               if (gain<0.0){
+                   gain = 0.0;
+   
+   
+               }
+               
+               if (gain>CB_MAXGAIN) {
+                   gain = (float)CB_MAXGAIN;
+               }
+               gain = gainquant(gain, 1.0, 32, &gain_index[stage]);
+           }
+           else {
+               if (stage==1) {
+                   gain = gainquant(gain, (float)fabs(gains[stage-1]),
+                       16, &gain_index[stage]);
+               } else {
+                   gain = gainquant(gain, (float)fabs(gains[stage-1]),
+                       8, &gain_index[stage]);
+               }
+           }
+   
+           /* Extract the best (according to measure) 
+              codebook vector */
+           
+           if (lTarget==(STATE_LEN-iLBCenc_inst->state_short_len)) {
+               
+               if (index[stage]<base_size) {
+                   pp=buf+LPC_FILTERORDER+lMem-lTarget-index[stage];
+               } else {
+                   pp=cbvectors+lMem-lTarget-
+                       index[stage]+base_size;
+               }
+           } else {
+               
+               if (index[stage]<base_size) {
+                   if (index[stage]<(base_size-20)) {
+                       pp=buf+LPC_FILTERORDER+lMem-
+                           lTarget-index[stage];
+                   } else {
+                       createAugmentedVec(index[stage]-base_size+40,
+                               buf+LPC_FILTERORDER+lMem,aug_vec);
+                       pp=aug_vec;
+                   }
+               } else {
+                   int filterno, position;
+   
+                   filterno=index[stage]/base_size;
+                   position=index[stage]-filterno*base_size;
+   
+                   
+                   if (position<(base_size-20)) {
+                       pp=cbvectors+filterno*lMem-lTarget-
+                           index[stage]+filterno*base_size;
+                   } else {
+                       createAugmentedVec(
+                           index[stage]-(filterno+1)*base_size+40,
+                           cbvectors+filterno*lMem,aug_vec);
+                       pp=aug_vec;
+   
+   
+                   }
+               }
+           }
+   
+           /* Subtract the best codebook vector, according 
+              to measure, from the target vector */
+   
+           for (j=0;j<lTarget;j++) {
+               cvec[j] += gain*(*pp);
+               target[j] -= gain*(*pp++);
+           }
+   
+           /* record quantized gain */
+   
+           gains[stage]=gain;
+   
+       }/* end of Main Loop. for (stage=0;... */
+   
+       /* Gain adjustment for energy matching */
+       cene=0.0;
+       for (i=0; i<lTarget; i++) {
+           cene+=cvec[i]*cvec[i];
+       }
+       j=gain_index[0];
+   
+       for (i=gain_index[0]; i<32; i++) {
+           ftmp=cene*gain_sq5Tbl[i]*gain_sq5Tbl[i];
+           
+           if ((ftmp<(tene*gains[0]*gains[0])) && 
+               (gain_sq5Tbl[j]<(2.0*gains[0]))) {
+               j=i;
+           }
+       }
+       gain_index[0]=j;
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iCBSearch.h	Fri Sep 21 14:49:14 2007
@@ -1,35 +1,35 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       iCBSearch.h        
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_ICBSEARCH_H
-   #define __iLBC_ICBSEARCH_H
-   
-   void iCBSearch(
-       iLBC_Enc_Inst_t *iLBCenc_inst, 
-                           /* (i) the encoder state structure */
-       int *index,         /* (o) Codebook indices */
-       int *gain_index,/* (o) Gain quantization indices */
-       float *intarget,/* (i) Target vector for encoding */    
-       float *mem,         /* (i) Buffer for codebook construction */
-       int lMem,           /* (i) Length of buffer */
-       int lTarget,    /* (i) Length of vector */
-       int nStages,    /* (i) Number of codebook stages */
-       float *weightDenum, /* (i) weighting filter coefficients */
-   
-   
-       float *weightState, /* (i) weighting filter state */
-       int block           /* (i) the sub-block number */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       iCBSearch.h        
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_ICBSEARCH_H
+   #define __iLBC_ICBSEARCH_H
+   
+   void iCBSearch(
+       iLBC_Enc_Inst_t *iLBCenc_inst, 
+                           /* (i) the encoder state structure */
+       int *index,         /* (o) Codebook indices */
+       int *gain_index,/* (o) Gain quantization indices */
+       float *intarget,/* (i) Target vector for encoding */    
+       float *mem,         /* (i) Buffer for codebook construction */
+       int lMem,           /* (i) Length of buffer */
+       int lTarget,    /* (i) Length of vector */
+       int nStages,    /* (i) Number of codebook stages */
+       float *weightDenum, /* (i) weighting filter coefficients */
+   
+   
+       float *weightState, /* (i) weighting filter state */
+       int block           /* (i) the sub-block number */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.c	Fri Sep 21 14:49:14 2007
@@ -1,618 +1,618 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       iLBC_decode.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <stdlib.h>
-   
-   #include "iLBC_define.h"
-   #include "StateConstructW.h"
-   #include "LPCdecode.h"
-   #include "iCBConstruct.h"
-   #include "doCPLC.h"
-   #include "helpfun.h"
-   #include "constants.h"
-   #include "packing.h"
-   #include "string.h"
-   #include "enhancer.h"
-   #include "hpOutput.h"
-   #include "syntFilter.h"
-   
-   /*----------------------------------------------------------------*
-    *  Initiation of decoder instance.
-    *---------------------------------------------------------------*/
-   
-   short initDecode(                   /* (o) Number of decoded 
-                                              samples */
-       iLBC_Dec_Inst_t *iLBCdec_inst,  /* (i/o) Decoder instance */
-       int mode,                       /* (i) frame size mode */
-       int use_enhancer                /* (i) 1 to use enhancer
-                                              0 to run without 
-                                                enhancer */
-   ){
-       int i;
-   
-       iLBCdec_inst->mode = mode;
-   
-       if (mode==30) {
-           iLBCdec_inst->blockl = BLOCKL_30MS;
-           iLBCdec_inst->nsub = NSUB_30MS;
-           iLBCdec_inst->nasub = NASUB_30MS;
-           iLBCdec_inst->lpc_n = LPC_N_30MS;
-   
-   
-           iLBCdec_inst->no_of_bytes = NO_OF_BYTES_30MS;
-           iLBCdec_inst->no_of_words = NO_OF_WORDS_30MS;
-           iLBCdec_inst->state_short_len=STATE_SHORT_LEN_30MS;
-           /* ULP init */
-           iLBCdec_inst->ULP_inst=&ULP_30msTbl;
-       }
-       else if (mode==20) {
-           iLBCdec_inst->blockl = BLOCKL_20MS;
-           iLBCdec_inst->nsub = NSUB_20MS;
-           iLBCdec_inst->nasub = NASUB_20MS;
-           iLBCdec_inst->lpc_n = LPC_N_20MS;
-           iLBCdec_inst->no_of_bytes = NO_OF_BYTES_20MS;
-           iLBCdec_inst->no_of_words = NO_OF_WORDS_20MS;
-           iLBCdec_inst->state_short_len=STATE_SHORT_LEN_20MS;
-           /* ULP init */
-           iLBCdec_inst->ULP_inst=&ULP_20msTbl;
-       }
-       else {
-           exit(2);
-       }
-   
-       memset(iLBCdec_inst->syntMem, 0, 
-           LPC_FILTERORDER*sizeof(float));
-       memcpy((*iLBCdec_inst).lsfdeqold, lsfmeanTbl, 
-           LPC_FILTERORDER*sizeof(float));
-   
-       memset(iLBCdec_inst->old_syntdenum, 0, 
-           ((LPC_FILTERORDER + 1)*NSUB_MAX)*sizeof(float));
-       for (i=0; i<NSUB_MAX; i++)
-           iLBCdec_inst->old_syntdenum[i*(LPC_FILTERORDER+1)]=1.0;
-   
-       iLBCdec_inst->last_lag = 20;
-   
-       iLBCdec_inst->prevLag = 120;
-       iLBCdec_inst->per = 0.0;
-       iLBCdec_inst->consPLICount = 0;
-       iLBCdec_inst->prevPLI = 0;
-       iLBCdec_inst->prevLpc[0] = 1.0;
-       memset(iLBCdec_inst->prevLpc+1,0,
-           LPC_FILTERORDER*sizeof(float));
-       memset(iLBCdec_inst->prevResidual, 0, BLOCKL_MAX*sizeof(float));
-       iLBCdec_inst->seed=777;
-   
-       memset(iLBCdec_inst->hpomem, 0, 4*sizeof(float));
-   
-       iLBCdec_inst->use_enhancer = use_enhancer;
-       memset(iLBCdec_inst->enh_buf, 0, ENH_BUFL*sizeof(float));
-       for (i=0;i<ENH_NBLOCKS_TOT;i++) 
-           iLBCdec_inst->enh_period[i]=(float)40.0;
-   
-       iLBCdec_inst->prev_enh_pl = 0;
-   
-       return (iLBCdec_inst->blockl);
-   }
-   
-   
-   
-   /*----------------------------------------------------------------*
-    *  frame residual decoder function (subrutine to iLBC_decode) 
-    *---------------------------------------------------------------*/
-   
-   void Decode(
-       iLBC_Dec_Inst_t *iLBCdec_inst,  /* (i/o) the decoder state 
-                                                structure */
-       float *decresidual,             /* (o) decoded residual frame */
-       int start,                      /* (i) location of start 
-                                              state */
-       int idxForMax,                  /* (i) codebook index for the 
-                                              maximum value */
-       int *idxVec,                /* (i) codebook indexes for the 
-                                              samples  in the start 
-                                              state */
-       float *syntdenum,               /* (i) the decoded synthesis
-                                              filter coefficients */
-       int *cb_index,                  /* (i) the indexes for the 
-                                              adaptive codebook */
-       int *gain_index,            /* (i) the indexes for the 
-                                              corresponding gains */
-       int *extra_cb_index,        /* (i) the indexes for the 
-                                              adaptive codebook part 
-                                              of start state */
-       int *extra_gain_index,          /* (i) the indexes for the 
-                                              corresponding gains */
-       int state_first                 /* (i) 1 if non adaptive part 
-                                              of start state comes 
-                                              first 0 if that part 
-                                              comes last */
-   ){
-       float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML];
-       int k, meml_gotten, Nfor, Nback, i;
-       int diff, start_pos;
-       int subcount, subframe;
-   
-       diff = STATE_LEN - iLBCdec_inst->state_short_len;
-       
-       if (state_first == 1) {
-           start_pos = (start-1)*SUBL;
-       } else {
-           start_pos = (start-1)*SUBL + diff;
-       }
-   
-       /* decode scalar part of start state */
-   
-       StateConstructW(idxForMax, idxVec, 
-           &syntdenum[(start-1)*(LPC_FILTERORDER+1)], 
-           &decresidual[start_pos], iLBCdec_inst->state_short_len);
-   
-       
-       if (state_first) { /* put adaptive part in the end */
-                   
-   
-   
-           /* setup memory */
-   
-           memset(mem, 0, 
-               (CB_MEML-iLBCdec_inst->state_short_len)*sizeof(float));
-           memcpy(mem+CB_MEML-iLBCdec_inst->state_short_len, 
-               decresidual+start_pos, 
-               iLBCdec_inst->state_short_len*sizeof(float));
-           
-           /* construct decoded vector */
-   
-           iCBConstruct(
-               &decresidual[start_pos+iLBCdec_inst->state_short_len],
-               extra_cb_index, extra_gain_index, mem+CB_MEML-stMemLTbl,
-               stMemLTbl, diff, CB_NSTAGES);
-       
-       } 
-       else {/* put adaptive part in the beginning */
-           
-           /* create reversed vectors for prediction */
-   
-           for (k=0; k<diff; k++) {
-               reverseDecresidual[k] = 
-                   decresidual[(start+1)*SUBL-1-
-                           (k+iLBCdec_inst->state_short_len)];
-           }
-           
-           /* setup memory */
-   
-           meml_gotten = iLBCdec_inst->state_short_len;
-           for (k=0; k<meml_gotten; k++){ 
-               mem[CB_MEML-1-k] = decresidual[start_pos + k];
-           } 
-           memset(mem, 0, (CB_MEML-k)*sizeof(float));
-           
-           /* construct decoded vector */
-   
-           iCBConstruct(reverseDecresidual, extra_cb_index, 
-               extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl,
-               diff, CB_NSTAGES);
-           
-           /* get decoded residual from reversed vector */
-   
-           for (k=0; k<diff; k++) {
-               decresidual[start_pos-1-k] = reverseDecresidual[k];
-           }
-       }
-   
-       /* counter for predicted sub-frames */
-   
-       subcount=0;
-   
-       /* forward prediction of sub-frames */
-   
-       Nfor = iLBCdec_inst->nsub-start-1;
-   
-   
-       
-       if ( Nfor > 0 ){
-           
-           /* setup memory */
-   
-           memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float));
-           memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL,
-               STATE_LEN*sizeof(float));
-   
-           /* loop over sub-frames to encode */
-   
-           for (subframe=0; subframe<Nfor; subframe++) {
-               
-               /* construct decoded vector */
-   
-               iCBConstruct(&decresidual[(start+1+subframe)*SUBL], 
-                   cb_index+subcount*CB_NSTAGES, 
-                   gain_index+subcount*CB_NSTAGES, 
-                   mem+CB_MEML-memLfTbl[subcount], 
-                   memLfTbl[subcount], SUBL, CB_NSTAGES);
-   
-               /* update memory */
-   
-               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
-               memcpy(mem+CB_MEML-SUBL, 
-                   &decresidual[(start+1+subframe)*SUBL],
-                   SUBL*sizeof(float));
-   
-               subcount++;
-   
-           }
-   
-       }
-       
-       /* backward prediction of sub-frames */
-   
-       Nback = start-1;
-   
-       if ( Nback > 0 ) {
-   
-           /* setup memory */
-   
-           meml_gotten = SUBL*(iLBCdec_inst->nsub+1-start);
-           
-           if ( meml_gotten > CB_MEML ) { 
-               meml_gotten=CB_MEML;
-           }
-           for (k=0; k<meml_gotten; k++) { 
-               mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k];
-           }
-           memset(mem, 0, (CB_MEML-k)*sizeof(float));
-   
-           /* loop over subframes to decode */
-   
-   
-   
-           for (subframe=0; subframe<Nback; subframe++) {
-               
-               /* construct decoded vector */
-   
-               iCBConstruct(&reverseDecresidual[subframe*SUBL], 
-                   cb_index+subcount*CB_NSTAGES, 
-                   gain_index+subcount*CB_NSTAGES, 
-                   mem+CB_MEML-memLfTbl[subcount], memLfTbl[subcount], 
-                   SUBL, CB_NSTAGES);
-   
-               /* update memory */
-   
-               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
-               memcpy(mem+CB_MEML-SUBL, 
-                   &reverseDecresidual[subframe*SUBL],
-                   SUBL*sizeof(float));
-   
-               subcount++;
-           }
-   
-           /* get decoded residual from reversed vector */
-   
-           for (i=0; i<SUBL*Nback; i++)
-               decresidual[SUBL*Nback - i - 1] = 
-               reverseDecresidual[i];
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  main decoder function 
-    *---------------------------------------------------------------*/
-   
-   void iLBC_decode( 
-       float *decblock,            /* (o) decoded signal block */
-       unsigned char *bytes,           /* (i) encoded signal bits */
-       iLBC_Dec_Inst_t *iLBCdec_inst,  /* (i/o) the decoder state 
-                                                structure */
-       int mode                    /* (i) 0: bad packet, PLC, 
-                                              1: normal */
-   ){
-       float data[BLOCKL_MAX];
-       float lsfdeq[LPC_FILTERORDER*LPC_N_MAX];
-       float PLCresidual[BLOCKL_MAX], PLClpc[LPC_FILTERORDER + 1];
-       float zeros[BLOCKL_MAX], one[LPC_FILTERORDER + 1];
-       int k, i, start, idxForMax, pos, lastpart, ulp;
-       int lag, ilag;
-       float cc, maxcc;
-       int idxVec[STATE_LEN];
-       int check;
-       int gain_index[NASUB_MAX*CB_NSTAGES], 
-           extra_gain_index[CB_NSTAGES];
-       int cb_index[CB_NSTAGES*NASUB_MAX], extra_cb_index[CB_NSTAGES];
-       int lsf_i[LSF_NSPLIT*LPC_N_MAX];
-       int state_first;
-   
-   
-       int last_bit;
-       unsigned char *pbytes;
-       float weightdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
-       int order_plus_one;
-       float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; 
-       float decresidual[BLOCKL_MAX];
-       
-       if (mode>0) { /* the data are good */
-   
-           /* decode data */
-           
-           pbytes=bytes;
-           pos=0;
-   
-           /* Set everything to zero before decoding */
-   
-           for (k=0; k<LSF_NSPLIT*LPC_N_MAX; k++) {
-               lsf_i[k]=0;
-           }
-           start=0;
-           state_first=0;
-           idxForMax=0;
-           for (k=0; k<iLBCdec_inst->state_short_len; k++) {
-               idxVec[k]=0;
-           }
-           for (k=0; k<CB_NSTAGES; k++) {
-               extra_cb_index[k]=0;
-           }
-           for (k=0; k<CB_NSTAGES; k++) {
-               extra_gain_index[k]=0;
-           }
-           for (i=0; i<iLBCdec_inst->nasub; i++) {
-               for (k=0; k<CB_NSTAGES; k++) {
-                   cb_index[i*CB_NSTAGES+k]=0;
-               }
-           }
-           for (i=0; i<iLBCdec_inst->nasub; i++) {
-               for (k=0; k<CB_NSTAGES; k++) {
-                   gain_index[i*CB_NSTAGES+k]=0;
-               }
-           }
-   
-           /* loop over ULP classes */
-   
-           for (ulp=0; ulp<3; ulp++) {
-           
-               /* LSF */
-               for (k=0; k<LSF_NSPLIT*iLBCdec_inst->lpc_n; k++){
-                   unpack( &pbytes, &lastpart, 
-                       iLBCdec_inst->ULP_inst->lsf_bits[k][ulp], &pos);
-                   packcombine(&lsf_i[k], lastpart,
-                       iLBCdec_inst->ULP_inst->lsf_bits[k][ulp]);
-               }
-   
-   
-   
-               /* Start block info */
-   
-               unpack( &pbytes, &lastpart, 
-                   iLBCdec_inst->ULP_inst->start_bits[ulp], &pos);
-               packcombine(&start, lastpart, 
-                   iLBCdec_inst->ULP_inst->start_bits[ulp]);
-   
-               unpack( &pbytes, &lastpart, 
-                   iLBCdec_inst->ULP_inst->startfirst_bits[ulp], &pos);
-               packcombine(&state_first, lastpart,
-                   iLBCdec_inst->ULP_inst->startfirst_bits[ulp]);
-   
-               unpack( &pbytes, &lastpart, 
-                   iLBCdec_inst->ULP_inst->scale_bits[ulp], &pos);
-               packcombine(&idxForMax, lastpart, 
-                   iLBCdec_inst->ULP_inst->scale_bits[ulp]);
-   
-               for (k=0; k<iLBCdec_inst->state_short_len; k++) {
-                   unpack( &pbytes, &lastpart, 
-                       iLBCdec_inst->ULP_inst->state_bits[ulp], &pos);
-                   packcombine(idxVec+k, lastpart,
-                       iLBCdec_inst->ULP_inst->state_bits[ulp]);
-               }
-   
-               /* 23/22 (20ms/30ms) sample block */
-   
-               for (k=0; k<CB_NSTAGES; k++) {
-                   unpack( &pbytes, &lastpart, 
-                       iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp], 
-                       &pos);
-                   packcombine(extra_cb_index+k, lastpart, 
-                       iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp]);
-               }
-               for (k=0; k<CB_NSTAGES; k++) {
-                   unpack( &pbytes, &lastpart, 
-                       iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp], 
-                       &pos);
-                   packcombine(extra_gain_index+k, lastpart,
-                       iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp]);
-               }
-                   
-               /* The two/four (20ms/30ms) 40 sample sub-blocks */
-   
-               for (i=0; i<iLBCdec_inst->nasub; i++) {
-                   for (k=0; k<CB_NSTAGES; k++) {
-                       unpack( &pbytes, &lastpart, 
-                       iLBCdec_inst->ULP_inst->cb_index[i][k][ulp], 
-                           &pos);
-                       packcombine(cb_index+i*CB_NSTAGES+k, lastpart, 
-                       iLBCdec_inst->ULP_inst->cb_index[i][k][ulp]);
-                   }
-               }
-               
-               for (i=0; i<iLBCdec_inst->nasub; i++) {
-   
-   
-                   for (k=0; k<CB_NSTAGES; k++) {
-                       unpack( &pbytes, &lastpart, 
-   
-                       iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp], 
-                           &pos);
-                       packcombine(gain_index+i*CB_NSTAGES+k, lastpart,
-                           iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp]);
-                   }
-               }
-           }
-           /* Extract last bit. If it is 1 this indicates an 
-              empty/lost frame */
-           unpack( &pbytes, &last_bit, 1, &pos);
-   
-           /* Check for bit errors or empty/lost frames */
-           if (start<1)
-               mode = 0;
-           if (iLBCdec_inst->mode==20 && start>3)
-               mode = 0;
-           if (iLBCdec_inst->mode==30 && start>5)
-               mode = 0;
-           if (last_bit==1)
-               mode = 0;
-   
-           if (mode==1) { /* No bit errors was detected, 
-                             continue decoding */
-                   
-               /* adjust index */
-               index_conv_dec(cb_index);
-   
-               /* decode the lsf */
-   
-               SimplelsfDEQ(lsfdeq, lsf_i, iLBCdec_inst->lpc_n);
-               check=LSF_check(lsfdeq, LPC_FILTERORDER, 
-                   iLBCdec_inst->lpc_n);
-               DecoderInterpolateLSF(syntdenum, weightdenum, 
-                   lsfdeq, LPC_FILTERORDER, iLBCdec_inst);
-           
-               Decode(iLBCdec_inst, decresidual, start, idxForMax, 
-                   idxVec, syntdenum, cb_index, gain_index, 
-                   extra_cb_index, extra_gain_index, 
-                   state_first);
-   
-               /* preparing the plc for a future loss! */
-   
-               doThePLC(PLCresidual, PLClpc, 0, decresidual, 
-                   syntdenum + 
-                   (LPC_FILTERORDER + 1)*(iLBCdec_inst->nsub - 1),
-                   (*iLBCdec_inst).last_lag, iLBCdec_inst);
-   
-           
-               memcpy(decresidual, PLCresidual, 
-                   iLBCdec_inst->blockl*sizeof(float));
-           }
-   
-   
-           
-       }
-       
-       if (mode == 0) {
-           /* the data is bad (either a PLC call
-            * was made or a severe bit error was detected)
-            */
-           
-           /* packet loss conceal */
-   
-           memset(zeros, 0, BLOCKL_MAX*sizeof(float));
-           
-           one[0] = 1;
-           memset(one+1, 0, LPC_FILTERORDER*sizeof(float));
-           
-           start=0;
-           
-           doThePLC(PLCresidual, PLClpc, 1, zeros, one,
-               (*iLBCdec_inst).last_lag, iLBCdec_inst);
-           memcpy(decresidual, PLCresidual, 
-               iLBCdec_inst->blockl*sizeof(float));
-           
-           order_plus_one = LPC_FILTERORDER + 1;
-           for (i = 0; i < iLBCdec_inst->nsub; i++) {
-               memcpy(syntdenum+(i*order_plus_one), PLClpc, 
-                   order_plus_one*sizeof(float));
-           }
-       }
-   
-       if (iLBCdec_inst->use_enhancer == 1) {
-   
-           /* post filtering */
-           
-           iLBCdec_inst->last_lag = 
-               enhancerInterface(data, decresidual, iLBCdec_inst);
-   
-           /* synthesis filtering */
-           
-           if (iLBCdec_inst->mode==20) {
-               /* Enhancer has 40 samples delay */
-               i=0;
-               syntFilter(data + i*SUBL, 
-                   iLBCdec_inst->old_syntdenum + 
-                   (i+iLBCdec_inst->nsub-1)*(LPC_FILTERORDER+1), 
-                   SUBL, iLBCdec_inst->syntMem);
-               for (i=1; i < iLBCdec_inst->nsub; i++) {
-                   syntFilter(data + i*SUBL, 
-                       syntdenum + (i-1)*(LPC_FILTERORDER+1), 
-                       SUBL, iLBCdec_inst->syntMem);
-               }
-           } else if (iLBCdec_inst->mode==30) {
-               /* Enhancer has 80 samples delay */
-               for (i=0; i < 2; i++) {
-                   syntFilter(data + i*SUBL, 
-   
-   
-                       iLBCdec_inst->old_syntdenum + 
-                       (i+iLBCdec_inst->nsub-2)*(LPC_FILTERORDER+1),
-                       SUBL, iLBCdec_inst->syntMem);
-               }
-               for (i=2; i < iLBCdec_inst->nsub; i++) {
-                   syntFilter(data + i*SUBL, 
-                       syntdenum + (i-2)*(LPC_FILTERORDER+1), SUBL,
-                       iLBCdec_inst->syntMem);
-               }
-           }
-   
-       } else {
-   
-           /* Find last lag */
-           lag = 20;
-           maxcc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], 
-               &decresidual[BLOCKL_MAX-ENH_BLOCKL-lag], ENH_BLOCKL);
-           
-           for (ilag=21; ilag<120; ilag++) {
-               cc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], 
-                   &decresidual[BLOCKL_MAX-ENH_BLOCKL-ilag], 
-                   ENH_BLOCKL);
-           
-               if (cc > maxcc) {
-                   maxcc = cc;
-                   lag = ilag;
-               }
-           }
-           iLBCdec_inst->last_lag = lag;
-   
-           /* copy data and run synthesis filter */
-   
-           memcpy(data, decresidual, 
-               iLBCdec_inst->blockl*sizeof(float));
-           for (i=0; i < iLBCdec_inst->nsub; i++) {
-               syntFilter(data + i*SUBL, 
-                   syntdenum + i*(LPC_FILTERORDER+1), SUBL, 
-                   iLBCdec_inst->syntMem);
-           }
-       }
-   
-       /* high pass filtering on output if desired, otherwise 
-          copy to out */
-   
-       hpOutput(data, iLBCdec_inst->blockl, 
-                   decblock,iLBCdec_inst->hpomem);
-   
-       /* memcpy(decblock,data,iLBCdec_inst->blockl*sizeof(float));*/
-   
-       memcpy(iLBCdec_inst->old_syntdenum, syntdenum, 
-   
-           iLBCdec_inst->nsub*(LPC_FILTERORDER+1)*sizeof(float));
-   
-       iLBCdec_inst->prev_enh_pl=0;
-   
-   
-   
-       if (mode==0) { /* PLC was used */
-           iLBCdec_inst->prev_enh_pl=1;
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       iLBC_decode.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <stdlib.h>
+   
+   #include "iLBC_define.h"
+   #include "StateConstructW.h"
+   #include "LPCdecode.h"
+   #include "iCBConstruct.h"
+   #include "doCPLC.h"
+   #include "helpfun.h"
+   #include "constants.h"
+   #include "packing.h"
+   #include "string.h"
+   #include "enhancer.h"
+   #include "hpOutput.h"
+   #include "syntFilter.h"
+   
+   /*----------------------------------------------------------------*
+    *  Initiation of decoder instance.
+    *---------------------------------------------------------------*/
+   
+   short initDecode(                   /* (o) Number of decoded 
+                                              samples */
+       iLBC_Dec_Inst_t *iLBCdec_inst,  /* (i/o) Decoder instance */
+       int mode,                       /* (i) frame size mode */
+       int use_enhancer                /* (i) 1 to use enhancer
+                                              0 to run without 
+                                                enhancer */
+   ){
+       int i;
+   
+       iLBCdec_inst->mode = mode;
+   
+       if (mode==30) {
+           iLBCdec_inst->blockl = BLOCKL_30MS;
+           iLBCdec_inst->nsub = NSUB_30MS;
+           iLBCdec_inst->nasub = NASUB_30MS;
+           iLBCdec_inst->lpc_n = LPC_N_30MS;
+   
+   
+           iLBCdec_inst->no_of_bytes = NO_OF_BYTES_30MS;
+           iLBCdec_inst->no_of_words = NO_OF_WORDS_30MS;
+           iLBCdec_inst->state_short_len=STATE_SHORT_LEN_30MS;
+           /* ULP init */
+           iLBCdec_inst->ULP_inst=&ULP_30msTbl;
+       }
+       else if (mode==20) {
+           iLBCdec_inst->blockl = BLOCKL_20MS;
+           iLBCdec_inst->nsub = NSUB_20MS;
+           iLBCdec_inst->nasub = NASUB_20MS;
+           iLBCdec_inst->lpc_n = LPC_N_20MS;
+           iLBCdec_inst->no_of_bytes = NO_OF_BYTES_20MS;
+           iLBCdec_inst->no_of_words = NO_OF_WORDS_20MS;
+           iLBCdec_inst->state_short_len=STATE_SHORT_LEN_20MS;
+           /* ULP init */
+           iLBCdec_inst->ULP_inst=&ULP_20msTbl;
+       }
+       else {
+           exit(2);
+       }
+   
+       memset(iLBCdec_inst->syntMem, 0, 
+           LPC_FILTERORDER*sizeof(float));
+       memcpy((*iLBCdec_inst).lsfdeqold, lsfmeanTbl, 
+           LPC_FILTERORDER*sizeof(float));
+   
+       memset(iLBCdec_inst->old_syntdenum, 0, 
+           ((LPC_FILTERORDER + 1)*NSUB_MAX)*sizeof(float));
+       for (i=0; i<NSUB_MAX; i++)
+           iLBCdec_inst->old_syntdenum[i*(LPC_FILTERORDER+1)]=1.0;
+   
+       iLBCdec_inst->last_lag = 20;
+   
+       iLBCdec_inst->prevLag = 120;
+       iLBCdec_inst->per = 0.0;
+       iLBCdec_inst->consPLICount = 0;
+       iLBCdec_inst->prevPLI = 0;
+       iLBCdec_inst->prevLpc[0] = 1.0;
+       memset(iLBCdec_inst->prevLpc+1,0,
+           LPC_FILTERORDER*sizeof(float));
+       memset(iLBCdec_inst->prevResidual, 0, BLOCKL_MAX*sizeof(float));
+       iLBCdec_inst->seed=777;
+   
+       memset(iLBCdec_inst->hpomem, 0, 4*sizeof(float));
+   
+       iLBCdec_inst->use_enhancer = use_enhancer;
+       memset(iLBCdec_inst->enh_buf, 0, ENH_BUFL*sizeof(float));
+       for (i=0;i<ENH_NBLOCKS_TOT;i++) 
+           iLBCdec_inst->enh_period[i]=(float)40.0;
+   
+       iLBCdec_inst->prev_enh_pl = 0;
+   
+       return (iLBCdec_inst->blockl);
+   }
+   
+   
+   
+   /*----------------------------------------------------------------*
+    *  frame residual decoder function (subrutine to iLBC_decode) 
+    *---------------------------------------------------------------*/
+   
+   void Decode(
+       iLBC_Dec_Inst_t *iLBCdec_inst,  /* (i/o) the decoder state 
+                                                structure */
+       float *decresidual,             /* (o) decoded residual frame */
+       int start,                      /* (i) location of start 
+                                              state */
+       int idxForMax,                  /* (i) codebook index for the 
+                                              maximum value */
+       int *idxVec,                /* (i) codebook indexes for the 
+                                              samples  in the start 
+                                              state */
+       float *syntdenum,               /* (i) the decoded synthesis
+                                              filter coefficients */
+       int *cb_index,                  /* (i) the indexes for the 
+                                              adaptive codebook */
+       int *gain_index,            /* (i) the indexes for the 
+                                              corresponding gains */
+       int *extra_cb_index,        /* (i) the indexes for the 
+                                              adaptive codebook part 
+                                              of start state */
+       int *extra_gain_index,          /* (i) the indexes for the 
+                                              corresponding gains */
+       int state_first                 /* (i) 1 if non adaptive part 
+                                              of start state comes 
+                                              first 0 if that part 
+                                              comes last */
+   ){
+       float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML];
+       int k, meml_gotten, Nfor, Nback, i;
+       int diff, start_pos;
+       int subcount, subframe;
+   
+       diff = STATE_LEN - iLBCdec_inst->state_short_len;
+       
+       if (state_first == 1) {
+           start_pos = (start-1)*SUBL;
+       } else {
+           start_pos = (start-1)*SUBL + diff;
+       }
+   
+       /* decode scalar part of start state */
+   
+       StateConstructW(idxForMax, idxVec, 
+           &syntdenum[(start-1)*(LPC_FILTERORDER+1)], 
+           &decresidual[start_pos], iLBCdec_inst->state_short_len);
+   
+       
+       if (state_first) { /* put adaptive part in the end */
+                   
+   
+   
+           /* setup memory */
+   
+           memset(mem, 0, 
+               (CB_MEML-iLBCdec_inst->state_short_len)*sizeof(float));
+           memcpy(mem+CB_MEML-iLBCdec_inst->state_short_len, 
+               decresidual+start_pos, 
+               iLBCdec_inst->state_short_len*sizeof(float));
+           
+           /* construct decoded vector */
+   
+           iCBConstruct(
+               &decresidual[start_pos+iLBCdec_inst->state_short_len],
+               extra_cb_index, extra_gain_index, mem+CB_MEML-stMemLTbl,
+               stMemLTbl, diff, CB_NSTAGES);
+       
+       } 
+       else {/* put adaptive part in the beginning */
+           
+           /* create reversed vectors for prediction */
+   
+           for (k=0; k<diff; k++) {
+               reverseDecresidual[k] = 
+                   decresidual[(start+1)*SUBL-1-
+                           (k+iLBCdec_inst->state_short_len)];
+           }
+           
+           /* setup memory */
+   
+           meml_gotten = iLBCdec_inst->state_short_len;
+           for (k=0; k<meml_gotten; k++){ 
+               mem[CB_MEML-1-k] = decresidual[start_pos + k];
+           } 
+           memset(mem, 0, (CB_MEML-k)*sizeof(float));
+           
+           /* construct decoded vector */
+   
+           iCBConstruct(reverseDecresidual, extra_cb_index, 
+               extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl,
+               diff, CB_NSTAGES);
+           
+           /* get decoded residual from reversed vector */
+   
+           for (k=0; k<diff; k++) {
+               decresidual[start_pos-1-k] = reverseDecresidual[k];
+           }
+       }
+   
+       /* counter for predicted sub-frames */
+   
+       subcount=0;
+   
+       /* forward prediction of sub-frames */
+   
+       Nfor = iLBCdec_inst->nsub-start-1;
+   
+   
+       
+       if ( Nfor > 0 ){
+           
+           /* setup memory */
+   
+           memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float));
+           memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL,
+               STATE_LEN*sizeof(float));
+   
+           /* loop over sub-frames to encode */
+   
+           for (subframe=0; subframe<Nfor; subframe++) {
+               
+               /* construct decoded vector */
+   
+               iCBConstruct(&decresidual[(start+1+subframe)*SUBL], 
+                   cb_index+subcount*CB_NSTAGES, 
+                   gain_index+subcount*CB_NSTAGES, 
+                   mem+CB_MEML-memLfTbl[subcount], 
+                   memLfTbl[subcount], SUBL, CB_NSTAGES);
+   
+               /* update memory */
+   
+               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+               memcpy(mem+CB_MEML-SUBL, 
+                   &decresidual[(start+1+subframe)*SUBL],
+                   SUBL*sizeof(float));
+   
+               subcount++;
+   
+           }
+   
+       }
+       
+       /* backward prediction of sub-frames */
+   
+       Nback = start-1;
+   
+       if ( Nback > 0 ) {
+   
+           /* setup memory */
+   
+           meml_gotten = SUBL*(iLBCdec_inst->nsub+1-start);
+           
+           if ( meml_gotten > CB_MEML ) { 
+               meml_gotten=CB_MEML;
+           }
+           for (k=0; k<meml_gotten; k++) { 
+               mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k];
+           }
+           memset(mem, 0, (CB_MEML-k)*sizeof(float));
+   
+           /* loop over subframes to decode */
+   
+   
+   
+           for (subframe=0; subframe<Nback; subframe++) {
+               
+               /* construct decoded vector */
+   
+               iCBConstruct(&reverseDecresidual[subframe*SUBL], 
+                   cb_index+subcount*CB_NSTAGES, 
+                   gain_index+subcount*CB_NSTAGES, 
+                   mem+CB_MEML-memLfTbl[subcount], memLfTbl[subcount], 
+                   SUBL, CB_NSTAGES);
+   
+               /* update memory */
+   
+               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+               memcpy(mem+CB_MEML-SUBL, 
+                   &reverseDecresidual[subframe*SUBL],
+                   SUBL*sizeof(float));
+   
+               subcount++;
+           }
+   
+           /* get decoded residual from reversed vector */
+   
+           for (i=0; i<SUBL*Nback; i++)
+               decresidual[SUBL*Nback - i - 1] = 
+               reverseDecresidual[i];
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  main decoder function 
+    *---------------------------------------------------------------*/
+   
+   void iLBC_decode( 
+       float *decblock,            /* (o) decoded signal block */
+       unsigned char *bytes,           /* (i) encoded signal bits */
+       iLBC_Dec_Inst_t *iLBCdec_inst,  /* (i/o) the decoder state 
+                                                structure */
+       int mode                    /* (i) 0: bad packet, PLC, 
+                                              1: normal */
+   ){
+       float data[BLOCKL_MAX];
+       float lsfdeq[LPC_FILTERORDER*LPC_N_MAX];
+       float PLCresidual[BLOCKL_MAX], PLClpc[LPC_FILTERORDER + 1];
+       float zeros[BLOCKL_MAX], one[LPC_FILTERORDER + 1];
+       int k, i, start, idxForMax, pos, lastpart, ulp;
+       int lag, ilag;
+       float cc, maxcc;
+       int idxVec[STATE_LEN];
+       int check;
+       int gain_index[NASUB_MAX*CB_NSTAGES], 
+           extra_gain_index[CB_NSTAGES];
+       int cb_index[CB_NSTAGES*NASUB_MAX], extra_cb_index[CB_NSTAGES];
+       int lsf_i[LSF_NSPLIT*LPC_N_MAX];
+       int state_first;
+   
+   
+       int last_bit;
+       unsigned char *pbytes;
+       float weightdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
+       int order_plus_one;
+       float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; 
+       float decresidual[BLOCKL_MAX];
+       
+       if (mode>0) { /* the data are good */
+   
+           /* decode data */
+           
+           pbytes=bytes;
+           pos=0;
+   
+           /* Set everything to zero before decoding */
+   
+           for (k=0; k<LSF_NSPLIT*LPC_N_MAX; k++) {
+               lsf_i[k]=0;
+           }
+           start=0;
+           state_first=0;
+           idxForMax=0;
+           for (k=0; k<iLBCdec_inst->state_short_len; k++) {
+               idxVec[k]=0;
+           }
+           for (k=0; k<CB_NSTAGES; k++) {
+               extra_cb_index[k]=0;
+           }
+           for (k=0; k<CB_NSTAGES; k++) {
+               extra_gain_index[k]=0;
+           }
+           for (i=0; i<iLBCdec_inst->nasub; i++) {
+               for (k=0; k<CB_NSTAGES; k++) {
+                   cb_index[i*CB_NSTAGES+k]=0;
+               }
+           }
+           for (i=0; i<iLBCdec_inst->nasub; i++) {
+               for (k=0; k<CB_NSTAGES; k++) {
+                   gain_index[i*CB_NSTAGES+k]=0;
+               }
+           }
+   
+           /* loop over ULP classes */
+   
+           for (ulp=0; ulp<3; ulp++) {
+           
+               /* LSF */
+               for (k=0; k<LSF_NSPLIT*iLBCdec_inst->lpc_n; k++){
+                   unpack( &pbytes, &lastpart, 
+                       iLBCdec_inst->ULP_inst->lsf_bits[k][ulp], &pos);
+                   packcombine(&lsf_i[k], lastpart,
+                       iLBCdec_inst->ULP_inst->lsf_bits[k][ulp]);
+               }
+   
+   
+   
+               /* Start block info */
+   
+               unpack( &pbytes, &lastpart, 
+                   iLBCdec_inst->ULP_inst->start_bits[ulp], &pos);
+               packcombine(&start, lastpart, 
+                   iLBCdec_inst->ULP_inst->start_bits[ulp]);
+   
+               unpack( &pbytes, &lastpart, 
+                   iLBCdec_inst->ULP_inst->startfirst_bits[ulp], &pos);
+               packcombine(&state_first, lastpart,
+                   iLBCdec_inst->ULP_inst->startfirst_bits[ulp]);
+   
+               unpack( &pbytes, &lastpart, 
+                   iLBCdec_inst->ULP_inst->scale_bits[ulp], &pos);
+               packcombine(&idxForMax, lastpart, 
+                   iLBCdec_inst->ULP_inst->scale_bits[ulp]);
+   
+               for (k=0; k<iLBCdec_inst->state_short_len; k++) {
+                   unpack( &pbytes, &lastpart, 
+                       iLBCdec_inst->ULP_inst->state_bits[ulp], &pos);
+                   packcombine(idxVec+k, lastpart,
+                       iLBCdec_inst->ULP_inst->state_bits[ulp]);
+               }
+   
+               /* 23/22 (20ms/30ms) sample block */
+   
+               for (k=0; k<CB_NSTAGES; k++) {
+                   unpack( &pbytes, &lastpart, 
+                       iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp], 
+                       &pos);
+                   packcombine(extra_cb_index+k, lastpart, 
+                       iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp]);
+               }
+               for (k=0; k<CB_NSTAGES; k++) {
+                   unpack( &pbytes, &lastpart, 
+                       iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp], 
+                       &pos);
+                   packcombine(extra_gain_index+k, lastpart,
+                       iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp]);
+               }
+                   
+               /* The two/four (20ms/30ms) 40 sample sub-blocks */
+   
+               for (i=0; i<iLBCdec_inst->nasub; i++) {
+                   for (k=0; k<CB_NSTAGES; k++) {
+                       unpack( &pbytes, &lastpart, 
+                       iLBCdec_inst->ULP_inst->cb_index[i][k][ulp], 
+                           &pos);
+                       packcombine(cb_index+i*CB_NSTAGES+k, lastpart, 
+                       iLBCdec_inst->ULP_inst->cb_index[i][k][ulp]);
+                   }
+               }
+               
+               for (i=0; i<iLBCdec_inst->nasub; i++) {
+   
+   
+                   for (k=0; k<CB_NSTAGES; k++) {
+                       unpack( &pbytes, &lastpart, 
+   
+                       iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp], 
+                           &pos);
+                       packcombine(gain_index+i*CB_NSTAGES+k, lastpart,
+                           iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp]);
+                   }
+               }
+           }
+           /* Extract last bit. If it is 1 this indicates an 
+              empty/lost frame */
+           unpack( &pbytes, &last_bit, 1, &pos);
+   
+           /* Check for bit errors or empty/lost frames */
+           if (start<1)
+               mode = 0;
+           if (iLBCdec_inst->mode==20 && start>3)
+               mode = 0;
+           if (iLBCdec_inst->mode==30 && start>5)
+               mode = 0;
+           if (last_bit==1)
+               mode = 0;
+   
+           if (mode==1) { /* No bit errors was detected, 
+                             continue decoding */
+                   
+               /* adjust index */
+               index_conv_dec(cb_index);
+   
+               /* decode the lsf */
+   
+               SimplelsfDEQ(lsfdeq, lsf_i, iLBCdec_inst->lpc_n);
+               check=LSF_check(lsfdeq, LPC_FILTERORDER, 
+                   iLBCdec_inst->lpc_n);
+               DecoderInterpolateLSF(syntdenum, weightdenum, 
+                   lsfdeq, LPC_FILTERORDER, iLBCdec_inst);
+           
+               Decode(iLBCdec_inst, decresidual, start, idxForMax, 
+                   idxVec, syntdenum, cb_index, gain_index, 
+                   extra_cb_index, extra_gain_index, 
+                   state_first);
+   
+               /* preparing the plc for a future loss! */
+   
+               doThePLC(PLCresidual, PLClpc, 0, decresidual, 
+                   syntdenum + 
+                   (LPC_FILTERORDER + 1)*(iLBCdec_inst->nsub - 1),
+                   (*iLBCdec_inst).last_lag, iLBCdec_inst);
+   
+           
+               memcpy(decresidual, PLCresidual, 
+                   iLBCdec_inst->blockl*sizeof(float));
+           }
+   
+   
+           
+       }
+       
+       if (mode == 0) {
+           /* the data is bad (either a PLC call
+            * was made or a severe bit error was detected)
+            */
+           
+           /* packet loss conceal */
+   
+           memset(zeros, 0, BLOCKL_MAX*sizeof(float));
+           
+           one[0] = 1;
+           memset(one+1, 0, LPC_FILTERORDER*sizeof(float));
+           
+           start=0;
+           
+           doThePLC(PLCresidual, PLClpc, 1, zeros, one,
+               (*iLBCdec_inst).last_lag, iLBCdec_inst);
+           memcpy(decresidual, PLCresidual, 
+               iLBCdec_inst->blockl*sizeof(float));
+           
+           order_plus_one = LPC_FILTERORDER + 1;
+           for (i = 0; i < iLBCdec_inst->nsub; i++) {
+               memcpy(syntdenum+(i*order_plus_one), PLClpc, 
+                   order_plus_one*sizeof(float));
+           }
+       }
+   
+       if (iLBCdec_inst->use_enhancer == 1) {
+   
+           /* post filtering */
+           
+           iLBCdec_inst->last_lag = 
+               enhancerInterface(data, decresidual, iLBCdec_inst);
+   
+           /* synthesis filtering */
+           
+           if (iLBCdec_inst->mode==20) {
+               /* Enhancer has 40 samples delay */
+               i=0;
+               syntFilter(data + i*SUBL, 
+                   iLBCdec_inst->old_syntdenum + 
+                   (i+iLBCdec_inst->nsub-1)*(LPC_FILTERORDER+1), 
+                   SUBL, iLBCdec_inst->syntMem);
+               for (i=1; i < iLBCdec_inst->nsub; i++) {
+                   syntFilter(data + i*SUBL, 
+                       syntdenum + (i-1)*(LPC_FILTERORDER+1), 
+                       SUBL, iLBCdec_inst->syntMem);
+               }
+           } else if (iLBCdec_inst->mode==30) {
+               /* Enhancer has 80 samples delay */
+               for (i=0; i < 2; i++) {
+                   syntFilter(data + i*SUBL, 
+   
+   
+                       iLBCdec_inst->old_syntdenum + 
+                       (i+iLBCdec_inst->nsub-2)*(LPC_FILTERORDER+1),
+                       SUBL, iLBCdec_inst->syntMem);
+               }
+               for (i=2; i < iLBCdec_inst->nsub; i++) {
+                   syntFilter(data + i*SUBL, 
+                       syntdenum + (i-2)*(LPC_FILTERORDER+1), SUBL,
+                       iLBCdec_inst->syntMem);
+               }
+           }
+   
+       } else {
+   
+           /* Find last lag */
+           lag = 20;
+           maxcc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], 
+               &decresidual[BLOCKL_MAX-ENH_BLOCKL-lag], ENH_BLOCKL);
+           
+           for (ilag=21; ilag<120; ilag++) {
+               cc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], 
+                   &decresidual[BLOCKL_MAX-ENH_BLOCKL-ilag], 
+                   ENH_BLOCKL);
+           
+               if (cc > maxcc) {
+                   maxcc = cc;
+                   lag = ilag;
+               }
+           }
+           iLBCdec_inst->last_lag = lag;
+   
+           /* copy data and run synthesis filter */
+   
+           memcpy(data, decresidual, 
+               iLBCdec_inst->blockl*sizeof(float));
+           for (i=0; i < iLBCdec_inst->nsub; i++) {
+               syntFilter(data + i*SUBL, 
+                   syntdenum + i*(LPC_FILTERORDER+1), SUBL, 
+                   iLBCdec_inst->syntMem);
+           }
+       }
+   
+       /* high pass filtering on output if desired, otherwise 
+          copy to out */
+   
+       hpOutput(data, iLBCdec_inst->blockl, 
+                   decblock,iLBCdec_inst->hpomem);
+   
+       /* memcpy(decblock,data,iLBCdec_inst->blockl*sizeof(float));*/
+   
+       memcpy(iLBCdec_inst->old_syntdenum, syntdenum, 
+   
+           iLBCdec_inst->nsub*(LPC_FILTERORDER+1)*sizeof(float));
+   
+       iLBCdec_inst->prev_enh_pl=0;
+   
+   
+   
+       if (mode==0) { /* PLC was used */
+           iLBCdec_inst->prev_enh_pl=1;
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iLBC_decode.h	Fri Sep 21 14:49:14 2007
@@ -1,30 +1,30 @@
-/******************************************************************
-
-iLBC Speech Coder ANSI-C Source Code
-
-iLBC_decode.h    
-
-Copyright (C) The Internet Society (2004). 
-All Rights Reserved.
-
-******************************************************************/
-
-#ifndef __iLBC_ILBCDECODE_H
-#define __iLBC_ILBCDECODE_H
-
-#include "iLBC_define.h"
-
-short initDecode(								/* (o) Number of decoded samples */
-				 iLBC_Dec_Inst_t *iLBCdec_inst,	/* (i/o) Decoder instance */
-				 int mode,						/* (i) frame size mode */
-				 int use_enhancer				/* (i) 1 to use enhancer 0 to run without enhancer */
-				 );
-
-void iLBC_decode( 
-				 float *decblock,				/* (o) decoded signal block */
-				 unsigned char *bytes,			/* (i) encoded signal bits */
-				 iLBC_Dec_Inst_t *iLBCdec_inst,	/* (i/o) the decoder state structure */
-				 int mode						/* (i) 0: bad packet, PLC, 1: normal */
-				 );
-
-#endif
+/******************************************************************
+
+iLBC Speech Coder ANSI-C Source Code
+
+iLBC_decode.h    
+
+Copyright (C) The Internet Society (2004). 
+All Rights Reserved.
+
+******************************************************************/
+
+#ifndef __iLBC_ILBCDECODE_H
+#define __iLBC_ILBCDECODE_H
+
+#include "iLBC_define.h"
+
+short initDecode(								/* (o) Number of decoded samples */
+				 iLBC_Dec_Inst_t *iLBCdec_inst,	/* (i/o) Decoder instance */
+				 int mode,						/* (i) frame size mode */
+				 int use_enhancer				/* (i) 1 to use enhancer 0 to run without enhancer */
+				 );
+
+void iLBC_decode( 
+				 float *decblock,				/* (o) decoded signal block */
+				 unsigned char *bytes,			/* (i) encoded signal bits */
+				 iLBC_Dec_Inst_t *iLBCdec_inst,	/* (i/o) the decoder state structure */
+				 int mode						/* (i) 0: bad packet, PLC, 1: normal */
+				 );
+
+#endif

Modified: freeswitch/trunk/libs/codec/ilbc/src/iLBC_define.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iLBC_define.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iLBC_define.h	Fri Sep 21 14:49:14 2007
@@ -1,204 +1,204 @@
-
-/******************************************************************
-
-iLBC Speech Coder ANSI-C Source Code
-
-iLBC_define.h    
-
-Copyright (C) The Internet Society (2004). 
-All Rights Reserved.
-
-******************************************************************/
-#include <string.h>
-
-#ifndef __iLBC_ILBCDEFINE_H
-#define __iLBC_ILBCDEFINE_H
-
-/* general codec settings */
-
-#define FS                      (float)8000.0
-#define BLOCKL_20MS             160
-#define BLOCKL_30MS             240
-#define BLOCKL_MAX              240
-#define NSUB_20MS               4
-#define NSUB_30MS               6
-#define NSUB_MAX            6
-#define NASUB_20MS              2
-#define NASUB_30MS              4
-#define NASUB_MAX               4
-#define SUBL                40
-#define STATE_LEN               80
-#define STATE_SHORT_LEN_30MS    58
-#define STATE_SHORT_LEN_20MS    57
-
-/* LPC settings */
-
-#define LPC_FILTERORDER         10
-#define LPC_CHIRP_SYNTDENUM     (float)0.9025
-#define LPC_CHIRP_WEIGHTDENUM   (float)0.4222
-#define LPC_LOOKBACK        60
-#define LPC_N_20MS              1
-#define LPC_N_30MS              2
-#define LPC_N_MAX               2
-#define LPC_ASYMDIFF        20
-#define LPC_BW                  (float)60.0
-#define LPC_WN                  (float)1.0001
-#define LSF_NSPLIT              3
-
-
-#define LSF_NUMBER_OF_STEPS     4
-#define LPC_HALFORDER           (LPC_FILTERORDER/2)
-
-/* cb settings */
-
-#define CB_NSTAGES              3
-#define CB_EXPAND               2
-#define CB_MEML                 147
-#define CB_FILTERLEN        2*4
-#define CB_HALFFILTERLEN    4
-#define CB_RESRANGE             34
-#define CB_MAXGAIN              (float)1.3 
-
-/* enhancer */
-
-#define ENH_BLOCKL              80  /* block length */
-#define ENH_BLOCKL_HALF         (ENH_BLOCKL/2)
-#define ENH_HL                  3   /* 2*ENH_HL+1 is number blocks
-in said second sequence */
-#define ENH_SLOP            2   /* max difference estimated and
-correct pitch period */
-#define ENH_PLOCSL              20  /* pitch-estimates and pitch-
-locations buffer length */
-#define ENH_OVERHANG        2
-#define ENH_UPS0            4   /* upsampling rate */
-#define ENH_FL0                 3   /* 2*FLO+1 is the length of 
-each filter */
-#define ENH_VECTL               (ENH_BLOCKL+2*ENH_FL0)
-#define ENH_CORRDIM             (2*ENH_SLOP+1)
-#define ENH_NBLOCKS             (BLOCKL_MAX/ENH_BLOCKL)
-#define ENH_NBLOCKS_EXTRA       5
-#define ENH_NBLOCKS_TOT         8   /* ENH_NBLOCKS + 
-ENH_NBLOCKS_EXTRA */
-#define ENH_BUFL            (ENH_NBLOCKS_TOT)*ENH_BLOCKL
-#define ENH_ALPHA0              (float)0.05
-
-/* Down sampling */
-
-#define FILTERORDER_DS          7
-#define DELAY_DS            3
-#define FACTOR_DS               2
-
-/* bit stream defs */
-
-#define NO_OF_BYTES_20MS    38
-#define NO_OF_BYTES_30MS    50
-#define NO_OF_WORDS_20MS    19
-#define NO_OF_WORDS_30MS    25
-#define STATE_BITS              3
-#define BYTE_LEN            8
-#define ULP_CLASSES             3
-
-/* help parameters */
-
-
-
-#define FLOAT_MAX               (float)1.0e37
-#define EPS                     (float)2.220446049250313e-016
-#define PI                      (float)3.14159265358979323846
-#define MIN_SAMPLE              -32768
-#define MAX_SAMPLE              32767
-#define TWO_PI                  (float)6.283185307
-#define PI2                     (float)0.159154943
-
-/* type definition encoder instance */
-typedef struct iLBC_ULP_Inst_t_ {
-	int lsf_bits[6][ULP_CLASSES+2];
-	int start_bits[ULP_CLASSES+2];
-	int startfirst_bits[ULP_CLASSES+2];
-	int scale_bits[ULP_CLASSES+2];
-	int state_bits[ULP_CLASSES+2];
-	int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
-	int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
-	int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
-	int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
-} iLBC_ULP_Inst_t;
-
-/* type definition encoder instance */
-typedef struct iLBC_Enc_Inst_t_ {
-
-	/* flag for frame size mode */
-	int mode;
-
-	/* basic parameters for different frame sizes */
-	int blockl;
-	int nsub;
-	int nasub;
-	int no_of_bytes, no_of_words;
-	int lpc_n;
-	int state_short_len;
-	const iLBC_ULP_Inst_t *ULP_inst;
-
-	/* analysis filter state */
-	float anaMem[LPC_FILTERORDER];
-
-	/* old lsf parameters for interpolation */
-	float lsfold[LPC_FILTERORDER];
-	float lsfdeqold[LPC_FILTERORDER];
-
-	/* signal buffer for LP analysis */
-	float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
-
-	/* state of input HP filter */
-	float hpimem[4];
-
-} iLBC_Enc_Inst_t;
-
-/* type definition decoder instance */
-typedef struct iLBC_Dec_Inst_t_ {
-
-
-
-	/* flag for frame size mode */
-	int mode;
-
-	/* basic parameters for different frame sizes */
-	int blockl;
-	int nsub;
-	int nasub;
-	int no_of_bytes, no_of_words;
-	int lpc_n;
-	int state_short_len;
-	const iLBC_ULP_Inst_t *ULP_inst;
-
-	/* synthesis filter state */
-	float syntMem[LPC_FILTERORDER];
-
-	/* old LSF for interpolation */
-	float lsfdeqold[LPC_FILTERORDER];
-
-	/* pitch lag estimated in enhancer and used in PLC */
-	int last_lag;
-
-	/* PLC state information */
-	int prevLag, consPLICount, prevPLI, prev_enh_pl;
-	float prevLpc[LPC_FILTERORDER+1];
-	float prevResidual[NSUB_MAX*SUBL];
-	float per;
-	unsigned long seed;
-
-	/* previous synthesis filter parameters */
-	float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
-
-	/* state of output HP filter */
-	float hpomem[4];
-
-	/* enhancer state information */
-	int use_enhancer;
-	float enh_buf[ENH_BUFL];
-	float enh_period[ENH_NBLOCKS_TOT];
-
-} iLBC_Dec_Inst_t;
-
-#endif
-
-
+
+/******************************************************************
+
+iLBC Speech Coder ANSI-C Source Code
+
+iLBC_define.h    
+
+Copyright (C) The Internet Society (2004). 
+All Rights Reserved.
+
+******************************************************************/
+#include <string.h>
+
+#ifndef __iLBC_ILBCDEFINE_H
+#define __iLBC_ILBCDEFINE_H
+
+/* general codec settings */
+
+#define FS                      (float)8000.0
+#define BLOCKL_20MS             160
+#define BLOCKL_30MS             240
+#define BLOCKL_MAX              240
+#define NSUB_20MS               4
+#define NSUB_30MS               6
+#define NSUB_MAX            6
+#define NASUB_20MS              2
+#define NASUB_30MS              4
+#define NASUB_MAX               4
+#define SUBL                40
+#define STATE_LEN               80
+#define STATE_SHORT_LEN_30MS    58
+#define STATE_SHORT_LEN_20MS    57
+
+/* LPC settings */
+
+#define LPC_FILTERORDER         10
+#define LPC_CHIRP_SYNTDENUM     (float)0.9025
+#define LPC_CHIRP_WEIGHTDENUM   (float)0.4222
+#define LPC_LOOKBACK        60
+#define LPC_N_20MS              1
+#define LPC_N_30MS              2
+#define LPC_N_MAX               2
+#define LPC_ASYMDIFF        20
+#define LPC_BW                  (float)60.0
+#define LPC_WN                  (float)1.0001
+#define LSF_NSPLIT              3
+
+
+#define LSF_NUMBER_OF_STEPS     4
+#define LPC_HALFORDER           (LPC_FILTERORDER/2)
+
+/* cb settings */
+
+#define CB_NSTAGES              3
+#define CB_EXPAND               2
+#define CB_MEML                 147
+#define CB_FILTERLEN        2*4
+#define CB_HALFFILTERLEN    4
+#define CB_RESRANGE             34
+#define CB_MAXGAIN              (float)1.3 
+
+/* enhancer */
+
+#define ENH_BLOCKL              80  /* block length */
+#define ENH_BLOCKL_HALF         (ENH_BLOCKL/2)
+#define ENH_HL                  3   /* 2*ENH_HL+1 is number blocks
+in said second sequence */
+#define ENH_SLOP            2   /* max difference estimated and
+correct pitch period */
+#define ENH_PLOCSL              20  /* pitch-estimates and pitch-
+locations buffer length */
+#define ENH_OVERHANG        2
+#define ENH_UPS0            4   /* upsampling rate */
+#define ENH_FL0                 3   /* 2*FLO+1 is the length of 
+each filter */
+#define ENH_VECTL               (ENH_BLOCKL+2*ENH_FL0)
+#define ENH_CORRDIM             (2*ENH_SLOP+1)
+#define ENH_NBLOCKS             (BLOCKL_MAX/ENH_BLOCKL)
+#define ENH_NBLOCKS_EXTRA       5
+#define ENH_NBLOCKS_TOT         8   /* ENH_NBLOCKS + 
+ENH_NBLOCKS_EXTRA */
+#define ENH_BUFL            (ENH_NBLOCKS_TOT)*ENH_BLOCKL
+#define ENH_ALPHA0              (float)0.05
+
+/* Down sampling */
+
+#define FILTERORDER_DS          7
+#define DELAY_DS            3
+#define FACTOR_DS               2
+
+/* bit stream defs */
+
+#define NO_OF_BYTES_20MS    38
+#define NO_OF_BYTES_30MS    50
+#define NO_OF_WORDS_20MS    19
+#define NO_OF_WORDS_30MS    25
+#define STATE_BITS              3
+#define BYTE_LEN            8
+#define ULP_CLASSES             3
+
+/* help parameters */
+
+
+
+#define FLOAT_MAX               (float)1.0e37
+#define EPS                     (float)2.220446049250313e-016
+#define PI                      (float)3.14159265358979323846
+#define MIN_SAMPLE              -32768
+#define MAX_SAMPLE              32767
+#define TWO_PI                  (float)6.283185307
+#define PI2                     (float)0.159154943
+
+/* type definition encoder instance */
+typedef struct iLBC_ULP_Inst_t_ {
+	int lsf_bits[6][ULP_CLASSES+2];
+	int start_bits[ULP_CLASSES+2];
+	int startfirst_bits[ULP_CLASSES+2];
+	int scale_bits[ULP_CLASSES+2];
+	int state_bits[ULP_CLASSES+2];
+	int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
+	int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
+	int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+	int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+} iLBC_ULP_Inst_t;
+
+/* type definition encoder instance */
+typedef struct iLBC_Enc_Inst_t_ {
+
+	/* flag for frame size mode */
+	int mode;
+
+	/* basic parameters for different frame sizes */
+	int blockl;
+	int nsub;
+	int nasub;
+	int no_of_bytes, no_of_words;
+	int lpc_n;
+	int state_short_len;
+	const iLBC_ULP_Inst_t *ULP_inst;
+
+	/* analysis filter state */
+	float anaMem[LPC_FILTERORDER];
+
+	/* old lsf parameters for interpolation */
+	float lsfold[LPC_FILTERORDER];
+	float lsfdeqold[LPC_FILTERORDER];
+
+	/* signal buffer for LP analysis */
+	float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
+
+	/* state of input HP filter */
+	float hpimem[4];
+
+} iLBC_Enc_Inst_t;
+
+/* type definition decoder instance */
+typedef struct iLBC_Dec_Inst_t_ {
+
+
+
+	/* flag for frame size mode */
+	int mode;
+
+	/* basic parameters for different frame sizes */
+	int blockl;
+	int nsub;
+	int nasub;
+	int no_of_bytes, no_of_words;
+	int lpc_n;
+	int state_short_len;
+	const iLBC_ULP_Inst_t *ULP_inst;
+
+	/* synthesis filter state */
+	float syntMem[LPC_FILTERORDER];
+
+	/* old LSF for interpolation */
+	float lsfdeqold[LPC_FILTERORDER];
+
+	/* pitch lag estimated in enhancer and used in PLC */
+	int last_lag;
+
+	/* PLC state information */
+	int prevLag, consPLICount, prevPLI, prev_enh_pl;
+	float prevLpc[LPC_FILTERORDER+1];
+	float prevResidual[NSUB_MAX*SUBL];
+	float per;
+	unsigned long seed;
+
+	/* previous synthesis filter parameters */
+	float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
+
+	/* state of output HP filter */
+	float hpomem[4];
+
+	/* enhancer state information */
+	int use_enhancer;
+	float enh_buf[ENH_BUFL];
+	float enh_period[ENH_NBLOCKS_TOT];
+
+} iLBC_Dec_Inst_t;
+
+#endif
+
+

Modified: freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.c	Fri Sep 21 14:49:14 2007
@@ -1,513 +1,513 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       iLBC_encode.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <stdlib.h>
-   #include <string.h>
-   
-   #include "iLBC_define.h"
-   #include "LPCencode.h"
-   #include "FrameClassify.h"
-   #include "StateSearchW.h"
-   #include "StateConstructW.h"
-   #include "helpfun.h"
-   #include "constants.h"
-   #include "packing.h"
-   #include "iCBSearch.h"
-   #include "iCBConstruct.h"
-   #include "hpInput.h"
-   #include "anaFilter.h"
-   #include "syntFilter.h"
-   
-   /*----------------------------------------------------------------*
-    *  Initiation of encoder instance.
-    *---------------------------------------------------------------*/
-   
-   short initEncode(                   /* (o) Number of bytes 
-                                              encoded */
-       iLBC_Enc_Inst_t *iLBCenc_inst,  /* (i/o) Encoder instance */
-       int mode                    /* (i) frame size mode */
-   ){
-       iLBCenc_inst->mode = mode;
-       if (mode==30) {
-           iLBCenc_inst->blockl = BLOCKL_30MS;
-           iLBCenc_inst->nsub = NSUB_30MS;
-   
-   
-           iLBCenc_inst->nasub = NASUB_30MS;
-           iLBCenc_inst->lpc_n = LPC_N_30MS;
-           iLBCenc_inst->no_of_bytes = NO_OF_BYTES_30MS;
-           iLBCenc_inst->no_of_words = NO_OF_WORDS_30MS;
-           iLBCenc_inst->state_short_len=STATE_SHORT_LEN_30MS;
-           /* ULP init */
-           iLBCenc_inst->ULP_inst=&ULP_30msTbl;
-       }
-       else if (mode==20) {
-           iLBCenc_inst->blockl = BLOCKL_20MS;
-           iLBCenc_inst->nsub = NSUB_20MS;
-           iLBCenc_inst->nasub = NASUB_20MS;
-           iLBCenc_inst->lpc_n = LPC_N_20MS;
-           iLBCenc_inst->no_of_bytes = NO_OF_BYTES_20MS;
-           iLBCenc_inst->no_of_words = NO_OF_WORDS_20MS;
-           iLBCenc_inst->state_short_len=STATE_SHORT_LEN_20MS;
-           /* ULP init */
-           iLBCenc_inst->ULP_inst=&ULP_20msTbl;
-       }
-       else {
-           exit(2);
-       }
-   
-       memset((*iLBCenc_inst).anaMem, 0, 
-           LPC_FILTERORDER*sizeof(float));
-       memcpy((*iLBCenc_inst).lsfold, lsfmeanTbl,
-           LPC_FILTERORDER*sizeof(float));
-       memcpy((*iLBCenc_inst).lsfdeqold, lsfmeanTbl,
-           LPC_FILTERORDER*sizeof(float));
-       memset((*iLBCenc_inst).lpc_buffer, 0, 
-           (LPC_LOOKBACK+BLOCKL_MAX)*sizeof(float));
-       memset((*iLBCenc_inst).hpimem, 0, 4*sizeof(float));
-   
-       return (iLBCenc_inst->no_of_bytes);
-   }
-   
-   /*----------------------------------------------------------------*
-    *  main encoder function 
-    *---------------------------------------------------------------*/
-   
-   void iLBC_encode(
-       unsigned char *bytes,           /* (o) encoded data bits iLBC */
-       float *block,                   /* (o) speech vector to 
-                                              encode */
-       iLBC_Enc_Inst_t *iLBCenc_inst   /* (i/o) the general encoder 
-                                              state */
-   ){
-       
-       float data[BLOCKL_MAX];
-       float residual[BLOCKL_MAX], reverseResidual[BLOCKL_MAX];
-   
-       int start, idxForMax, idxVec[STATE_LEN];
-       float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML];
-       int n, k, meml_gotten, Nfor, Nback, i, pos;
-   
-   
-       int gain_index[CB_NSTAGES*NASUB_MAX], 
-           extra_gain_index[CB_NSTAGES];
-       int cb_index[CB_NSTAGES*NASUB_MAX],extra_cb_index[CB_NSTAGES];
-       int lsf_i[LSF_NSPLIT*LPC_N_MAX];
-       unsigned char *pbytes;
-       int diff, start_pos, state_first;
-       float en1, en2;
-       int index, ulp, firstpart;
-       int subcount, subframe;
-       float weightState[LPC_FILTERORDER];
-       float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; 
-       float weightdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; 
-       float decresidual[BLOCKL_MAX];
-   
-       /* high pass filtering of input signal if such is not done 
-              prior to calling this function */
-   
-       hpInput(block, iLBCenc_inst->blockl, 
-                   data, (*iLBCenc_inst).hpimem);
-   
-       /* otherwise simply copy */
-   
-       /*memcpy(data,block,iLBCenc_inst->blockl*sizeof(float));*/
-           
-       /* LPC of hp filtered input data */
-   
-       LPCencode(syntdenum, weightdenum, lsf_i, data, iLBCenc_inst);
-   
-   
-       /* inverse filter to get residual */
-   
-       for (n=0; n<iLBCenc_inst->nsub; n++) {
-           anaFilter(&data[n*SUBL], &syntdenum[n*(LPC_FILTERORDER+1)], 
-               SUBL, &residual[n*SUBL], iLBCenc_inst->anaMem);
-       }
-   
-       /* find state location */
-   
-       start = FrameClassify(iLBCenc_inst, residual);
-       
-       /* check if state should be in first or last part of the 
-       two subframes */
-   
-       diff = STATE_LEN - iLBCenc_inst->state_short_len;
-       en1 = 0;
-       index = (start-1)*SUBL;
-       for (i = 0; i < iLBCenc_inst->state_short_len; i++) {
-           en1 += residual[index+i]*residual[index+i];
-       }
-       en2 = 0;
-       index = (start-1)*SUBL+diff;
-       for (i = 0; i < iLBCenc_inst->state_short_len; i++) {
-           en2 += residual[index+i]*residual[index+i];
-       }
-   
-   
-       
-       
-       if (en1 > en2) {
-           state_first = 1;
-           start_pos = (start-1)*SUBL;
-       } else {
-           state_first = 0;
-           start_pos = (start-1)*SUBL + diff;
-       }
-   
-       /* scalar quantization of state */
-   
-       StateSearchW(iLBCenc_inst, &residual[start_pos], 
-           &syntdenum[(start-1)*(LPC_FILTERORDER+1)], 
-           &weightdenum[(start-1)*(LPC_FILTERORDER+1)], &idxForMax, 
-           idxVec, iLBCenc_inst->state_short_len, state_first);
-   
-       StateConstructW(idxForMax, idxVec, 
-           &syntdenum[(start-1)*(LPC_FILTERORDER+1)], 
-           &decresidual[start_pos], iLBCenc_inst->state_short_len);
-   
-       /* predictive quantization in state */
-       
-       if (state_first) { /* put adaptive part in the end */
-           
-           /* setup memory */
-   
-           memset(mem, 0, 
-               (CB_MEML-iLBCenc_inst->state_short_len)*sizeof(float));
-           memcpy(mem+CB_MEML-iLBCenc_inst->state_short_len, 
-               decresidual+start_pos, 
-               iLBCenc_inst->state_short_len*sizeof(float));
-           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
-   
-           /* encode sub-frames */
-   
-           iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, 
-               &residual[start_pos+iLBCenc_inst->state_short_len], 
-               mem+CB_MEML-stMemLTbl,
-               stMemLTbl, diff, CB_NSTAGES, 
-               &weightdenum[start*(LPC_FILTERORDER+1)], 
-               weightState, 0);
-   
-           /* construct decoded vector */
-   
-           iCBConstruct(
-               &decresidual[start_pos+iLBCenc_inst->state_short_len],
-               extra_cb_index, extra_gain_index, 
-               mem+CB_MEML-stMemLTbl, 
-               stMemLTbl, diff, CB_NSTAGES);
-       
-       } 
-       else { /* put adaptive part in the beginning */
-           
-   
-   
-           /* create reversed vectors for prediction */
-   
-           for (k=0; k<diff; k++) {
-               reverseResidual[k] = residual[(start+1)*SUBL-1
-                   -(k+iLBCenc_inst->state_short_len)];
-           }
-           
-           /* setup memory */
-   
-           meml_gotten = iLBCenc_inst->state_short_len;
-           for (k=0; k<meml_gotten; k++) { 
-               mem[CB_MEML-1-k] = decresidual[start_pos + k];
-           } 
-           memset(mem, 0, (CB_MEML-k)*sizeof(float));
-           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
-           
-           /* encode sub-frames */
-   
-           iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, 
-               reverseResidual, mem+CB_MEML-stMemLTbl, stMemLTbl, 
-               diff, CB_NSTAGES, 
-               &weightdenum[(start-1)*(LPC_FILTERORDER+1)], 
-               weightState, 0);
-   
-           /* construct decoded vector */
-   
-           iCBConstruct(reverseDecresidual, extra_cb_index, 
-               extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl, 
-               diff, CB_NSTAGES);
-           
-           /* get decoded residual from reversed vector */
-   
-           for (k=0; k<diff; k++) {
-               decresidual[start_pos-1-k] = reverseDecresidual[k];
-           }
-       }
-   
-       /* counter for predicted sub-frames */
-   
-       subcount=0;
-   
-       /* forward prediction of sub-frames */
-   
-       Nfor = iLBCenc_inst->nsub-start-1;
-   
-       
-       if ( Nfor > 0 ) {
-           
-           /* setup memory */
-   
-           memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float));
-           memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, 
-               STATE_LEN*sizeof(float));
-           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
-   
-   
-   
-           /* loop over sub-frames to encode */
-   
-           for (subframe=0; subframe<Nfor; subframe++) {
-   
-               /* encode sub-frame */
-   
-               iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, 
-                   gain_index+subcount*CB_NSTAGES, 
-                   &residual[(start+1+subframe)*SUBL], 
-                   mem+CB_MEML-memLfTbl[subcount], 
-                   memLfTbl[subcount], SUBL, CB_NSTAGES, 
-                   &weightdenum[(start+1+subframe)*
-                               (LPC_FILTERORDER+1)],
-                   weightState, subcount+1);
-   
-               /* construct decoded vector */
-   
-               iCBConstruct(&decresidual[(start+1+subframe)*SUBL], 
-                   cb_index+subcount*CB_NSTAGES, 
-                   gain_index+subcount*CB_NSTAGES, 
-                   mem+CB_MEML-memLfTbl[subcount], 
-                   memLfTbl[subcount], SUBL, CB_NSTAGES);
-   
-               /* update memory */
-   
-               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
-               memcpy(mem+CB_MEML-SUBL, 
-                   &decresidual[(start+1+subframe)*SUBL], 
-                   SUBL*sizeof(float));
-               memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
-   
-               subcount++;
-           }
-       }
-       
-   
-       /* backward prediction of sub-frames */
-   
-       Nback = start-1;
-   
-       
-       if ( Nback > 0 ) {
-                  
-           /* create reverse order vectors */
-   
-           for (n=0; n<Nback; n++) {
-               for (k=0; k<SUBL; k++) {
-                   reverseResidual[n*SUBL+k] = 
-                       residual[(start-1)*SUBL-1-n*SUBL-k];
-                   reverseDecresidual[n*SUBL+k] = 
-                       decresidual[(start-1)*SUBL-1-n*SUBL-k];
-               }
-           }
-   
-   
-   
-           /* setup memory */
-   
-           meml_gotten = SUBL*(iLBCenc_inst->nsub+1-start);
-   
-           
-           if ( meml_gotten > CB_MEML ) { 
-               meml_gotten=CB_MEML;
-           }
-           for (k=0; k<meml_gotten; k++) { 
-               mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k];
-           } 
-           memset(mem, 0, (CB_MEML-k)*sizeof(float));
-           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
-   
-           /* loop over sub-frames to encode */
-   
-           for (subframe=0; subframe<Nback; subframe++) {
-               
-               /* encode sub-frame */
-   
-               iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, 
-                   gain_index+subcount*CB_NSTAGES, 
-                   &reverseResidual[subframe*SUBL], 
-                   mem+CB_MEML-memLfTbl[subcount], 
-                   memLfTbl[subcount], SUBL, CB_NSTAGES, 
-                   &weightdenum[(start-2-subframe)*
-                               (LPC_FILTERORDER+1)], 
-                   weightState, subcount+1);
-   
-               /* construct decoded vector */
-   
-               iCBConstruct(&reverseDecresidual[subframe*SUBL], 
-                   cb_index+subcount*CB_NSTAGES, 
-                   gain_index+subcount*CB_NSTAGES, 
-                   mem+CB_MEML-memLfTbl[subcount], 
-                   memLfTbl[subcount], SUBL, CB_NSTAGES);
-   
-               /* update memory */
-   
-               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
-               memcpy(mem+CB_MEML-SUBL, 
-                   &reverseDecresidual[subframe*SUBL],
-                   SUBL*sizeof(float));
-               memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
-   
-               subcount++;
-   
-           }
-   
-           /* get decoded residual from reversed vector */
-   
-           for (i=0; i<SUBL*Nback; i++) {
-               decresidual[SUBL*Nback - i - 1] = 
-   
-   
-                   reverseDecresidual[i];
-           }
-       }
-       /* end encoding part */
-   
-       /* adjust index */
-       index_conv_enc(cb_index);
-   
-       /* pack bytes */
-   
-       pbytes=bytes;
-       pos=0;
-   
-       /* loop over the 3 ULP classes */
-   
-       for (ulp=0; ulp<3; ulp++) {
-       
-           /* LSF */
-           for (k=0; k<LSF_NSPLIT*iLBCenc_inst->lpc_n; k++) {
-               packsplit(&lsf_i[k], &firstpart, &lsf_i[k], 
-                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], 
-                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp]+
-                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+1]+
-                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+2]);
-               dopack( &pbytes, firstpart, 
-                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], &pos);
-           }
-   
-           /* Start block info */
-   
-           packsplit(&start, &firstpart, &start, 
-               iLBCenc_inst->ULP_inst->start_bits[ulp], 
-               iLBCenc_inst->ULP_inst->start_bits[ulp]+
-               iLBCenc_inst->ULP_inst->start_bits[ulp+1]+
-               iLBCenc_inst->ULP_inst->start_bits[ulp+2]);
-           dopack( &pbytes, firstpart, 
-               iLBCenc_inst->ULP_inst->start_bits[ulp], &pos);
-   
-           packsplit(&state_first, &firstpart, &state_first, 
-               iLBCenc_inst->ULP_inst->startfirst_bits[ulp], 
-               iLBCenc_inst->ULP_inst->startfirst_bits[ulp]+
-               iLBCenc_inst->ULP_inst->startfirst_bits[ulp+1]+
-               iLBCenc_inst->ULP_inst->startfirst_bits[ulp+2]);
-           dopack( &pbytes, firstpart, 
-               iLBCenc_inst->ULP_inst->startfirst_bits[ulp], &pos);
-   
-           packsplit(&idxForMax, &firstpart, &idxForMax, 
-               iLBCenc_inst->ULP_inst->scale_bits[ulp], 
-               iLBCenc_inst->ULP_inst->scale_bits[ulp]+
-               iLBCenc_inst->ULP_inst->scale_bits[ulp+1]+
-               iLBCenc_inst->ULP_inst->scale_bits[ulp+2]);
-           dopack( &pbytes, firstpart, 
-               iLBCenc_inst->ULP_inst->scale_bits[ulp], &pos);
-   
-   
-   
-           for (k=0; k<iLBCenc_inst->state_short_len; k++) {
-               packsplit(idxVec+k, &firstpart, idxVec+k, 
-                   iLBCenc_inst->ULP_inst->state_bits[ulp], 
-                   iLBCenc_inst->ULP_inst->state_bits[ulp]+
-                   iLBCenc_inst->ULP_inst->state_bits[ulp+1]+
-                   iLBCenc_inst->ULP_inst->state_bits[ulp+2]);
-               dopack( &pbytes, firstpart, 
-                   iLBCenc_inst->ULP_inst->state_bits[ulp], &pos);
-           }
-   
-           /* 23/22 (20ms/30ms) sample block */
-   
-           for (k=0;k<CB_NSTAGES;k++) {
-               packsplit(extra_cb_index+k, &firstpart, 
-                   extra_cb_index+k, 
-                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], 
-                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp]+
-                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+1]+
-                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+2]);
-               dopack( &pbytes, firstpart, 
-                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], 
-                   &pos);
-           }
-   
-           for (k=0;k<CB_NSTAGES;k++) {
-               packsplit(extra_gain_index+k, &firstpart, 
-                   extra_gain_index+k, 
-                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], 
-                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp]+
-                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+1]+
-                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+2]);
-               dopack( &pbytes, firstpart, 
-                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], 
-                   &pos);
-           }
-               
-           /* The two/four (20ms/30ms) 40 sample sub-blocks */
-   
-           for (i=0; i<iLBCenc_inst->nasub; i++) {
-               for (k=0; k<CB_NSTAGES; k++) {
-                   packsplit(cb_index+i*CB_NSTAGES+k, &firstpart, 
-                       cb_index+i*CB_NSTAGES+k, 
-                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], 
-                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp]+
-                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+1]+
-                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+2]);
-                   dopack( &pbytes, firstpart, 
-                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], 
-                       &pos);
-               }
-           }
-           
-           for (i=0; i<iLBCenc_inst->nasub; i++) {
-               for (k=0; k<CB_NSTAGES; k++) {
-   
-   
-                   packsplit(gain_index+i*CB_NSTAGES+k, &firstpart, 
-                       gain_index+i*CB_NSTAGES+k, 
-                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], 
-                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp]+
-                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+1]+
-                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+2]);
-                   dopack( &pbytes, firstpart, 
-                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], 
-                       &pos);
-               }
-           }
-       }
-   
-       /* set the last bit to zero (otherwise the decoder 
-          will treat it as a lost frame) */
-       dopack( &pbytes, 0, 1, &pos);
-   }
-   
-
-
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       iLBC_encode.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <stdlib.h>
+   #include <string.h>
+   
+   #include "iLBC_define.h"
+   #include "LPCencode.h"
+   #include "FrameClassify.h"
+   #include "StateSearchW.h"
+   #include "StateConstructW.h"
+   #include "helpfun.h"
+   #include "constants.h"
+   #include "packing.h"
+   #include "iCBSearch.h"
+   #include "iCBConstruct.h"
+   #include "hpInput.h"
+   #include "anaFilter.h"
+   #include "syntFilter.h"
+   
+   /*----------------------------------------------------------------*
+    *  Initiation of encoder instance.
+    *---------------------------------------------------------------*/
+   
+   short initEncode(                   /* (o) Number of bytes 
+                                              encoded */
+       iLBC_Enc_Inst_t *iLBCenc_inst,  /* (i/o) Encoder instance */
+       int mode                    /* (i) frame size mode */
+   ){
+       iLBCenc_inst->mode = mode;
+       if (mode==30) {
+           iLBCenc_inst->blockl = BLOCKL_30MS;
+           iLBCenc_inst->nsub = NSUB_30MS;
+   
+   
+           iLBCenc_inst->nasub = NASUB_30MS;
+           iLBCenc_inst->lpc_n = LPC_N_30MS;
+           iLBCenc_inst->no_of_bytes = NO_OF_BYTES_30MS;
+           iLBCenc_inst->no_of_words = NO_OF_WORDS_30MS;
+           iLBCenc_inst->state_short_len=STATE_SHORT_LEN_30MS;
+           /* ULP init */
+           iLBCenc_inst->ULP_inst=&ULP_30msTbl;
+       }
+       else if (mode==20) {
+           iLBCenc_inst->blockl = BLOCKL_20MS;
+           iLBCenc_inst->nsub = NSUB_20MS;
+           iLBCenc_inst->nasub = NASUB_20MS;
+           iLBCenc_inst->lpc_n = LPC_N_20MS;
+           iLBCenc_inst->no_of_bytes = NO_OF_BYTES_20MS;
+           iLBCenc_inst->no_of_words = NO_OF_WORDS_20MS;
+           iLBCenc_inst->state_short_len=STATE_SHORT_LEN_20MS;
+           /* ULP init */
+           iLBCenc_inst->ULP_inst=&ULP_20msTbl;
+       }
+       else {
+           exit(2);
+       }
+   
+       memset((*iLBCenc_inst).anaMem, 0, 
+           LPC_FILTERORDER*sizeof(float));
+       memcpy((*iLBCenc_inst).lsfold, lsfmeanTbl,
+           LPC_FILTERORDER*sizeof(float));
+       memcpy((*iLBCenc_inst).lsfdeqold, lsfmeanTbl,
+           LPC_FILTERORDER*sizeof(float));
+       memset((*iLBCenc_inst).lpc_buffer, 0, 
+           (LPC_LOOKBACK+BLOCKL_MAX)*sizeof(float));
+       memset((*iLBCenc_inst).hpimem, 0, 4*sizeof(float));
+   
+       return (iLBCenc_inst->no_of_bytes);
+   }
+   
+   /*----------------------------------------------------------------*
+    *  main encoder function 
+    *---------------------------------------------------------------*/
+   
+   void iLBC_encode(
+       unsigned char *bytes,           /* (o) encoded data bits iLBC */
+       float *block,                   /* (o) speech vector to 
+                                              encode */
+       iLBC_Enc_Inst_t *iLBCenc_inst   /* (i/o) the general encoder 
+                                              state */
+   ){
+       
+       float data[BLOCKL_MAX];
+       float residual[BLOCKL_MAX], reverseResidual[BLOCKL_MAX];
+   
+       int start, idxForMax, idxVec[STATE_LEN];
+       float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML];
+       int n, k, meml_gotten, Nfor, Nback, i, pos;
+   
+   
+       int gain_index[CB_NSTAGES*NASUB_MAX], 
+           extra_gain_index[CB_NSTAGES];
+       int cb_index[CB_NSTAGES*NASUB_MAX],extra_cb_index[CB_NSTAGES];
+       int lsf_i[LSF_NSPLIT*LPC_N_MAX];
+       unsigned char *pbytes;
+       int diff, start_pos, state_first;
+       float en1, en2;
+       int index, ulp, firstpart;
+       int subcount, subframe;
+       float weightState[LPC_FILTERORDER];
+       float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; 
+       float weightdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; 
+       float decresidual[BLOCKL_MAX];
+   
+       /* high pass filtering of input signal if such is not done 
+              prior to calling this function */
+   
+       hpInput(block, iLBCenc_inst->blockl, 
+                   data, (*iLBCenc_inst).hpimem);
+   
+       /* otherwise simply copy */
+   
+       /*memcpy(data,block,iLBCenc_inst->blockl*sizeof(float));*/
+           
+       /* LPC of hp filtered input data */
+   
+       LPCencode(syntdenum, weightdenum, lsf_i, data, iLBCenc_inst);
+   
+   
+       /* inverse filter to get residual */
+   
+       for (n=0; n<iLBCenc_inst->nsub; n++) {
+           anaFilter(&data[n*SUBL], &syntdenum[n*(LPC_FILTERORDER+1)], 
+               SUBL, &residual[n*SUBL], iLBCenc_inst->anaMem);
+       }
+   
+       /* find state location */
+   
+       start = FrameClassify(iLBCenc_inst, residual);
+       
+       /* check if state should be in first or last part of the 
+       two subframes */
+   
+       diff = STATE_LEN - iLBCenc_inst->state_short_len;
+       en1 = 0;
+       index = (start-1)*SUBL;
+       for (i = 0; i < iLBCenc_inst->state_short_len; i++) {
+           en1 += residual[index+i]*residual[index+i];
+       }
+       en2 = 0;
+       index = (start-1)*SUBL+diff;
+       for (i = 0; i < iLBCenc_inst->state_short_len; i++) {
+           en2 += residual[index+i]*residual[index+i];
+       }
+   
+   
+       
+       
+       if (en1 > en2) {
+           state_first = 1;
+           start_pos = (start-1)*SUBL;
+       } else {
+           state_first = 0;
+           start_pos = (start-1)*SUBL + diff;
+       }
+   
+       /* scalar quantization of state */
+   
+       StateSearchW(iLBCenc_inst, &residual[start_pos], 
+           &syntdenum[(start-1)*(LPC_FILTERORDER+1)], 
+           &weightdenum[(start-1)*(LPC_FILTERORDER+1)], &idxForMax, 
+           idxVec, iLBCenc_inst->state_short_len, state_first);
+   
+       StateConstructW(idxForMax, idxVec, 
+           &syntdenum[(start-1)*(LPC_FILTERORDER+1)], 
+           &decresidual[start_pos], iLBCenc_inst->state_short_len);
+   
+       /* predictive quantization in state */
+       
+       if (state_first) { /* put adaptive part in the end */
+           
+           /* setup memory */
+   
+           memset(mem, 0, 
+               (CB_MEML-iLBCenc_inst->state_short_len)*sizeof(float));
+           memcpy(mem+CB_MEML-iLBCenc_inst->state_short_len, 
+               decresidual+start_pos, 
+               iLBCenc_inst->state_short_len*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+   
+           /* encode sub-frames */
+   
+           iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, 
+               &residual[start_pos+iLBCenc_inst->state_short_len], 
+               mem+CB_MEML-stMemLTbl,
+               stMemLTbl, diff, CB_NSTAGES, 
+               &weightdenum[start*(LPC_FILTERORDER+1)], 
+               weightState, 0);
+   
+           /* construct decoded vector */
+   
+           iCBConstruct(
+               &decresidual[start_pos+iLBCenc_inst->state_short_len],
+               extra_cb_index, extra_gain_index, 
+               mem+CB_MEML-stMemLTbl, 
+               stMemLTbl, diff, CB_NSTAGES);
+       
+       } 
+       else { /* put adaptive part in the beginning */
+           
+   
+   
+           /* create reversed vectors for prediction */
+   
+           for (k=0; k<diff; k++) {
+               reverseResidual[k] = residual[(start+1)*SUBL-1
+                   -(k+iLBCenc_inst->state_short_len)];
+           }
+           
+           /* setup memory */
+   
+           meml_gotten = iLBCenc_inst->state_short_len;
+           for (k=0; k<meml_gotten; k++) { 
+               mem[CB_MEML-1-k] = decresidual[start_pos + k];
+           } 
+           memset(mem, 0, (CB_MEML-k)*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+           
+           /* encode sub-frames */
+   
+           iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, 
+               reverseResidual, mem+CB_MEML-stMemLTbl, stMemLTbl, 
+               diff, CB_NSTAGES, 
+               &weightdenum[(start-1)*(LPC_FILTERORDER+1)], 
+               weightState, 0);
+   
+           /* construct decoded vector */
+   
+           iCBConstruct(reverseDecresidual, extra_cb_index, 
+               extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl, 
+               diff, CB_NSTAGES);
+           
+           /* get decoded residual from reversed vector */
+   
+           for (k=0; k<diff; k++) {
+               decresidual[start_pos-1-k] = reverseDecresidual[k];
+           }
+       }
+   
+       /* counter for predicted sub-frames */
+   
+       subcount=0;
+   
+       /* forward prediction of sub-frames */
+   
+       Nfor = iLBCenc_inst->nsub-start-1;
+   
+       
+       if ( Nfor > 0 ) {
+           
+           /* setup memory */
+   
+           memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float));
+           memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, 
+               STATE_LEN*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+   
+   
+   
+           /* loop over sub-frames to encode */
+   
+           for (subframe=0; subframe<Nfor; subframe++) {
+   
+               /* encode sub-frame */
+   
+               iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, 
+                   gain_index+subcount*CB_NSTAGES, 
+                   &residual[(start+1+subframe)*SUBL], 
+                   mem+CB_MEML-memLfTbl[subcount], 
+                   memLfTbl[subcount], SUBL, CB_NSTAGES, 
+                   &weightdenum[(start+1+subframe)*
+                               (LPC_FILTERORDER+1)],
+                   weightState, subcount+1);
+   
+               /* construct decoded vector */
+   
+               iCBConstruct(&decresidual[(start+1+subframe)*SUBL], 
+                   cb_index+subcount*CB_NSTAGES, 
+                   gain_index+subcount*CB_NSTAGES, 
+                   mem+CB_MEML-memLfTbl[subcount], 
+                   memLfTbl[subcount], SUBL, CB_NSTAGES);
+   
+               /* update memory */
+   
+               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+               memcpy(mem+CB_MEML-SUBL, 
+                   &decresidual[(start+1+subframe)*SUBL], 
+                   SUBL*sizeof(float));
+               memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+   
+               subcount++;
+           }
+       }
+       
+   
+       /* backward prediction of sub-frames */
+   
+       Nback = start-1;
+   
+       
+       if ( Nback > 0 ) {
+                  
+           /* create reverse order vectors */
+   
+           for (n=0; n<Nback; n++) {
+               for (k=0; k<SUBL; k++) {
+                   reverseResidual[n*SUBL+k] = 
+                       residual[(start-1)*SUBL-1-n*SUBL-k];
+                   reverseDecresidual[n*SUBL+k] = 
+                       decresidual[(start-1)*SUBL-1-n*SUBL-k];
+               }
+           }
+   
+   
+   
+           /* setup memory */
+   
+           meml_gotten = SUBL*(iLBCenc_inst->nsub+1-start);
+   
+           
+           if ( meml_gotten > CB_MEML ) { 
+               meml_gotten=CB_MEML;
+           }
+           for (k=0; k<meml_gotten; k++) { 
+               mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k];
+           } 
+           memset(mem, 0, (CB_MEML-k)*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+   
+           /* loop over sub-frames to encode */
+   
+           for (subframe=0; subframe<Nback; subframe++) {
+               
+               /* encode sub-frame */
+   
+               iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES, 
+                   gain_index+subcount*CB_NSTAGES, 
+                   &reverseResidual[subframe*SUBL], 
+                   mem+CB_MEML-memLfTbl[subcount], 
+                   memLfTbl[subcount], SUBL, CB_NSTAGES, 
+                   &weightdenum[(start-2-subframe)*
+                               (LPC_FILTERORDER+1)], 
+                   weightState, subcount+1);
+   
+               /* construct decoded vector */
+   
+               iCBConstruct(&reverseDecresidual[subframe*SUBL], 
+                   cb_index+subcount*CB_NSTAGES, 
+                   gain_index+subcount*CB_NSTAGES, 
+                   mem+CB_MEML-memLfTbl[subcount], 
+                   memLfTbl[subcount], SUBL, CB_NSTAGES);
+   
+               /* update memory */
+   
+               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+               memcpy(mem+CB_MEML-SUBL, 
+                   &reverseDecresidual[subframe*SUBL],
+                   SUBL*sizeof(float));
+               memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+   
+               subcount++;
+   
+           }
+   
+           /* get decoded residual from reversed vector */
+   
+           for (i=0; i<SUBL*Nback; i++) {
+               decresidual[SUBL*Nback - i - 1] = 
+   
+   
+                   reverseDecresidual[i];
+           }
+       }
+       /* end encoding part */
+   
+       /* adjust index */
+       index_conv_enc(cb_index);
+   
+       /* pack bytes */
+   
+       pbytes=bytes;
+       pos=0;
+   
+       /* loop over the 3 ULP classes */
+   
+       for (ulp=0; ulp<3; ulp++) {
+       
+           /* LSF */
+           for (k=0; k<LSF_NSPLIT*iLBCenc_inst->lpc_n; k++) {
+               packsplit(&lsf_i[k], &firstpart, &lsf_i[k], 
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], 
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp]+
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+1]+
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+2]);
+               dopack( &pbytes, firstpart, 
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], &pos);
+           }
+   
+           /* Start block info */
+   
+           packsplit(&start, &firstpart, &start, 
+               iLBCenc_inst->ULP_inst->start_bits[ulp], 
+               iLBCenc_inst->ULP_inst->start_bits[ulp]+
+               iLBCenc_inst->ULP_inst->start_bits[ulp+1]+
+               iLBCenc_inst->ULP_inst->start_bits[ulp+2]);
+           dopack( &pbytes, firstpart, 
+               iLBCenc_inst->ULP_inst->start_bits[ulp], &pos);
+   
+           packsplit(&state_first, &firstpart, &state_first, 
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp], 
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp]+
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp+1]+
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp+2]);
+           dopack( &pbytes, firstpart, 
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp], &pos);
+   
+           packsplit(&idxForMax, &firstpart, &idxForMax, 
+               iLBCenc_inst->ULP_inst->scale_bits[ulp], 
+               iLBCenc_inst->ULP_inst->scale_bits[ulp]+
+               iLBCenc_inst->ULP_inst->scale_bits[ulp+1]+
+               iLBCenc_inst->ULP_inst->scale_bits[ulp+2]);
+           dopack( &pbytes, firstpart, 
+               iLBCenc_inst->ULP_inst->scale_bits[ulp], &pos);
+   
+   
+   
+           for (k=0; k<iLBCenc_inst->state_short_len; k++) {
+               packsplit(idxVec+k, &firstpart, idxVec+k, 
+                   iLBCenc_inst->ULP_inst->state_bits[ulp], 
+                   iLBCenc_inst->ULP_inst->state_bits[ulp]+
+                   iLBCenc_inst->ULP_inst->state_bits[ulp+1]+
+                   iLBCenc_inst->ULP_inst->state_bits[ulp+2]);
+               dopack( &pbytes, firstpart, 
+                   iLBCenc_inst->ULP_inst->state_bits[ulp], &pos);
+           }
+   
+           /* 23/22 (20ms/30ms) sample block */
+   
+           for (k=0;k<CB_NSTAGES;k++) {
+               packsplit(extra_cb_index+k, &firstpart, 
+                   extra_cb_index+k, 
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], 
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp]+
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+1]+
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+2]);
+               dopack( &pbytes, firstpart, 
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], 
+                   &pos);
+           }
+   
+           for (k=0;k<CB_NSTAGES;k++) {
+               packsplit(extra_gain_index+k, &firstpart, 
+                   extra_gain_index+k, 
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], 
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp]+
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+1]+
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+2]);
+               dopack( &pbytes, firstpart, 
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], 
+                   &pos);
+           }
+               
+           /* The two/four (20ms/30ms) 40 sample sub-blocks */
+   
+           for (i=0; i<iLBCenc_inst->nasub; i++) {
+               for (k=0; k<CB_NSTAGES; k++) {
+                   packsplit(cb_index+i*CB_NSTAGES+k, &firstpart, 
+                       cb_index+i*CB_NSTAGES+k, 
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], 
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp]+
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+1]+
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+2]);
+                   dopack( &pbytes, firstpart, 
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], 
+                       &pos);
+               }
+           }
+           
+           for (i=0; i<iLBCenc_inst->nasub; i++) {
+               for (k=0; k<CB_NSTAGES; k++) {
+   
+   
+                   packsplit(gain_index+i*CB_NSTAGES+k, &firstpart, 
+                       gain_index+i*CB_NSTAGES+k, 
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], 
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp]+
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+1]+
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+2]);
+                   dopack( &pbytes, firstpart, 
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], 
+                       &pos);
+               }
+           }
+       }
+   
+       /* set the last bit to zero (otherwise the decoder 
+          will treat it as a lost frame) */
+       dopack( &pbytes, 0, 1, &pos);
+   }
+   
+
+

Modified: freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/iLBC_encode.h	Fri Sep 21 14:49:14 2007
@@ -1,32 +1,32 @@
-
-/******************************************************************
-
-iLBC Speech Coder ANSI-C Source Code
-
-iLBC_encode.h    
-
-Copyright (C) The Internet Society (2004). 
-All Rights Reserved.
-
-******************************************************************/
-
-#ifndef __iLBC_ILBCENCODE_H
-#define __iLBC_ILBCENCODE_H
-
-#include "iLBC_define.h"
-
-short initEncode(								/* (o) Number of bytes encoded */
-				 iLBC_Enc_Inst_t *iLBCenc_inst,	/* (i/o) Encoder instance */
-				 int mode						/* (i) frame size mode */
-				 );
-
-void iLBC_encode(
-				 unsigned char *bytes,			/* (o) encoded data bits iLBC */
-				 float *block,					/* (o) speech vector to encode */
-				 iLBC_Enc_Inst_t *iLBCenc_inst	/* (i/o) the general encoder state */
-				 );
-
-#endif
-
-
-
+
+/******************************************************************
+
+iLBC Speech Coder ANSI-C Source Code
+
+iLBC_encode.h    
+
+Copyright (C) The Internet Society (2004). 
+All Rights Reserved.
+
+******************************************************************/
+
+#ifndef __iLBC_ILBCENCODE_H
+#define __iLBC_ILBCENCODE_H
+
+#include "iLBC_define.h"
+
+short initEncode(								/* (o) Number of bytes encoded */
+				 iLBC_Enc_Inst_t *iLBCenc_inst,	/* (i/o) Encoder instance */
+				 int mode						/* (i) frame size mode */
+				 );
+
+void iLBC_encode(
+				 unsigned char *bytes,			/* (o) encoded data bits iLBC */
+				 float *block,					/* (o) speech vector to encode */
+				 iLBC_Enc_Inst_t *iLBCenc_inst	/* (i/o) the general encoder state */
+				 );
+
+#endif
+
+
+

Modified: freeswitch/trunk/libs/codec/ilbc/src/lsf.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/lsf.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/lsf.c	Fri Sep 21 14:49:14 2007
@@ -1,263 +1,263 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       lsf.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <string.h>
-   #include <math.h>
-   
-   #include "iLBC_define.h"
-   
-   /*----------------------------------------------------------------*
-    *  conversion from lpc coefficients to lsf coefficients 
-    *---------------------------------------------------------------*/
-   
-   void a2lsf( 
-       float *freq,/* (o) lsf coefficients */
-       float *a    /* (i) lpc coefficients */
-   ){
-       float steps[LSF_NUMBER_OF_STEPS] = 
-           {(float)0.00635, (float)0.003175, (float)0.0015875, 
-           (float)0.00079375};
-       float step;
-       int step_idx;
-       int lsp_index;  
-       float p[LPC_HALFORDER];
-       float q[LPC_HALFORDER];
-       float p_pre[LPC_HALFORDER];
-   
-   
-       float q_pre[LPC_HALFORDER];
-       float old_p, old_q, *old;
-       float *pq_coef; 
-       float omega, old_omega;
-       int i;
-       float hlp, hlp1, hlp2, hlp3, hlp4, hlp5;
-   
-       for (i=0; i<LPC_HALFORDER; i++) {
-           p[i] = (float)-1.0 * (a[i + 1] + a[LPC_FILTERORDER - i]);
-           q[i] = a[LPC_FILTERORDER - i] - a[i + 1];
-       }
-       
-       p_pre[0] = (float)-1.0 - p[0];
-       p_pre[1] = - p_pre[0] - p[1];
-       p_pre[2] = - p_pre[1] - p[2];
-       p_pre[3] = - p_pre[2] - p[3];
-       p_pre[4] = - p_pre[3] - p[4];
-       p_pre[4] = p_pre[4] / 2;
-       
-       q_pre[0] = (float)1.0 - q[0];
-       q_pre[1] = q_pre[0] - q[1];
-       q_pre[2] = q_pre[1] - q[2];
-       q_pre[3] = q_pre[2] - q[3];
-       q_pre[4] = q_pre[3] - q[4];
-       q_pre[4] = q_pre[4] / 2;
-       
-       omega = 0.0;
-       old_omega = 0.0;
-   
-       old_p = FLOAT_MAX;
-       old_q = FLOAT_MAX;
-       
-       /* Here we loop through lsp_index to find all the 
-          LPC_FILTERORDER roots for omega. */  
-   
-       for (lsp_index = 0; lsp_index<LPC_FILTERORDER; lsp_index++) {
-           
-           /* Depending on lsp_index being even or odd, we 
-           alternatively solve the roots for the two LSP equations. */
-   
-           
-           if ((lsp_index & 0x1) == 0) {
-               pq_coef = p_pre;
-               old = &old_p;
-           } else {
-               pq_coef = q_pre;
-               old = &old_q;
-           }
-           
-           /* Start with low resolution grid */
-   
-           for (step_idx = 0, step = steps[step_idx]; 
-               step_idx < LSF_NUMBER_OF_STEPS;){
-               
-   
-   
-               /*  cos(10piw) + pq(0)cos(8piw) + pq(1)cos(6piw) + 
-               pq(2)cos(4piw) + pq(3)cod(2piw) + pq(4) */
-   
-               hlp = (float)cos(omega * TWO_PI);
-               hlp1 = (float)2.0 * hlp + pq_coef[0];
-               hlp2 = (float)2.0 * hlp * hlp1 - (float)1.0 + 
-                   pq_coef[1];
-               hlp3 = (float)2.0 * hlp * hlp2 - hlp1 + pq_coef[2];
-               hlp4 = (float)2.0 * hlp * hlp3 - hlp2 + pq_coef[3];
-               hlp5 = hlp * hlp4 - hlp3 + pq_coef[4];
-               
-               
-               if (((hlp5 * (*old)) <= 0.0) || (omega >= 0.5)){
-                   
-                   if (step_idx == (LSF_NUMBER_OF_STEPS - 1)){
-                       
-                       if (fabs(hlp5) >= fabs(*old)) {
-                           freq[lsp_index] = omega - step;
-                       } else {
-                           freq[lsp_index] = omega;
-                       }   
-                       
-                       
-                       if ((*old) >= 0.0){
-                           *old = (float)-1.0 * FLOAT_MAX;
-                       } else {
-                           *old = FLOAT_MAX;
-                       }
-   
-                       omega = old_omega;
-                       step_idx = 0;
-                       
-                       step_idx = LSF_NUMBER_OF_STEPS;
-                   } else {
-                       
-                       if (step_idx == 0) {
-                           old_omega = omega;
-                       }
-   
-                       step_idx++;
-                       omega -= steps[step_idx];
-   
-                       /* Go back one grid step */
-   
-                       step = steps[step_idx];
-                   }
-               } else {
-                   
-               /* increment omega until they are of different sign, 
-               and we know there is at least one root between omega 
-               and old_omega */
-                   *old = hlp5;
-                   omega += step;
-               }
-   
-   
-           }
-       }
-   
-       for (i = 0; i<LPC_FILTERORDER; i++) {
-           freq[i] = freq[i] * TWO_PI;
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  conversion from lsf coefficients to lpc coefficients 
-    *---------------------------------------------------------------*/
-   
-   void lsf2a( 
-       float *a_coef,  /* (o) lpc coefficients */
-       float *freq     /* (i) lsf coefficients */
-   ){
-       int i, j;
-       float hlp;
-       float p[LPC_HALFORDER], q[LPC_HALFORDER];
-       float a[LPC_HALFORDER + 1], a1[LPC_HALFORDER],
-           a2[LPC_HALFORDER];
-       float b[LPC_HALFORDER + 1], b1[LPC_HALFORDER], 
-           b2[LPC_HALFORDER];
-   
-       for (i=0; i<LPC_FILTERORDER; i++) {
-           freq[i] = freq[i] * PI2;
-       }
-   
-       /* Check input for ill-conditioned cases.  This part is not 
-       found in the TIA standard.  It involves the following 2 IF 
-       blocks. If "freq" is judged ill-conditioned, then we first 
-       modify freq[0] and freq[LPC_HALFORDER-1] (normally 
-       LPC_HALFORDER = 10 for LPC applications), then we adjust 
-       the other "freq" values slightly */
-   
-       
-       if ((freq[0] <= 0.0) || (freq[LPC_FILTERORDER - 1] >= 0.5)){
-   
-           
-           if (freq[0] <= 0.0) {
-               freq[0] = (float)0.022;
-           }
-   
-           
-           if (freq[LPC_FILTERORDER - 1] >= 0.5) {
-               freq[LPC_FILTERORDER - 1] = (float)0.499;
-           }
-   
-           hlp = (freq[LPC_FILTERORDER - 1] - freq[0]) / 
-               (float) (LPC_FILTERORDER - 1);
-   
-           for (i=1; i<LPC_FILTERORDER; i++) {
-               freq[i] = freq[i - 1] + hlp;
-           }
-   
-   
-       }
-       
-       memset(a1, 0, LPC_HALFORDER*sizeof(float));
-       memset(a2, 0, LPC_HALFORDER*sizeof(float));
-       memset(b1, 0, LPC_HALFORDER*sizeof(float));
-       memset(b2, 0, LPC_HALFORDER*sizeof(float));
-       memset(a, 0, (LPC_HALFORDER+1)*sizeof(float));
-       memset(b, 0, (LPC_HALFORDER+1)*sizeof(float));
-           
-       /* p[i] and q[i] compute cos(2*pi*omega_{2j}) and 
-       cos(2*pi*omega_{2j-1} in eqs. 4.2.2.2-1 and 4.2.2.2-2.  
-       Note that for this code p[i] specifies the coefficients 
-       used in .Q_A(z) while q[i] specifies the coefficients used 
-       in .P_A(z) */
-   
-       for (i=0; i<LPC_HALFORDER; i++) {
-           p[i] = (float)cos(TWO_PI * freq[2 * i]);
-           q[i] = (float)cos(TWO_PI * freq[2 * i + 1]);
-       }
-       
-       a[0] = 0.25;
-       b[0] = 0.25;
-       
-       for (i= 0; i<LPC_HALFORDER; i++) {
-           a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i];
-           b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i];
-           a2[i] = a1[i];
-           a1[i] = a[i];
-           b2[i] = b1[i];
-           b1[i] = b[i];
-       }
-       
-       for (j=0; j<LPC_FILTERORDER; j++) {
-           
-           if (j == 0) {
-               a[0] = 0.25;
-               b[0] = -0.25;
-           } else {
-               a[0] = b[0] = 0.0;
-           }
-           
-           for (i=0; i<LPC_HALFORDER; i++) {
-               a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i];
-               b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i];
-               a2[i] = a1[i];
-               a1[i] = a[i];
-               b2[i] = b1[i];
-               b1[i] = b[i];
-           }
-   
-           a_coef[j + 1] = 2 * (a[LPC_HALFORDER] + b[LPC_HALFORDER]);
-       }
-   
-       a_coef[0] = 1.0;
-   
-   
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       lsf.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <string.h>
+   #include <math.h>
+   
+   #include "iLBC_define.h"
+   
+   /*----------------------------------------------------------------*
+    *  conversion from lpc coefficients to lsf coefficients 
+    *---------------------------------------------------------------*/
+   
+   void a2lsf( 
+       float *freq,/* (o) lsf coefficients */
+       float *a    /* (i) lpc coefficients */
+   ){
+       float steps[LSF_NUMBER_OF_STEPS] = 
+           {(float)0.00635, (float)0.003175, (float)0.0015875, 
+           (float)0.00079375};
+       float step;
+       int step_idx;
+       int lsp_index;  
+       float p[LPC_HALFORDER];
+       float q[LPC_HALFORDER];
+       float p_pre[LPC_HALFORDER];
+   
+   
+       float q_pre[LPC_HALFORDER];
+       float old_p, old_q, *old;
+       float *pq_coef; 
+       float omega, old_omega;
+       int i;
+       float hlp, hlp1, hlp2, hlp3, hlp4, hlp5;
+   
+       for (i=0; i<LPC_HALFORDER; i++) {
+           p[i] = (float)-1.0 * (a[i + 1] + a[LPC_FILTERORDER - i]);
+           q[i] = a[LPC_FILTERORDER - i] - a[i + 1];
+       }
+       
+       p_pre[0] = (float)-1.0 - p[0];
+       p_pre[1] = - p_pre[0] - p[1];
+       p_pre[2] = - p_pre[1] - p[2];
+       p_pre[3] = - p_pre[2] - p[3];
+       p_pre[4] = - p_pre[3] - p[4];
+       p_pre[4] = p_pre[4] / 2;
+       
+       q_pre[0] = (float)1.0 - q[0];
+       q_pre[1] = q_pre[0] - q[1];
+       q_pre[2] = q_pre[1] - q[2];
+       q_pre[3] = q_pre[2] - q[3];
+       q_pre[4] = q_pre[3] - q[4];
+       q_pre[4] = q_pre[4] / 2;
+       
+       omega = 0.0;
+       old_omega = 0.0;
+   
+       old_p = FLOAT_MAX;
+       old_q = FLOAT_MAX;
+       
+       /* Here we loop through lsp_index to find all the 
+          LPC_FILTERORDER roots for omega. */  
+   
+       for (lsp_index = 0; lsp_index<LPC_FILTERORDER; lsp_index++) {
+           
+           /* Depending on lsp_index being even or odd, we 
+           alternatively solve the roots for the two LSP equations. */
+   
+           
+           if ((lsp_index & 0x1) == 0) {
+               pq_coef = p_pre;
+               old = &old_p;
+           } else {
+               pq_coef = q_pre;
+               old = &old_q;
+           }
+           
+           /* Start with low resolution grid */
+   
+           for (step_idx = 0, step = steps[step_idx]; 
+               step_idx < LSF_NUMBER_OF_STEPS;){
+               
+   
+   
+               /*  cos(10piw) + pq(0)cos(8piw) + pq(1)cos(6piw) + 
+               pq(2)cos(4piw) + pq(3)cod(2piw) + pq(4) */
+   
+               hlp = (float)cos(omega * TWO_PI);
+               hlp1 = (float)2.0 * hlp + pq_coef[0];
+               hlp2 = (float)2.0 * hlp * hlp1 - (float)1.0 + 
+                   pq_coef[1];
+               hlp3 = (float)2.0 * hlp * hlp2 - hlp1 + pq_coef[2];
+               hlp4 = (float)2.0 * hlp * hlp3 - hlp2 + pq_coef[3];
+               hlp5 = hlp * hlp4 - hlp3 + pq_coef[4];
+               
+               
+               if (((hlp5 * (*old)) <= 0.0) || (omega >= 0.5)){
+                   
+                   if (step_idx == (LSF_NUMBER_OF_STEPS - 1)){
+                       
+                       if (fabs(hlp5) >= fabs(*old)) {
+                           freq[lsp_index] = omega - step;
+                       } else {
+                           freq[lsp_index] = omega;
+                       }   
+                       
+                       
+                       if ((*old) >= 0.0){
+                           *old = (float)-1.0 * FLOAT_MAX;
+                       } else {
+                           *old = FLOAT_MAX;
+                       }
+   
+                       omega = old_omega;
+                       step_idx = 0;
+                       
+                       step_idx = LSF_NUMBER_OF_STEPS;
+                   } else {
+                       
+                       if (step_idx == 0) {
+                           old_omega = omega;
+                       }
+   
+                       step_idx++;
+                       omega -= steps[step_idx];
+   
+                       /* Go back one grid step */
+   
+                       step = steps[step_idx];
+                   }
+               } else {
+                   
+               /* increment omega until they are of different sign, 
+               and we know there is at least one root between omega 
+               and old_omega */
+                   *old = hlp5;
+                   omega += step;
+               }
+   
+   
+           }
+       }
+   
+       for (i = 0; i<LPC_FILTERORDER; i++) {
+           freq[i] = freq[i] * TWO_PI;
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  conversion from lsf coefficients to lpc coefficients 
+    *---------------------------------------------------------------*/
+   
+   void lsf2a( 
+       float *a_coef,  /* (o) lpc coefficients */
+       float *freq     /* (i) lsf coefficients */
+   ){
+       int i, j;
+       float hlp;
+       float p[LPC_HALFORDER], q[LPC_HALFORDER];
+       float a[LPC_HALFORDER + 1], a1[LPC_HALFORDER],
+           a2[LPC_HALFORDER];
+       float b[LPC_HALFORDER + 1], b1[LPC_HALFORDER], 
+           b2[LPC_HALFORDER];
+   
+       for (i=0; i<LPC_FILTERORDER; i++) {
+           freq[i] = freq[i] * PI2;
+       }
+   
+       /* Check input for ill-conditioned cases.  This part is not 
+       found in the TIA standard.  It involves the following 2 IF 
+       blocks. If "freq" is judged ill-conditioned, then we first 
+       modify freq[0] and freq[LPC_HALFORDER-1] (normally 
+       LPC_HALFORDER = 10 for LPC applications), then we adjust 
+       the other "freq" values slightly */
+   
+       
+       if ((freq[0] <= 0.0) || (freq[LPC_FILTERORDER - 1] >= 0.5)){
+   
+           
+           if (freq[0] <= 0.0) {
+               freq[0] = (float)0.022;
+           }
+   
+           
+           if (freq[LPC_FILTERORDER - 1] >= 0.5) {
+               freq[LPC_FILTERORDER - 1] = (float)0.499;
+           }
+   
+           hlp = (freq[LPC_FILTERORDER - 1] - freq[0]) / 
+               (float) (LPC_FILTERORDER - 1);
+   
+           for (i=1; i<LPC_FILTERORDER; i++) {
+               freq[i] = freq[i - 1] + hlp;
+           }
+   
+   
+       }
+       
+       memset(a1, 0, LPC_HALFORDER*sizeof(float));
+       memset(a2, 0, LPC_HALFORDER*sizeof(float));
+       memset(b1, 0, LPC_HALFORDER*sizeof(float));
+       memset(b2, 0, LPC_HALFORDER*sizeof(float));
+       memset(a, 0, (LPC_HALFORDER+1)*sizeof(float));
+       memset(b, 0, (LPC_HALFORDER+1)*sizeof(float));
+           
+       /* p[i] and q[i] compute cos(2*pi*omega_{2j}) and 
+       cos(2*pi*omega_{2j-1} in eqs. 4.2.2.2-1 and 4.2.2.2-2.  
+       Note that for this code p[i] specifies the coefficients 
+       used in .Q_A(z) while q[i] specifies the coefficients used 
+       in .P_A(z) */
+   
+       for (i=0; i<LPC_HALFORDER; i++) {
+           p[i] = (float)cos(TWO_PI * freq[2 * i]);
+           q[i] = (float)cos(TWO_PI * freq[2 * i + 1]);
+       }
+       
+       a[0] = 0.25;
+       b[0] = 0.25;
+       
+       for (i= 0; i<LPC_HALFORDER; i++) {
+           a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i];
+           b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i];
+           a2[i] = a1[i];
+           a1[i] = a[i];
+           b2[i] = b1[i];
+           b1[i] = b[i];
+       }
+       
+       for (j=0; j<LPC_FILTERORDER; j++) {
+           
+           if (j == 0) {
+               a[0] = 0.25;
+               b[0] = -0.25;
+           } else {
+               a[0] = b[0] = 0.0;
+           }
+           
+           for (i=0; i<LPC_HALFORDER; i++) {
+               a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i];
+               b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i];
+               a2[i] = a1[i];
+               a1[i] = a[i];
+               b2[i] = b1[i];
+               b1[i] = b[i];
+           }
+   
+           a_coef[j + 1] = 2 * (a[LPC_HALFORDER] + b[LPC_HALFORDER]);
+       }
+   
+       a_coef[0] = 1.0;
+   
+   
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/lsf.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/lsf.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/lsf.h	Fri Sep 21 14:49:14 2007
@@ -1,30 +1,30 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       lsf.h             
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_LSF_H
-   #define __iLBC_LSF_H
-   
-   void a2lsf( 
-       float *freq,/* (o) lsf coefficients */
-       float *a    /* (i) lpc coefficients */
-   );
-   
-   void lsf2a( 
-       float *a_coef,  /* (o) lpc coefficients */
-       float *freq     /* (i) lsf coefficients */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       lsf.h             
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_LSF_H
+   #define __iLBC_LSF_H
+   
+   void a2lsf( 
+       float *freq,/* (o) lsf coefficients */
+       float *a    /* (i) lpc coefficients */
+   );
+   
+   void lsf2a( 
+       float *a_coef,  /* (o) lpc coefficients */
+       float *freq     /* (i) lsf coefficients */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/packing.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/packing.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/packing.c	Fri Sep 21 14:49:14 2007
@@ -1,174 +1,174 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       packing.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include <math.h>
-   #include <stdlib.h>
-   
-   #include "iLBC_define.h"
-   #include "constants.h"
-   #include "helpfun.h"
-   #include "string.h"
-   
-   /*----------------------------------------------------------------*
-    *  splitting an integer into first most significant bits and 
-    *  remaining least significant bits
-    *---------------------------------------------------------------*/
-   
-   void packsplit(
-       int *index,                 /* (i) the value to split */
-       int *firstpart,             /* (o) the value specified by most 
-                                          significant bits */
-       int *rest,                  /* (o) the value specified by least
-                                          significant bits */
-       int bitno_firstpart,    /* (i) number of bits in most 
-                                          significant part */
-       int bitno_total             /* (i) number of bits in full range
-                                          of value */
-   ){
-       int bitno_rest = bitno_total-bitno_firstpart;
-   
-   
-   
-       *firstpart = *index>>(bitno_rest);
-       *rest = *index-(*firstpart<<(bitno_rest));
-   }
-   
-   /*----------------------------------------------------------------*
-    *  combining a value corresponding to msb's with a value 
-    *  corresponding to lsb's
-    *---------------------------------------------------------------*/
-   
-   void packcombine( 
-       int *index,                 /* (i/o) the msb value in the 
-                                          combined value out */
-       int rest,                   /* (i) the lsb value */
-       int bitno_rest              /* (i) the number of bits in the 
-                                          lsb part */
-   ){
-       *index = *index<<bitno_rest;
-       *index += rest;
-   }
-   
-   /*----------------------------------------------------------------*
-    *  packing of bits into bitstream, i.e., vector of bytes
-    *---------------------------------------------------------------*/
-   
-   void dopack( 
-       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
-                                          place in bitstream to pack 
-                                          new data, on exit pointer 
-                                          to place in bitstream to 
-                                          pack future data */
-       int index,                  /* (i) the value to pack */
-       int bitno,                  /* (i) the number of bits that the 
-                                          value will fit within */
-       int *pos                /* (i/o) write position in the 
-                                          current byte */
-   ){
-       int posLeft;
-       
-       /* Clear the bits before starting in a new byte */
-       
-       if ((*pos)==0) {
-           **bitstream=0;
-       }
-   
-       while (bitno>0) {
-           
-           /* Jump to the next byte if end of this byte is reached*/
-           
-           if (*pos==8) {
-               *pos=0;
-               (*bitstream)++;
-               **bitstream=0;
-           }
-   
-   
-   
-           posLeft=8-(*pos);
-   
-           /* Insert index into the bitstream */
-           
-           if (bitno <= posLeft) {
-               **bitstream |= (unsigned char)(index<<(posLeft-bitno));
-               *pos+=bitno;
-               bitno=0;
-           } else {
-               **bitstream |= (unsigned char)(index>>(bitno-posLeft));
-               
-               *pos=8;
-               index-=((index>>(bitno-posLeft))<<(bitno-posLeft));
-               
-               bitno-=posLeft;
-           }
-       }
-   }
-   
-   /*----------------------------------------------------------------*
-    *  unpacking of bits from bitstream, i.e., vector of bytes
-    *---------------------------------------------------------------*/
-   
-   void unpack( 
-       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
-                                          place in bitstream to 
-                                          unpack new data from, on 
-                                          exit pointer to place in 
-                                          bitstream to unpack future 
-                                          data from */
-       int *index,                 /* (o) resulting value */
-       int bitno,                  /* (i) number of bits used to 
-                                          represent the value */
-       int *pos                /* (i/o) read position in the 
-                                          current byte */
-   ){
-       int BitsLeft;
-   
-       *index=0;
-   
-       while (bitno>0) {
-           
-           /* move forward in bitstream when the end of the 
-              byte is reached */
-           
-           if (*pos==8) {
-               *pos=0;
-               (*bitstream)++;
-           }
-   
-           BitsLeft=8-(*pos);
-   
-           /* Extract bits to index */
-           
-   
-   
-           if (BitsLeft>=bitno) {
-               *index+=((((**bitstream)<<(*pos)) & 0xFF)>>(8-bitno));
-               
-               *pos+=bitno;
-               bitno=0;
-           } else {
-               
-               if ((8-bitno)>0) {
-                   *index+=((((**bitstream)<<(*pos)) & 0xFF)>>
-                       (8-bitno));
-                   *pos=8;
-               } else {
-                   *index+=(((int)(((**bitstream)<<(*pos)) & 0xFF))<<
-                       (bitno-8));
-                   *pos=8;
-               }
-               bitno-=BitsLeft;
-           }
-       }
-   }
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       packing.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include <math.h>
+   #include <stdlib.h>
+   
+   #include "iLBC_define.h"
+   #include "constants.h"
+   #include "helpfun.h"
+   #include "string.h"
+   
+   /*----------------------------------------------------------------*
+    *  splitting an integer into first most significant bits and 
+    *  remaining least significant bits
+    *---------------------------------------------------------------*/
+   
+   void packsplit(
+       int *index,                 /* (i) the value to split */
+       int *firstpart,             /* (o) the value specified by most 
+                                          significant bits */
+       int *rest,                  /* (o) the value specified by least
+                                          significant bits */
+       int bitno_firstpart,    /* (i) number of bits in most 
+                                          significant part */
+       int bitno_total             /* (i) number of bits in full range
+                                          of value */
+   ){
+       int bitno_rest = bitno_total-bitno_firstpart;
+   
+   
+   
+       *firstpart = *index>>(bitno_rest);
+       *rest = *index-(*firstpart<<(bitno_rest));
+   }
+   
+   /*----------------------------------------------------------------*
+    *  combining a value corresponding to msb's with a value 
+    *  corresponding to lsb's
+    *---------------------------------------------------------------*/
+   
+   void packcombine( 
+       int *index,                 /* (i/o) the msb value in the 
+                                          combined value out */
+       int rest,                   /* (i) the lsb value */
+       int bitno_rest              /* (i) the number of bits in the 
+                                          lsb part */
+   ){
+       *index = *index<<bitno_rest;
+       *index += rest;
+   }
+   
+   /*----------------------------------------------------------------*
+    *  packing of bits into bitstream, i.e., vector of bytes
+    *---------------------------------------------------------------*/
+   
+   void dopack( 
+       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
+                                          place in bitstream to pack 
+                                          new data, on exit pointer 
+                                          to place in bitstream to 
+                                          pack future data */
+       int index,                  /* (i) the value to pack */
+       int bitno,                  /* (i) the number of bits that the 
+                                          value will fit within */
+       int *pos                /* (i/o) write position in the 
+                                          current byte */
+   ){
+       int posLeft;
+       
+       /* Clear the bits before starting in a new byte */
+       
+       if ((*pos)==0) {
+           **bitstream=0;
+       }
+   
+       while (bitno>0) {
+           
+           /* Jump to the next byte if end of this byte is reached*/
+           
+           if (*pos==8) {
+               *pos=0;
+               (*bitstream)++;
+               **bitstream=0;
+           }
+   
+   
+   
+           posLeft=8-(*pos);
+   
+           /* Insert index into the bitstream */
+           
+           if (bitno <= posLeft) {
+               **bitstream |= (unsigned char)(index<<(posLeft-bitno));
+               *pos+=bitno;
+               bitno=0;
+           } else {
+               **bitstream |= (unsigned char)(index>>(bitno-posLeft));
+               
+               *pos=8;
+               index-=((index>>(bitno-posLeft))<<(bitno-posLeft));
+               
+               bitno-=posLeft;
+           }
+       }
+   }
+   
+   /*----------------------------------------------------------------*
+    *  unpacking of bits from bitstream, i.e., vector of bytes
+    *---------------------------------------------------------------*/
+   
+   void unpack( 
+       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
+                                          place in bitstream to 
+                                          unpack new data from, on 
+                                          exit pointer to place in 
+                                          bitstream to unpack future 
+                                          data from */
+       int *index,                 /* (o) resulting value */
+       int bitno,                  /* (i) number of bits used to 
+                                          represent the value */
+       int *pos                /* (i/o) read position in the 
+                                          current byte */
+   ){
+       int BitsLeft;
+   
+       *index=0;
+   
+       while (bitno>0) {
+           
+           /* move forward in bitstream when the end of the 
+              byte is reached */
+           
+           if (*pos==8) {
+               *pos=0;
+               (*bitstream)++;
+           }
+   
+           BitsLeft=8-(*pos);
+   
+           /* Extract bits to index */
+           
+   
+   
+           if (BitsLeft>=bitno) {
+               *index+=((((**bitstream)<<(*pos)) & 0xFF)>>(8-bitno));
+               
+               *pos+=bitno;
+               bitno=0;
+           } else {
+               
+               if ((8-bitno)>0) {
+                   *index+=((((**bitstream)<<(*pos)) & 0xFF)>>
+                       (8-bitno));
+                   *pos=8;
+               } else {
+                   *index+=(((int)(((**bitstream)<<(*pos)) & 0xFF))<<
+                       (bitno-8));
+                   *pos=8;
+               }
+               bitno-=BitsLeft;
+           }
+       }
+   }
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/packing.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/packing.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/packing.h	Fri Sep 21 14:49:14 2007
@@ -1,67 +1,67 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       packing.h              
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __PACKING_H
-   #define __PACKING_H
-   
-   void packsplit(
-       int *index,                 /* (i) the value to split */
-       int *firstpart,             /* (o) the value specified by most 
-                                          significant bits */
-       int *rest,                  /* (o) the value specified by least 
-                                          significant bits */
-       int bitno_firstpart,    /* (i) number of bits in most 
-                                          significant part */
-       int bitno_total             /* (i) number of bits in full range 
-                                          of value */
-   );
-   
-   void packcombine( 
-       int *index,                 /* (i/o) the msb value in the 
-                                          combined value out */
-       int rest,                   /* (i) the lsb value */
-       int bitno_rest              /* (i) the number of bits in the 
-                                          lsb part */
-   );
-   
-   void dopack( 
-       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
-                                          place in bitstream to pack 
-                                          new data, on exit pointer 
-                                          to place in bitstream to 
-                                          pack future data */
-       int index,                  /* (i) the value to pack */
-       int bitno,                  /* (i) the number of bits that the 
-                                          value will fit within */
-       int *pos                /* (i/o) write position in the 
-                                          current byte */
-   );
-   
-   void unpack( 
-       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
-   
-   
-                                          place in bitstream to 
-                                          unpack new data from, on 
-                                          exit pointer to place in 
-                                          bitstream to unpack future 
-                                          data from */
-       int *index,                 /* (o) resulting value */
-       int bitno,                  /* (i) number of bits used to 
-                                          represent the value */
-       int *pos                /* (i/o) read position in the 
-                                          current byte */
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       packing.h              
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __PACKING_H
+   #define __PACKING_H
+   
+   void packsplit(
+       int *index,                 /* (i) the value to split */
+       int *firstpart,             /* (o) the value specified by most 
+                                          significant bits */
+       int *rest,                  /* (o) the value specified by least 
+                                          significant bits */
+       int bitno_firstpart,    /* (i) number of bits in most 
+                                          significant part */
+       int bitno_total             /* (i) number of bits in full range 
+                                          of value */
+   );
+   
+   void packcombine( 
+       int *index,                 /* (i/o) the msb value in the 
+                                          combined value out */
+       int rest,                   /* (i) the lsb value */
+       int bitno_rest              /* (i) the number of bits in the 
+                                          lsb part */
+   );
+   
+   void dopack( 
+       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
+                                          place in bitstream to pack 
+                                          new data, on exit pointer 
+                                          to place in bitstream to 
+                                          pack future data */
+       int index,                  /* (i) the value to pack */
+       int bitno,                  /* (i) the number of bits that the 
+                                          value will fit within */
+       int *pos                /* (i/o) write position in the 
+                                          current byte */
+   );
+   
+   void unpack( 
+       unsigned char **bitstream,  /* (i/o) on entrance pointer to 
+   
+   
+                                          place in bitstream to 
+                                          unpack new data from, on 
+                                          exit pointer to place in 
+                                          bitstream to unpack future 
+                                          data from */
+       int *index,                 /* (o) resulting value */
+       int bitno,                  /* (i) number of bits used to 
+                                          represent the value */
+       int *pos                /* (i/o) read position in the 
+                                          current byte */
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/ilbc/src/syntFilter.c
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/syntFilter.c	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/syntFilter.c	Fri Sep 21 14:49:14 2007
@@ -1,107 +1,107 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       syntFilter.c 
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #include "iLBC_define.h"
-   
-   /*----------------------------------------------------------------*
-    *  LP synthesis filter.
-    *---------------------------------------------------------------*/
-       
-   void syntFilter(
-       float *Out,     /* (i/o) Signal to be filtered */
-       float *a,       /* (i) LP parameters */
-       int len,    /* (i) Length of signal */
-       float *mem      /* (i/o) Filter state */
-   ){
-       int i, j;
-       float *po, *pi, *pa, *pm;
-   
-       po=Out;
-   
-       /* Filter first part using memory from past */
-   
-       for (i=0; i<LPC_FILTERORDER; i++) {
-           pi=&Out[i-1];
-           pa=&a[1];
-           pm=&mem[LPC_FILTERORDER-1];
-           for (j=1; j<=i; j++) {
-               *po-=(*pa++)*(*pi--);
-           }
-           for (j=i+1; j<LPC_FILTERORDER+1; j++) {
-               *po-=(*pa++)*(*pm--);
-           }
-           po++;
-       }
-   
-       /* Filter last part where the state is entierly in 
-          the output vector */
-       
-       for (i=LPC_FILTERORDER; i<len; i++) {
-   
-   
-           pi=&Out[i-1];
-           pa=&a[1];
-           for (j=1; j<LPC_FILTERORDER+1; j++) {
-               *po-=(*pa++)*(*pi--);
-           }
-           po++;
-       }
-   
-       /* Update state vector */
-   
-       memcpy(mem, &Out[len-LPC_FILTERORDER], 
-           LPC_FILTERORDER*sizeof(float));
-   }
-   
-   
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-   
-
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       syntFilter.c 
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #include "iLBC_define.h"
+   
+   /*----------------------------------------------------------------*
+    *  LP synthesis filter.
+    *---------------------------------------------------------------*/
+       
+   void syntFilter(
+       float *Out,     /* (i/o) Signal to be filtered */
+       float *a,       /* (i) LP parameters */
+       int len,    /* (i) Length of signal */
+       float *mem      /* (i/o) Filter state */
+   ){
+       int i, j;
+       float *po, *pi, *pa, *pm;
+   
+       po=Out;
+   
+       /* Filter first part using memory from past */
+   
+       for (i=0; i<LPC_FILTERORDER; i++) {
+           pi=&Out[i-1];
+           pa=&a[1];
+           pm=&mem[LPC_FILTERORDER-1];
+           for (j=1; j<=i; j++) {
+               *po-=(*pa++)*(*pi--);
+           }
+           for (j=i+1; j<LPC_FILTERORDER+1; j++) {
+               *po-=(*pa++)*(*pm--);
+           }
+           po++;
+       }
+   
+       /* Filter last part where the state is entierly in 
+          the output vector */
+       
+       for (i=LPC_FILTERORDER; i<len; i++) {
+   
+   
+           pi=&Out[i-1];
+           pa=&a[1];
+           for (j=1; j<LPC_FILTERORDER+1; j++) {
+               *po-=(*pa++)*(*pi--);
+           }
+           po++;
+       }
+   
+       /* Update state vector */
+   
+       memcpy(mem, &Out[len-LPC_FILTERORDER], 
+           LPC_FILTERORDER*sizeof(float));
+   }
+   
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+

Modified: freeswitch/trunk/libs/codec/ilbc/src/syntFilter.h
==============================================================================
--- freeswitch/trunk/libs/codec/ilbc/src/syntFilter.h	(original)
+++ freeswitch/trunk/libs/codec/ilbc/src/syntFilter.h	Fri Sep 21 14:49:14 2007
@@ -1,27 +1,27 @@
-   
-   /******************************************************************
-   
-       iLBC Speech Coder ANSI-C Source Code
-   
-       syntFilter.h               
-   
-       Copyright (C) The Internet Society (2004). 
-       All Rights Reserved.
-   
-   ******************************************************************/
-   
-   #ifndef __iLBC_SYNTFILTER_H
-   #define __iLBC_SYNTFILTER_H
-   
-   void syntFilter(
-       float *Out,     /* (i/o) Signal to be filtered */
-       float *a,       /* (i) LP parameters */
-       int len,    /* (i) Length of signal */
-       float *mem      /* (i/o) Filter state */
-   
-   
-   );
-   
-   #endif
-   
-   
+   
+   /******************************************************************
+   
+       iLBC Speech Coder ANSI-C Source Code
+   
+       syntFilter.h               
+   
+       Copyright (C) The Internet Society (2004). 
+       All Rights Reserved.
+   
+   ******************************************************************/
+   
+   #ifndef __iLBC_SYNTFILTER_H
+   #define __iLBC_SYNTFILTER_H
+   
+   void syntFilter(
+       float *Out,     /* (i/o) Signal to be filtered */
+       float *a,       /* (i) LP parameters */
+       int len,    /* (i) Length of signal */
+       float *mem      /* (i/o) Filter state */
+   
+   
+   );
+   
+   #endif
+   
+   

Modified: freeswitch/trunk/libs/codec/lpc10/src/analys.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/analys.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/analys.c	Fri Sep 21 14:49:14 2007
@@ -1,631 +1,631 @@
-/*
-
-$Log: analys.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:16:01  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:29:08  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int analys_(real *speech, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_encoder_state *st);
-/* comlen contrl_ 12 */
-/*:ref: preemp_ 14 5 6 6 4 6 6 */
-/*:ref: onset_ 14 7 6 4 4 4 4 4 4 */
-/*:ref: placev_ 14 11 4 4 4 4 4 4 4 4 4 4 4 */
-/*:ref: lpfilt_ 14 4 6 6 4 4 */
-/*:ref: ivfilt_ 14 5 6 6 4 4 6 */
-/*:ref: tbdm_ 14 8 6 4 4 4 6 4 4 4 */
-/*:ref: voicin_ 14 12 4 6 6 4 4 6 6 4 6 4 4 4 */
-/*:ref: dyptrk_ 14 6 6 4 4 4 4 4 */
-/*:ref: placea_ 14 9 4 4 4 4 4 4 4 4 4 */
-/*:ref: dcbias_ 14 3 4 6 6 */
-/*:ref: energy_ 14 3 4 6 6 */
-/*:ref: mload_ 14 6 4 4 4 6 6 6 */
-/*:ref: invert_ 14 4 4 6 6 6 */
-/*:ref: rcchk_ 14 3 4 6 6 */
-/*:ref: initonset_ 14 0 */
-/*:ref: initvoicin_ 14 0 */
-/*:ref: initdyptrk_ 14 0 */
-/* Rerunning f2c -P may change prototypes or declarations. */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* Table of constant values */
-
-static integer c__10 = 10;
-static integer c__181 = 181;
-static integer c__720 = 720;
-static integer c__3 = 3;
-static integer c__90 = 90;
-static integer c__156 = 156;
-static integer c__307 = 307;
-static integer c__462 = 462;
-static integer c__312 = 312;
-static integer c__60 = 60;
-static integer c__1 = 1;
-
-/* ****************************************************************** */
-
-/* 	ANALYS Version 55 */
-
-/* $Log: analys.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:16:01  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:29:08  jaf
- * Initial revision
- *
- */
-/* Revision 1.9  1996/05/23  19:41:07  jaf */
-/* Commented out some unnecessary lines that were reading uninitialized */
-/* values. */
-
-/* Revision 1.8  1996/03/27  23:57:55  jaf */
-/* Added some comments about which indices of the local buffers INBUF, */
-/* LPBUF, etc., get read or modified by some of the subroutine calls.  I */
-/* just did this while trying to figure out the discrepancy between the */
-/* embedded code compiled with all local variables implicitly saved, and */
-/* without. */
-
-/* I added some debugging write statements in hopes of finding a problem. */
-/* None of them ever printed anything while running with the long input */
-/* speech file dam9.spd provided in the distribution. */
-
-/* Revision 1.7  1996/03/27  18:06:20  jaf */
-/* Commented out access to MAXOSP, which is just a debugging variable */
-/* that was defined in the COMMON block CONTRL in contrl.fh. */
-
-/* Revision 1.6  1996/03/26  19:31:33  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.5  1996/03/21  15:19:35  jaf */
-/* Added comments for ENTRY PITDEC. */
-
-/* Revision 1.4  1996/03/19  20:54:27  jaf */
-/* Added a line to INITANALYS.  See comments there. */
-
-/* Revision 1.3  1996/03/19  20:52:49  jaf */
-/* Rearranged the order of the local variables quite a bit, to separate */
-/* them into groups of "constants", "locals that don't need to be saved */
-/* from one call to the next", and "local that do need to be saved from */
-/* one call to the next". */
-
-/* Several locals in the last set should have been given initial values, */
-/* but weren't.  I gave them all initial values of 0. */
-
-/* Added a separate ENTRY INITANALYS that initializes all local state */
-/* that should be, and also calls the corresponding entries of the */
-/* subroutines called by ANALYS that also have local state. */
-
-/* There used to be DATA statements in ANALYS.  I got rid of most of */
-/* them, and added a local logical variable FIRST that calls the entry */
-/* INITANALYS on the first call to ANALYS.  This is just so that one need */
-/* not remember to call INITANALYS first in order for the state to be */
-/* initialized. */
-
-/* Revision 1.2  1996/03/11  23:29:32  jaf */
-/* Added several comments with my own personal questions about the */
-/* Fortran 77 meaning of the parameters passed to the subroutine PREEMP. */
-
-/* Revision 1.1  1996/02/07  14:42:29  jaf */
-/* Initial revision */
-
-
-/* ****************************************************************** */
-
-/* SUBROUTINE ANALYS */
-
-/* Input: */
-/*  SPEECH */
-/*       Indices 1 through LFRAME read. */
-/* Output: */
-/*  VOICE */
-/*       Indices 1 through 2 written. */
-/*  PITCH */
-/*       Written in subroutine DYPTRK, and then perhaps read and written */
-/*       some more. */
-/*  RMS */
-/*       Written. */
-/*  RC */
-/*       Indices 1 through ORDER written (ORDER defined in contrl.fh). */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITANALYS. */
-
-
-/* ENTRY PITDEC */
-
-/* Input: */
-/*  PITCH   - Encoded pitch index */
-/* Output: */
-/*  PTAU    - Decoded pitch period */
-
-/* This entry has no local state.  It accesses a "constant" array */
-/* declared in ANALYS. */
-
-/* Subroutine */ int analys_(real *speech, integer *voice, integer 
-	*pitch, real *rms, real *rc, struct lpc10_encoder_state *st)
-{
-    /* Initialized data */
-
-    static integer 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 integer buflim[4] = { 181,720,25,720 };
-    static real precoef = .9375f;
-
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    real amdf[60];
-    integer half;
-    real abuf[156];
-    real *bias;
-    extern /* Subroutine */ int tbdm_(real *, integer *, integer *, integer *,
-	     real *, integer *, integer *, integer *);
-    integer *awin;
-    integer midx, ewin[6]	/* was [2][3] */;
-    real ivrc[2], temp;
-    real *zpre;
-    integer *vwin;
-    integer i__, j, lanal;
-    extern /* Subroutine */ int rcchk_(integer *, real *, real *), mload_(
-	    integer *, integer *, integer *, real *, real *, real *);
-    real *inbuf, *pebuf;
-    real *lpbuf, *ivbuf;
-    real *rcbuf;
-    integer *osbuf;
-    extern /* Subroutine */ int onset_(real *, integer *, integer *, integer *
-	    , integer *, integer *, integer *, struct lpc10_encoder_state *);
-    integer *osptr;
-    extern /* Subroutine */ placea_(integer *, integer *
-	    , integer *, integer *, integer *, integer *, integer *, integer *
-	    , integer *), dcbias_(integer *, real *, real *), placev_(integer 
-	    *, integer *, integer *, integer *, integer *, integer *, integer 
-	    *, integer *, integer *, integer *, integer *);
-    integer ipitch;
-    integer *obound;
-    extern /* Subroutine */ int preemp_(real *, real *, integer *, real *, 
-	    real *), voicin_(integer *, real *, real *, integer *, integer *, 
-	    real *, real *, integer *, real *, integer *, integer *, integer *,
-	    struct lpc10_encoder_state *);
-    integer *voibuf;
-    integer mintau;
-    real *rmsbuf;
-    extern /* Subroutine */ int lpfilt_(real *, real *, integer *, integer *),
-	     ivfilt_(real *, real *, integer *, integer *, real *), energy_(
-	    integer *, real *, real *), invert_(integer *, real *, real *, 
-	    real *);
-    integer minptr, maxptr;
-    extern /* Subroutine */ int dyptrk_(real *, integer *, integer *, integer 
-	    *, integer *, integer *, struct lpc10_encoder_state *);
-    real phi[100]	/* was [10][10] */, psi[10];
-
-/* $Log: analys.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:16:01  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:29:08  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Arguments to ANALYS */
-/* $Log: analys.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:16:01  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:29:08  jaf
- * Initial revision
- * */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/*       Arguments to entry PITDEC (below) */
-/* 	Parameters/constants */
-/*  Constants */
-/*    NF =     Number of frames */
-/*    AF =     Frame in which analysis is done */
-/*    OSLEN =  Length of the onset buffer */
-/*    LTAU =   Number of pitch lags */
-/*    SBUFL, SBUFH =   Start and end index of speech buffers */
-/*    LBUFL, LBUFH =   Start and end index of LPF speech buffer */
-/*   MINWIN, MAXWIN = Min and Max length of voicing (and analysis) windows
-*/
-/*    PWLEN, PWINH, PWINL = Length, upper and lower limits of pitch window
- */
-/*    DVWINL, DVWINH = Default lower and upper limits of voicing window */
-/*       The tables TAU and BUFLIM, and the variable PRECOEF, are not */
-/*       Fortran PARAMETER's, but they are initialized with DATA */
-/*       statements, and never modified.  Thus, they need not have SAVE */
-/*       statements for them to keep their values from one invocation to 
-*/
-/*       the next. */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*  Data Buffers */
-/*    INBUF	Raw speech (with DC bias removed each frame) */
-/*    PEBUF	Preemphasized speech */
-/*    LPBUF	Low pass speech buffer */
-/*    IVBUF	Inverse filtered speech */
-/*    OSBUF	Indexes of onsets in speech buffers */
-/*    VWIN	Voicing window indices */
-/*    AWIN	Analysis window indices */
-/*    EWIN	Energy window indices */
-/*    VOIBUF	Voicing decisions on windows in VWIN */
-/*    RMSBUF	RMS energy */
-/*    RCBUF	Reflection Coefficients */
-
-/*  Pitch is handled separately from the above parameters. */
-/*  The following variables deal with pitch: */
-/*    MIDX	Encoded initial pitch estimate for analysis frame */
-/*    IPITCH	Initial pitch computed for frame AF (decoded from MIDX) */
-/*    PITCH 	The encoded pitch value (index into TAU) for the present */
-/* 		frame (delayed and smoothed by Dyptrack) */
-    /* Parameter adjustments */
-    if (speech) {
-	--speech;
-	}
-    if (voice) {
-	--voice;
-	}
-    if (rc) {
-	--rc;
-	}
-
-    /* Function Body */
-
-/*   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. */
-/*   Update all buffers */
-
-    inbuf = &(st->inbuf[0]);
-    pebuf = &(st->pebuf[0]);
-    lpbuf = &(st->lpbuf[0]);
-    ivbuf = &(st->ivbuf[0]);
-    bias = &(st->bias);
-    osbuf = &(st->osbuf[0]);
-    osptr = &(st->osptr);
-    obound = &(st->obound[0]);
-    vwin = &(st->vwin[0]);
-    awin = &(st->awin[0]);
-    voibuf = &(st->voibuf[0]);
-    rmsbuf = &(st->rmsbuf[0]);
-    rcbuf = &(st->rcbuf[0]);
-    zpre = &(st->zpre);
-
-    i__1 = 720 - contrl_1.lframe;
-    for (i__ = 181; i__ <= i__1; ++i__) {
-	inbuf[i__ - 181] = inbuf[contrl_1.lframe + i__ - 181];
-	pebuf[i__ - 181] = pebuf[contrl_1.lframe + i__ - 181];
-    }
-    i__1 = 540 - contrl_1.lframe;
-    for (i__ = 229; i__ <= i__1; ++i__) {
-	ivbuf[i__ - 229] = ivbuf[contrl_1.lframe + i__ - 229];
-    }
-    i__1 = 720 - contrl_1.lframe;
-    for (i__ = 25; i__ <= i__1; ++i__) {
-	lpbuf[i__ - 25] = lpbuf[contrl_1.lframe + i__ - 25];
-    }
-    j = 1;
-    i__1 = (*osptr) - 1;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	if (osbuf[i__ - 1] > contrl_1.lframe) {
-	    osbuf[j - 1] = osbuf[i__ - 1] - contrl_1.lframe;
-	    ++j;
-	}
-    }
-    *osptr = j;
-    voibuf[0] = voibuf[2];
-    voibuf[1] = voibuf[3];
-    for (i__ = 1; i__ <= 2; ++i__) {
-	vwin[(i__ << 1) - 2] = vwin[(i__ + (1 << 1)) - 2] - contrl_1.lframe;
-	vwin[(i__ << 1) - 1] = vwin[(i__ + (1 << 1)) - 1] - contrl_1.lframe;
-	awin[(i__ << 1) - 2] = awin[(i__ + (1 << 1)) - 2] - contrl_1.lframe;
-	awin[(i__ << 1) - 1] = awin[(i__ + (1 << 1)) - 1] - contrl_1.lframe;
-/*       EWIN(*,J) is unused for J .NE. AF, so the following shift is 
-*/
-/*       unnecessary.  It also causes error messages when the C versio
-n */
-/*       of the code created from this by f2c is run with Purify.  It 
-*/
-/*       correctly complains that uninitialized memory is being read. 
-*/
-/* 	   EWIN(1,I) = EWIN(1,I+1) - LFRAME */
-/* 	   EWIN(2,I) = EWIN(2,I+1) - LFRAME */
-	obound[i__ - 1] = obound[i__];
-	voibuf[i__ * 2] = voibuf[(i__ + 1) * 2];
-	voibuf[(i__ << 1) + 1] = voibuf[(i__ + (1 << 1)) + 1];
-	rmsbuf[i__ - 1] = rmsbuf[i__];
-	i__1 = contrl_1.order;
-	for (j = 1; j <= i__1; ++j) {
-	    rcbuf[j + i__ * 10 - 11] = rcbuf[j + (i__ + 1) * 10 - 11];
-	}
-    }
-/*   Copy input speech, scale to sign+12 bit integers */
-/*   Remove long term DC bias. */
-/*       If the average value in the frame was over 1/4096 (after current 
-*/
-/*       BIAS correction), then subtract that much more from samples in */
-/*       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.f;
-    i__1 = contrl_1.lframe;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	inbuf[720 - contrl_1.lframe + i__ - 181] = speech[i__] * 4096.f - 
-		(*bias);
-	temp += inbuf[720 - contrl_1.lframe + i__ - 181];
-    }
-    if (temp > (real) contrl_1.lframe) {
-	*bias += 1;
-    }
-    if (temp < (real) (-contrl_1.lframe)) {
-	*bias += -1;
-    }
-/*   Place Voicing Window */
-    i__ = 721 - contrl_1.lframe;
-    preemp_(&inbuf[i__ - 181], &pebuf[i__ - 181], &contrl_1.lframe, &precoef, 
-	    zpre);
-    onset_(pebuf, osbuf, osptr, &c__10, &c__181, &c__720, &contrl_1.lframe, st);
-
-/*       MAXOSP is just a debugging variable. */
-
-/* 	MAXOSP = MAX( MAXOSP, OSPTR ) */
-
-    placev_(osbuf, osptr, &c__10, &obound[2], vwin, &c__3, &contrl_1.lframe, 
-	    &c__90, &c__156, &c__307, &c__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 programming (DYPTRK).  However, 
-*/
-/*   since some of DYPTRK's parameters are a function of the voicing */
-/*  decisions, a voicing decision must precede the final pitch estimation.
-*/
-/*   See subroutines LPFILT, IVFILT, and TBDM. */
-/*       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_(&inbuf[228], &lpbuf[384], &c__312, &contrl_1.lframe);
-/*       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_(&lpbuf[204], ivbuf, &c__312, &contrl_1.lframe, ivrc);
-/*       TBDM 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. */
-    tbdm_(ivbuf, &c__156, tau, &c__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 = 1; half <= 2; ++half) {
-	voicin_(&vwin[4], inbuf, lpbuf, buflim, &half, &amdf[minptr - 1], &
-		amdf[maxptr - 1], &mintau, ivrc, obound, voibuf, &c__3, st);
-    }
-/*   Find the minimum cost pitch decision over several frames */
-/*   given the current voicing decision and the AMDF array */
-    dyptrk_(amdf, &c__60, &minptr, &voibuf[7], pitch, &midx, st);
-    ipitch = tau[midx - 1];
-/*   Place spectrum analysis and energy windows */
-    placea_(&ipitch, voibuf, &obound[2], &c__3, vwin, awin, ewin, &
-	    contrl_1.lframe, &c__156);
-/*  Remove short term DC bias over the analysis window, Put result in ABUF
-*/
-    lanal = awin[5] + 1 - awin[4];
-    dcbias_(&lanal, &pebuf[awin[4] - 181], abuf);
-/*       ABUF(1:LANAL) is now defined.  It is equal to */
-/*       PEBUF(AWIN(1,AF):AWIN(2,AF)) corrected for short term DC bias. */
-/*   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. */
-    i__1 = ewin[5] - ewin[4] + 1;
-    energy_(&i__1, &abuf[ewin[4] - awin[4]], &rmsbuf[2]);
-/*   Matrix load and invert, check RC's for stability */
-    mload_(&contrl_1.order, &c__1, &lanal, abuf, phi, psi);
-    invert_(&contrl_1.order, phi, psi, &rcbuf[20]);
-    rcchk_(&contrl_1.order, &rcbuf[10], &rcbuf[20]);
-/*   Set return parameters */
-    voice[1] = voibuf[2];
-    voice[2] = voibuf[3];
-    *rms = rmsbuf[0];
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	rc[i__] = rcbuf[i__ - 1];
-    }
-    return 0;
-} /* analys_ */
+/*
+
+$Log: analys.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:16:01  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:29:08  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int analys_(real *speech, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_encoder_state *st);
+/* comlen contrl_ 12 */
+/*:ref: preemp_ 14 5 6 6 4 6 6 */
+/*:ref: onset_ 14 7 6 4 4 4 4 4 4 */
+/*:ref: placev_ 14 11 4 4 4 4 4 4 4 4 4 4 4 */
+/*:ref: lpfilt_ 14 4 6 6 4 4 */
+/*:ref: ivfilt_ 14 5 6 6 4 4 6 */
+/*:ref: tbdm_ 14 8 6 4 4 4 6 4 4 4 */
+/*:ref: voicin_ 14 12 4 6 6 4 4 6 6 4 6 4 4 4 */
+/*:ref: dyptrk_ 14 6 6 4 4 4 4 4 */
+/*:ref: placea_ 14 9 4 4 4 4 4 4 4 4 4 */
+/*:ref: dcbias_ 14 3 4 6 6 */
+/*:ref: energy_ 14 3 4 6 6 */
+/*:ref: mload_ 14 6 4 4 4 6 6 6 */
+/*:ref: invert_ 14 4 4 6 6 6 */
+/*:ref: rcchk_ 14 3 4 6 6 */
+/*:ref: initonset_ 14 0 */
+/*:ref: initvoicin_ 14 0 */
+/*:ref: initdyptrk_ 14 0 */
+/* Rerunning f2c -P may change prototypes or declarations. */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* Table of constant values */
+
+static integer c__10 = 10;
+static integer c__181 = 181;
+static integer c__720 = 720;
+static integer c__3 = 3;
+static integer c__90 = 90;
+static integer c__156 = 156;
+static integer c__307 = 307;
+static integer c__462 = 462;
+static integer c__312 = 312;
+static integer c__60 = 60;
+static integer c__1 = 1;
+
+/* ****************************************************************** */
+
+/* 	ANALYS Version 55 */
+
+/* $Log: analys.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:16:01  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:29:08  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.9  1996/05/23  19:41:07  jaf */
+/* Commented out some unnecessary lines that were reading uninitialized */
+/* values. */
+
+/* Revision 1.8  1996/03/27  23:57:55  jaf */
+/* Added some comments about which indices of the local buffers INBUF, */
+/* LPBUF, etc., get read or modified by some of the subroutine calls.  I */
+/* just did this while trying to figure out the discrepancy between the */
+/* embedded code compiled with all local variables implicitly saved, and */
+/* without. */
+
+/* I added some debugging write statements in hopes of finding a problem. */
+/* None of them ever printed anything while running with the long input */
+/* speech file dam9.spd provided in the distribution. */
+
+/* Revision 1.7  1996/03/27  18:06:20  jaf */
+/* Commented out access to MAXOSP, which is just a debugging variable */
+/* that was defined in the COMMON block CONTRL in contrl.fh. */
+
+/* Revision 1.6  1996/03/26  19:31:33  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.5  1996/03/21  15:19:35  jaf */
+/* Added comments for ENTRY PITDEC. */
+
+/* Revision 1.4  1996/03/19  20:54:27  jaf */
+/* Added a line to INITANALYS.  See comments there. */
+
+/* Revision 1.3  1996/03/19  20:52:49  jaf */
+/* Rearranged the order of the local variables quite a bit, to separate */
+/* them into groups of "constants", "locals that don't need to be saved */
+/* from one call to the next", and "local that do need to be saved from */
+/* one call to the next". */
+
+/* Several locals in the last set should have been given initial values, */
+/* but weren't.  I gave them all initial values of 0. */
+
+/* Added a separate ENTRY INITANALYS that initializes all local state */
+/* that should be, and also calls the corresponding entries of the */
+/* subroutines called by ANALYS that also have local state. */
+
+/* There used to be DATA statements in ANALYS.  I got rid of most of */
+/* them, and added a local logical variable FIRST that calls the entry */
+/* INITANALYS on the first call to ANALYS.  This is just so that one need */
+/* not remember to call INITANALYS first in order for the state to be */
+/* initialized. */
+
+/* Revision 1.2  1996/03/11  23:29:32  jaf */
+/* Added several comments with my own personal questions about the */
+/* Fortran 77 meaning of the parameters passed to the subroutine PREEMP. */
+
+/* Revision 1.1  1996/02/07  14:42:29  jaf */
+/* Initial revision */
+
+
+/* ****************************************************************** */
+
+/* SUBROUTINE ANALYS */
+
+/* Input: */
+/*  SPEECH */
+/*       Indices 1 through LFRAME read. */
+/* Output: */
+/*  VOICE */
+/*       Indices 1 through 2 written. */
+/*  PITCH */
+/*       Written in subroutine DYPTRK, and then perhaps read and written */
+/*       some more. */
+/*  RMS */
+/*       Written. */
+/*  RC */
+/*       Indices 1 through ORDER written (ORDER defined in contrl.fh). */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITANALYS. */
+
+
+/* ENTRY PITDEC */
+
+/* Input: */
+/*  PITCH   - Encoded pitch index */
+/* Output: */
+/*  PTAU    - Decoded pitch period */
+
+/* This entry has no local state.  It accesses a "constant" array */
+/* declared in ANALYS. */
+
+/* Subroutine */ int analys_(real *speech, integer *voice, integer 
+	*pitch, real *rms, real *rc, struct lpc10_encoder_state *st)
+{
+    /* Initialized data */
+
+    static integer 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 integer buflim[4] = { 181,720,25,720 };
+    static real precoef = .9375f;
+
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    real amdf[60];
+    integer half;
+    real abuf[156];
+    real *bias;
+    extern /* Subroutine */ int tbdm_(real *, integer *, integer *, integer *,
+	     real *, integer *, integer *, integer *);
+    integer *awin;
+    integer midx, ewin[6]	/* was [2][3] */;
+    real ivrc[2], temp;
+    real *zpre;
+    integer *vwin;
+    integer i__, j, lanal;
+    extern /* Subroutine */ int rcchk_(integer *, real *, real *), mload_(
+	    integer *, integer *, integer *, real *, real *, real *);
+    real *inbuf, *pebuf;
+    real *lpbuf, *ivbuf;
+    real *rcbuf;
+    integer *osbuf;
+    extern /* Subroutine */ int onset_(real *, integer *, integer *, integer *
+	    , integer *, integer *, integer *, struct lpc10_encoder_state *);
+    integer *osptr;
+    extern /* Subroutine */ placea_(integer *, integer *
+	    , integer *, integer *, integer *, integer *, integer *, integer *
+	    , integer *), dcbias_(integer *, real *, real *), placev_(integer 
+	    *, integer *, integer *, integer *, integer *, integer *, integer 
+	    *, integer *, integer *, integer *, integer *);
+    integer ipitch;
+    integer *obound;
+    extern /* Subroutine */ int preemp_(real *, real *, integer *, real *, 
+	    real *), voicin_(integer *, real *, real *, integer *, integer *, 
+	    real *, real *, integer *, real *, integer *, integer *, integer *,
+	    struct lpc10_encoder_state *);
+    integer *voibuf;
+    integer mintau;
+    real *rmsbuf;
+    extern /* Subroutine */ int lpfilt_(real *, real *, integer *, integer *),
+	     ivfilt_(real *, real *, integer *, integer *, real *), energy_(
+	    integer *, real *, real *), invert_(integer *, real *, real *, 
+	    real *);
+    integer minptr, maxptr;
+    extern /* Subroutine */ int dyptrk_(real *, integer *, integer *, integer 
+	    *, integer *, integer *, struct lpc10_encoder_state *);
+    real phi[100]	/* was [10][10] */, psi[10];
+
+/* $Log: analys.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:16:01  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:29:08  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Arguments to ANALYS */
+/* $Log: analys.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:16:01  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:29:08  jaf
+ * Initial revision
+ * */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/*       Arguments to entry PITDEC (below) */
+/* 	Parameters/constants */
+/*  Constants */
+/*    NF =     Number of frames */
+/*    AF =     Frame in which analysis is done */
+/*    OSLEN =  Length of the onset buffer */
+/*    LTAU =   Number of pitch lags */
+/*    SBUFL, SBUFH =   Start and end index of speech buffers */
+/*    LBUFL, LBUFH =   Start and end index of LPF speech buffer */
+/*   MINWIN, MAXWIN = Min and Max length of voicing (and analysis) windows
+*/
+/*    PWLEN, PWINH, PWINL = Length, upper and lower limits of pitch window
+ */
+/*    DVWINL, DVWINH = Default lower and upper limits of voicing window */
+/*       The tables TAU and BUFLIM, and the variable PRECOEF, are not */
+/*       Fortran PARAMETER's, but they are initialized with DATA */
+/*       statements, and never modified.  Thus, they need not have SAVE */
+/*       statements for them to keep their values from one invocation to 
+*/
+/*       the next. */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*  Data Buffers */
+/*    INBUF	Raw speech (with DC bias removed each frame) */
+/*    PEBUF	Preemphasized speech */
+/*    LPBUF	Low pass speech buffer */
+/*    IVBUF	Inverse filtered speech */
+/*    OSBUF	Indexes of onsets in speech buffers */
+/*    VWIN	Voicing window indices */
+/*    AWIN	Analysis window indices */
+/*    EWIN	Energy window indices */
+/*    VOIBUF	Voicing decisions on windows in VWIN */
+/*    RMSBUF	RMS energy */
+/*    RCBUF	Reflection Coefficients */
+
+/*  Pitch is handled separately from the above parameters. */
+/*  The following variables deal with pitch: */
+/*    MIDX	Encoded initial pitch estimate for analysis frame */
+/*    IPITCH	Initial pitch computed for frame AF (decoded from MIDX) */
+/*    PITCH 	The encoded pitch value (index into TAU) for the present */
+/* 		frame (delayed and smoothed by Dyptrack) */
+    /* Parameter adjustments */
+    if (speech) {
+	--speech;
+	}
+    if (voice) {
+	--voice;
+	}
+    if (rc) {
+	--rc;
+	}
+
+    /* Function Body */
+
+/*   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. */
+/*   Update all buffers */
+
+    inbuf = &(st->inbuf[0]);
+    pebuf = &(st->pebuf[0]);
+    lpbuf = &(st->lpbuf[0]);
+    ivbuf = &(st->ivbuf[0]);
+    bias = &(st->bias);
+    osbuf = &(st->osbuf[0]);
+    osptr = &(st->osptr);
+    obound = &(st->obound[0]);
+    vwin = &(st->vwin[0]);
+    awin = &(st->awin[0]);
+    voibuf = &(st->voibuf[0]);
+    rmsbuf = &(st->rmsbuf[0]);
+    rcbuf = &(st->rcbuf[0]);
+    zpre = &(st->zpre);
+
+    i__1 = 720 - contrl_1.lframe;
+    for (i__ = 181; i__ <= i__1; ++i__) {
+	inbuf[i__ - 181] = inbuf[contrl_1.lframe + i__ - 181];
+	pebuf[i__ - 181] = pebuf[contrl_1.lframe + i__ - 181];
+    }
+    i__1 = 540 - contrl_1.lframe;
+    for (i__ = 229; i__ <= i__1; ++i__) {
+	ivbuf[i__ - 229] = ivbuf[contrl_1.lframe + i__ - 229];
+    }
+    i__1 = 720 - contrl_1.lframe;
+    for (i__ = 25; i__ <= i__1; ++i__) {
+	lpbuf[i__ - 25] = lpbuf[contrl_1.lframe + i__ - 25];
+    }
+    j = 1;
+    i__1 = (*osptr) - 1;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	if (osbuf[i__ - 1] > contrl_1.lframe) {
+	    osbuf[j - 1] = osbuf[i__ - 1] - contrl_1.lframe;
+	    ++j;
+	}
+    }
+    *osptr = j;
+    voibuf[0] = voibuf[2];
+    voibuf[1] = voibuf[3];
+    for (i__ = 1; i__ <= 2; ++i__) {
+	vwin[(i__ << 1) - 2] = vwin[(i__ + (1 << 1)) - 2] - contrl_1.lframe;
+	vwin[(i__ << 1) - 1] = vwin[(i__ + (1 << 1)) - 1] - contrl_1.lframe;
+	awin[(i__ << 1) - 2] = awin[(i__ + (1 << 1)) - 2] - contrl_1.lframe;
+	awin[(i__ << 1) - 1] = awin[(i__ + (1 << 1)) - 1] - contrl_1.lframe;
+/*       EWIN(*,J) is unused for J .NE. AF, so the following shift is 
+*/
+/*       unnecessary.  It also causes error messages when the C versio
+n */
+/*       of the code created from this by f2c is run with Purify.  It 
+*/
+/*       correctly complains that uninitialized memory is being read. 
+*/
+/* 	   EWIN(1,I) = EWIN(1,I+1) - LFRAME */
+/* 	   EWIN(2,I) = EWIN(2,I+1) - LFRAME */
+	obound[i__ - 1] = obound[i__];
+	voibuf[i__ * 2] = voibuf[(i__ + 1) * 2];
+	voibuf[(i__ << 1) + 1] = voibuf[(i__ + (1 << 1)) + 1];
+	rmsbuf[i__ - 1] = rmsbuf[i__];
+	i__1 = contrl_1.order;
+	for (j = 1; j <= i__1; ++j) {
+	    rcbuf[j + i__ * 10 - 11] = rcbuf[j + (i__ + 1) * 10 - 11];
+	}
+    }
+/*   Copy input speech, scale to sign+12 bit integers */
+/*   Remove long term DC bias. */
+/*       If the average value in the frame was over 1/4096 (after current 
+*/
+/*       BIAS correction), then subtract that much more from samples in */
+/*       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.f;
+    i__1 = contrl_1.lframe;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	inbuf[720 - contrl_1.lframe + i__ - 181] = speech[i__] * 4096.f - 
+		(*bias);
+	temp += inbuf[720 - contrl_1.lframe + i__ - 181];
+    }
+    if (temp > (real) contrl_1.lframe) {
+	*bias += 1;
+    }
+    if (temp < (real) (-contrl_1.lframe)) {
+	*bias += -1;
+    }
+/*   Place Voicing Window */
+    i__ = 721 - contrl_1.lframe;
+    preemp_(&inbuf[i__ - 181], &pebuf[i__ - 181], &contrl_1.lframe, &precoef, 
+	    zpre);
+    onset_(pebuf, osbuf, osptr, &c__10, &c__181, &c__720, &contrl_1.lframe, st);
+
+/*       MAXOSP is just a debugging variable. */
+
+/* 	MAXOSP = MAX( MAXOSP, OSPTR ) */
+
+    placev_(osbuf, osptr, &c__10, &obound[2], vwin, &c__3, &contrl_1.lframe, 
+	    &c__90, &c__156, &c__307, &c__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 programming (DYPTRK).  However, 
+*/
+/*   since some of DYPTRK's parameters are a function of the voicing */
+/*  decisions, a voicing decision must precede the final pitch estimation.
+*/
+/*   See subroutines LPFILT, IVFILT, and TBDM. */
+/*       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_(&inbuf[228], &lpbuf[384], &c__312, &contrl_1.lframe);
+/*       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_(&lpbuf[204], ivbuf, &c__312, &contrl_1.lframe, ivrc);
+/*       TBDM 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. */
+    tbdm_(ivbuf, &c__156, tau, &c__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 = 1; half <= 2; ++half) {
+	voicin_(&vwin[4], inbuf, lpbuf, buflim, &half, &amdf[minptr - 1], &
+		amdf[maxptr - 1], &mintau, ivrc, obound, voibuf, &c__3, st);
+    }
+/*   Find the minimum cost pitch decision over several frames */
+/*   given the current voicing decision and the AMDF array */
+    dyptrk_(amdf, &c__60, &minptr, &voibuf[7], pitch, &midx, st);
+    ipitch = tau[midx - 1];
+/*   Place spectrum analysis and energy windows */
+    placea_(&ipitch, voibuf, &obound[2], &c__3, vwin, awin, ewin, &
+	    contrl_1.lframe, &c__156);
+/*  Remove short term DC bias over the analysis window, Put result in ABUF
+*/
+    lanal = awin[5] + 1 - awin[4];
+    dcbias_(&lanal, &pebuf[awin[4] - 181], abuf);
+/*       ABUF(1:LANAL) is now defined.  It is equal to */
+/*       PEBUF(AWIN(1,AF):AWIN(2,AF)) corrected for short term DC bias. */
+/*   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. */
+    i__1 = ewin[5] - ewin[4] + 1;
+    energy_(&i__1, &abuf[ewin[4] - awin[4]], &rmsbuf[2]);
+/*   Matrix load and invert, check RC's for stability */
+    mload_(&contrl_1.order, &c__1, &lanal, abuf, phi, psi);
+    invert_(&contrl_1.order, phi, psi, &rcbuf[20]);
+    rcchk_(&contrl_1.order, &rcbuf[10], &rcbuf[20]);
+/*   Set return parameters */
+    voice[1] = voibuf[2];
+    voice[2] = voibuf[3];
+    *rms = rmsbuf[0];
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	rc[i__] = rcbuf[i__ - 1];
+    }
+    return 0;
+} /* analys_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/bsynz.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/bsynz.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/bsynz.c	Fri Sep 21 14:49:14 2007
@@ -1,438 +1,438 @@
-/*
-
-$Log: bsynz.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:18:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:58  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int bsynz_(real *coef, integer *ip, integer *iv, real *sout, real *rms, real *ratio, real *g2pass, struct lpc10_decoder_state *st);
-/* comlen contrl_ 12 */
-/*:ref: random_ 4 0 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* ***************************************************************** */
-
-/* 	BSYNZ Version 54 */
-
-/* $Log: bsynz.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:18:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:58  jaf
- * Initial revision
- *
- */
-/* Revision 1.4  1996/03/27  18:11:22  jaf */
-/* Changed the range of NOISE printed out in the debugging statements, */
-/* even though they are commented out.  I didn't discover this until I */
-/* tried comparing two different versions of the LPC-10 coder, each with */
-/* full tracing enabled. */
-
-/* Revision 1.3  1996/03/26  19:33:23  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.2  1996/03/20  17:12:54  jaf */
-/* Added comments about which indices of array arguments are read or */
-/* written. */
-
-/* Rearranged local variable declarations to indicate which need to be */
-/* saved from one invocation to the next.  Added entry INITBSYNZ to */
-/* reinitialize the local state variables, if desired. */
-
-/* Revision 1.1  1996/02/07 14:43:15  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*   Synthesize One Pitch Epoch */
-
-/* Input: */
-/*  COEF  - Predictor coefficients */
-/*          Indices 1 through ORDER read. */
-/*  IP    - Pitch period (number of samples to synthesize) */
-/*  IV    - Voicing for the current epoch */
-/*  RMS   - Energy for the current epoch */
-/*  RATIO - Energy slope for plosives */
-/*  G2PASS- Sharpening factor for 2 pass synthesis */
-/* Output: */
-/*  SOUT  - Synthesized speech */
-/*          Indices 1 through IP written. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITBSYNZ. */
-
-/* Subroutine */ int bsynz_(real *coef, integer *ip, integer *iv, 
-	real *sout, real *rms, real *ratio, real *g2pass,
-			    struct lpc10_decoder_state *st)
-{
-    /* Initialized data */
-
-    integer *ipo;
-    real *rmso;
-    static integer 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 };
-    real *exc;
-    real *exc2;
-    real *lpi1;
-    real *lpi2;
-    real *lpi3;
-    real *hpi1;
-    real *hpi2;
-    real *hpi3;
-
-    /* System generated locals */
-    integer i__1, i__2;
-    real r__1, r__2;
-
-    /* Builtin functions */
-    double sqrt(doublereal);
-
-    /* Local variables */
-    real gain, xssq;
-    integer i__, j, k;
-    real noise[166], pulse;
-    integer px;
-    real sscale;
-    extern integer random_(struct lpc10_decoder_state *);
-    real xy, sum, ssq;
-    real lpi0, hpi0;
-
-/* $Log: bsynz.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:18:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:58  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Arguments */
-/* $Log: bsynz.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:18:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:58  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/*       Function return value definitions */
-/* 	Parameters/constants */
-/*       KEXC is not a Fortran PARAMETER, but it is an array initialized 
-*/
-/*       with a DATA statement that is never modified. */
-/*       Local variables that need not be saved */
-/*       NOISE is declared with range (1:MAXPIT+MAXORD), but only indices 
-*/
-/*       ORDER+1 through ORDER+IP are ever used, and I think that IP */
-/*       .LE. MAXPIT.  Why not declare it to be in the range (1:MAXPIT) */
-/*       and use that range? */
-/*       Local state */
-/*       I believe that only indices 1 through ORDER of EXC need to be */
-/*       saved from one invocation to the next, but we may as well save */
-/*       the whole array. */
-/*       None of these local variables were given initial values in the */
-/*       original code.  I'm guessing that 0 is a reasonable initial */
-/*       value for all of them. */
-    /* Parameter adjustments */
-    if (coef) {
-	--coef;
-	}
-    if (sout) {
-	--sout;
-	}
-
-    /* Function Body */
-    ipo = &(st->ipo);
-    exc = &(st->exc[0]);
-    exc2 = &(st->exc2[0]);
-    lpi1 = &(st->lpi1);
-    lpi2 = &(st->lpi2);
-    lpi3 = &(st->lpi3);
-    hpi1 = &(st->hpi1);
-    hpi2 = &(st->hpi2);
-    hpi3 = &(st->hpi3);
-    rmso = &(st->rmso_bsynz);
-
-/*                  MAXPIT+MAXORD=166 */
-/*  Calculate history scale factor XY and scale filter state */
-/* Computing MIN */
-    r__1 = *rmso / (*rms + 1e-6f);
-    xy = min(r__1,8.f);
-    *rmso = *rms;
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	exc2[i__ - 1] = exc2[*ipo + i__ - 1] * xy;
-    }
-    *ipo = *ip;
-    if (*iv == 0) {
-/*  Generate white noise for unvoiced */
-	i__1 = *ip;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    exc[contrl_1.order + i__ - 1] = (real) (random_(st) / 64);
-	}
-/*  Impulse doublet excitation for plosives */
-/*       (RANDOM()+32768) is in the range 0 to 2**16-1.  Therefore the
- */
-/*       following expression should be evaluated using integers with 
-at */
-/*       least 32 bits (16 isn't enough), and PX should be in the rang
-e */
-/*       ORDER+1+0 through ORDER+1+(IP-2) .EQ. ORDER+IP-1. */
-	px = (random_(st) + 32768) * (*ip - 1) / 65536 + contrl_1.order + 1;
-	r__1 = *ratio / 4 * 1.f;
-	pulse = r__1 * 342;
-	if (pulse > 2e3f) {
-	    pulse = 2e3f;
-	}
-	exc[px - 1] += pulse;
-	exc[px] -= pulse;
-/*  Load voiced excitation */
-    } else {
-	sscale = (real)sqrt((real) (*ip)) / 6.928f;
-	i__1 = *ip;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    exc[contrl_1.order + i__ - 1] = 0.f;
-	    if (i__ <= 25) {
-		exc[contrl_1.order + i__ - 1] = sscale * kexc[i__ - 1];
-	    }
-	    lpi0 = exc[contrl_1.order + i__ - 1];
-	    r__2 = exc[contrl_1.order + i__ - 1] * .125f + *lpi1 * .75f;
-	    r__1 = r__2 + *lpi2 * .125f;
-	    exc[contrl_1.order + i__ - 1] = r__1 + *lpi3 * 0.f;
-	    *lpi3 = *lpi2;
-	    *lpi2 = *lpi1;
-	    *lpi1 = lpi0;
-	}
-	i__1 = *ip;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    noise[contrl_1.order + i__ - 1] = random_(st) * 1.f / 64;
-	    hpi0 = noise[contrl_1.order + i__ - 1];
-	    r__2 = noise[contrl_1.order + i__ - 1] * -.125f + *hpi1 * .25f;
-	    r__1 = r__2 + *hpi2 * -.125f;
-	    noise[contrl_1.order + i__ - 1] = r__1 + *hpi3 * 0.f;
-	    *hpi3 = *hpi2;
-	    *hpi2 = *hpi1;
-	    *hpi1 = hpi0;
-	}
-	i__1 = *ip;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    exc[contrl_1.order + i__ - 1] += noise[contrl_1.order + i__ - 1];
-	}
-    }
-/*   Synthesis filters: */
-/*    Modify the excitation with all-zero filter  1 + G*SUM */
-    xssq = 0.f;
-    i__1 = *ip;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	k = contrl_1.order + i__;
-	sum = 0.f;
-	i__2 = contrl_1.order;
-	for (j = 1; j <= i__2; ++j) {
-	    sum += coef[j] * exc[k - j - 1];
-	}
-	sum *= *g2pass;
-	exc2[k - 1] = sum + exc[k - 1];
-    }
-/*   Synthesize using the all pole filter  1 / (1 - SUM) */
-    i__1 = *ip;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	k = contrl_1.order + i__;
-	sum = 0.f;
-	i__2 = contrl_1.order;
-	for (j = 1; j <= i__2; ++j) {
-	    sum += coef[j] * exc2[k - j - 1];
-	}
-	exc2[k - 1] = sum + exc2[k - 1];
-	xssq += exc2[k - 1] * exc2[k - 1];
-    }
-/*  Save filter history for next epoch */
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	exc[i__ - 1] = exc[*ip + i__ - 1];
-	exc2[i__ - 1] = exc2[*ip + i__ - 1];
-    }
-/*  Apply gain to match RMS */
-    r__1 = *rms * *rms;
-    ssq = r__1 * *ip;
-    gain = (real)sqrt(ssq / xssq);
-    i__1 = *ip;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	sout[i__] = gain * exc2[contrl_1.order + i__ - 1];
-    }
-    return 0;
-} /* bsynz_ */
+/*
+
+$Log: bsynz.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:18:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:58  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int bsynz_(real *coef, integer *ip, integer *iv, real *sout, real *rms, real *ratio, real *g2pass, struct lpc10_decoder_state *st);
+/* comlen contrl_ 12 */
+/*:ref: random_ 4 0 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* ***************************************************************** */
+
+/* 	BSYNZ Version 54 */
+
+/* $Log: bsynz.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:18:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:58  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.4  1996/03/27  18:11:22  jaf */
+/* Changed the range of NOISE printed out in the debugging statements, */
+/* even though they are commented out.  I didn't discover this until I */
+/* tried comparing two different versions of the LPC-10 coder, each with */
+/* full tracing enabled. */
+
+/* Revision 1.3  1996/03/26  19:33:23  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.2  1996/03/20  17:12:54  jaf */
+/* Added comments about which indices of array arguments are read or */
+/* written. */
+
+/* Rearranged local variable declarations to indicate which need to be */
+/* saved from one invocation to the next.  Added entry INITBSYNZ to */
+/* reinitialize the local state variables, if desired. */
+
+/* Revision 1.1  1996/02/07 14:43:15  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*   Synthesize One Pitch Epoch */
+
+/* Input: */
+/*  COEF  - Predictor coefficients */
+/*          Indices 1 through ORDER read. */
+/*  IP    - Pitch period (number of samples to synthesize) */
+/*  IV    - Voicing for the current epoch */
+/*  RMS   - Energy for the current epoch */
+/*  RATIO - Energy slope for plosives */
+/*  G2PASS- Sharpening factor for 2 pass synthesis */
+/* Output: */
+/*  SOUT  - Synthesized speech */
+/*          Indices 1 through IP written. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITBSYNZ. */
+
+/* Subroutine */ int bsynz_(real *coef, integer *ip, integer *iv, 
+	real *sout, real *rms, real *ratio, real *g2pass,
+			    struct lpc10_decoder_state *st)
+{
+    /* Initialized data */
+
+    integer *ipo;
+    real *rmso;
+    static integer 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 };
+    real *exc;
+    real *exc2;
+    real *lpi1;
+    real *lpi2;
+    real *lpi3;
+    real *hpi1;
+    real *hpi2;
+    real *hpi3;
+
+    /* System generated locals */
+    integer i__1, i__2;
+    real r__1, r__2;
+
+    /* Builtin functions */
+    double sqrt(doublereal);
+
+    /* Local variables */
+    real gain, xssq;
+    integer i__, j, k;
+    real noise[166], pulse;
+    integer px;
+    real sscale;
+    extern integer random_(struct lpc10_decoder_state *);
+    real xy, sum, ssq;
+    real lpi0, hpi0;
+
+/* $Log: bsynz.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:18:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:58  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Arguments */
+/* $Log: bsynz.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:18:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:58  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/*       Function return value definitions */
+/* 	Parameters/constants */
+/*       KEXC is not a Fortran PARAMETER, but it is an array initialized 
+*/
+/*       with a DATA statement that is never modified. */
+/*       Local variables that need not be saved */
+/*       NOISE is declared with range (1:MAXPIT+MAXORD), but only indices 
+*/
+/*       ORDER+1 through ORDER+IP are ever used, and I think that IP */
+/*       .LE. MAXPIT.  Why not declare it to be in the range (1:MAXPIT) */
+/*       and use that range? */
+/*       Local state */
+/*       I believe that only indices 1 through ORDER of EXC need to be */
+/*       saved from one invocation to the next, but we may as well save */
+/*       the whole array. */
+/*       None of these local variables were given initial values in the */
+/*       original code.  I'm guessing that 0 is a reasonable initial */
+/*       value for all of them. */
+    /* Parameter adjustments */
+    if (coef) {
+	--coef;
+	}
+    if (sout) {
+	--sout;
+	}
+
+    /* Function Body */
+    ipo = &(st->ipo);
+    exc = &(st->exc[0]);
+    exc2 = &(st->exc2[0]);
+    lpi1 = &(st->lpi1);
+    lpi2 = &(st->lpi2);
+    lpi3 = &(st->lpi3);
+    hpi1 = &(st->hpi1);
+    hpi2 = &(st->hpi2);
+    hpi3 = &(st->hpi3);
+    rmso = &(st->rmso_bsynz);
+
+/*                  MAXPIT+MAXORD=166 */
+/*  Calculate history scale factor XY and scale filter state */
+/* Computing MIN */
+    r__1 = *rmso / (*rms + 1e-6f);
+    xy = min(r__1,8.f);
+    *rmso = *rms;
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	exc2[i__ - 1] = exc2[*ipo + i__ - 1] * xy;
+    }
+    *ipo = *ip;
+    if (*iv == 0) {
+/*  Generate white noise for unvoiced */
+	i__1 = *ip;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    exc[contrl_1.order + i__ - 1] = (real) (random_(st) / 64);
+	}
+/*  Impulse doublet excitation for plosives */
+/*       (RANDOM()+32768) is in the range 0 to 2**16-1.  Therefore the
+ */
+/*       following expression should be evaluated using integers with 
+at */
+/*       least 32 bits (16 isn't enough), and PX should be in the rang
+e */
+/*       ORDER+1+0 through ORDER+1+(IP-2) .EQ. ORDER+IP-1. */
+	px = (random_(st) + 32768) * (*ip - 1) / 65536 + contrl_1.order + 1;
+	r__1 = *ratio / 4 * 1.f;
+	pulse = r__1 * 342;
+	if (pulse > 2e3f) {
+	    pulse = 2e3f;
+	}
+	exc[px - 1] += pulse;
+	exc[px] -= pulse;
+/*  Load voiced excitation */
+    } else {
+	sscale = (real)sqrt((real) (*ip)) / 6.928f;
+	i__1 = *ip;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    exc[contrl_1.order + i__ - 1] = 0.f;
+	    if (i__ <= 25) {
+		exc[contrl_1.order + i__ - 1] = sscale * kexc[i__ - 1];
+	    }
+	    lpi0 = exc[contrl_1.order + i__ - 1];
+	    r__2 = exc[contrl_1.order + i__ - 1] * .125f + *lpi1 * .75f;
+	    r__1 = r__2 + *lpi2 * .125f;
+	    exc[contrl_1.order + i__ - 1] = r__1 + *lpi3 * 0.f;
+	    *lpi3 = *lpi2;
+	    *lpi2 = *lpi1;
+	    *lpi1 = lpi0;
+	}
+	i__1 = *ip;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    noise[contrl_1.order + i__ - 1] = random_(st) * 1.f / 64;
+	    hpi0 = noise[contrl_1.order + i__ - 1];
+	    r__2 = noise[contrl_1.order + i__ - 1] * -.125f + *hpi1 * .25f;
+	    r__1 = r__2 + *hpi2 * -.125f;
+	    noise[contrl_1.order + i__ - 1] = r__1 + *hpi3 * 0.f;
+	    *hpi3 = *hpi2;
+	    *hpi2 = *hpi1;
+	    *hpi1 = hpi0;
+	}
+	i__1 = *ip;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    exc[contrl_1.order + i__ - 1] += noise[contrl_1.order + i__ - 1];
+	}
+    }
+/*   Synthesis filters: */
+/*    Modify the excitation with all-zero filter  1 + G*SUM */
+    xssq = 0.f;
+    i__1 = *ip;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	k = contrl_1.order + i__;
+	sum = 0.f;
+	i__2 = contrl_1.order;
+	for (j = 1; j <= i__2; ++j) {
+	    sum += coef[j] * exc[k - j - 1];
+	}
+	sum *= *g2pass;
+	exc2[k - 1] = sum + exc[k - 1];
+    }
+/*   Synthesize using the all pole filter  1 / (1 - SUM) */
+    i__1 = *ip;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	k = contrl_1.order + i__;
+	sum = 0.f;
+	i__2 = contrl_1.order;
+	for (j = 1; j <= i__2; ++j) {
+	    sum += coef[j] * exc2[k - j - 1];
+	}
+	exc2[k - 1] = sum + exc2[k - 1];
+	xssq += exc2[k - 1] * exc2[k - 1];
+    }
+/*  Save filter history for next epoch */
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	exc[i__ - 1] = exc[*ip + i__ - 1];
+	exc2[i__ - 1] = exc2[*ip + i__ - 1];
+    }
+/*  Apply gain to match RMS */
+    r__1 = *rms * *rms;
+    ssq = r__1 * *ip;
+    gain = (real)sqrt(ssq / xssq);
+    i__1 = *ip;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	sout[i__] = gain * exc2[contrl_1.order + i__ - 1];
+    }
+    return 0;
+} /* bsynz_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/chanwr.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/chanwr.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/chanwr.c	Fri Sep 21 14:49:14 2007
@@ -1,226 +1,226 @@
-/*
-
-$Log: chanwr.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:20:24  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Revision 1.1  1996/08/19  22:40:31  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int chanwr_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits, struct lpc10_encoder_state *st);
-extern int chanrd_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* *********************************************************************** */
-
-/* 	CHANL Version 49 */
-
-/* $Log: chanwr.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:20:24  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Revision 1.1  1996/08/19  22:40:31  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/21  15:14:57  jaf */
-/* Added comments about which indices of argument arrays are read or */
-/* written, and about the one bit of local state in CHANWR.  CHANRD */
-/* has no local state. */
-
-/* Revision 1.2  1996/03/13  18:55:10  jaf */
-/* Comments added explaining which of the local variables of this */
-/* subroutine need to be saved from one invocation to the next, and which */
-/* do not. */
-
-/* Revision 1.1  1996/02/07 14:43:31  jaf */
-/* Initial revision */
-
-
-/* *********************************************************************** */
-
-/* CHANWR: */
-/*   Place quantized parameters into bitstream */
-
-/* Input: */
-/*  ORDER  - Number of reflection coefficients (not really variable) */
-/*  IPITV  - Quantized pitch/voicing parameter */
-/*  IRMS   - Quantized energy parameter */
-/*  IRC    - Quantized reflection coefficients */
-/*           Indices 1 through ORDER read. */
-/* Output: */
-/*  IBITS  - Serial bitstream */
-/*           Indices 1 through 54 written. */
-/*           Bit 54, the SYNC bit, alternates from one call to the next. */
-
-/* Subroutine CHANWR maintains one bit of local state from one call to */
-/* the next, in the variable ISYNC.  I believe that this one bit is only */
-/* intended to allow a receiver to resynchronize its interpretation of */
-/* the bit stream, by looking for which of the 54 bits alternates every */
-/* frame time.  This is just a simple framing mechanism that is not */
-/* useful when other, higher overhead framing mechanisms are used to */
-/* transmit the coded frames. */
-
-/* I'm not going to make an entry to reinitialize this bit, since it */
-/* doesn't help a receiver much to know whether the first sync bit is a 0 */
-/* or a 1.  It needs to examine several frames in sequence to have */
-/* reasonably good assurance that its framing is correct. */
-
-
-/* CHANRD: */
-/*   Reconstruct parameters from bitstream */
-
-/* Input: */
-/*  ORDER  - Number of reflection coefficients (not really variable) */
-/*  IBITS  - Serial bitstream */
-/*           Indices 1 through 53 read (SYNC bit is ignored). */
-/* Output: */
-/*  IPITV  - Quantized pitch/voicing parameter */
-/*  IRMS   - Quantized energy parameter */
-/*  IRC    - Quantized reflection coefficients */
-/*           Indices 1 through ORDER written */
-
-/* Entry CHANRD has no local state. */
-
-
-
-/*   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 */
-/* Subroutine */ int chanwr_0_(int n__, integer *order, integer *ipitv, 
-	integer *irms, integer *irc, integer *ibits,
-			       struct lpc10_encoder_state *st)
-{
-    /* Initialized data */
-
-    integer *isync;
-    static integer bit[10] = { 2,4,8,8,8,8,16,16,16,16 };
-    static integer 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 };
-
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    integer itab[13], i__;
-
-/*       Arguments */
-/*       Parameters/constants */
-/*       These arrays are not Fortran PARAMETER's, but they are defined */
-/*       by DATA statements below, and their contents are never altered. 
-*/
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       ISYNC is only used by CHANWR, not by ENTRY CHANRD. */
-
-    /* Parameter adjustments */
-    --irc;
-    --ibits;
-
-    /* Function Body */
-    switch(n__) {
-	case 1: goto L_chanrd;
-	}
-
-    isync = &(st->isync);
-
-/* ***********************************************************************
- */
-/* 	Place quantized parameters into bitstream */
-/* ***********************************************************************
- */
-/*   Place parameters into ITAB */
-    itab[0] = *ipitv;
-    itab[1] = *irms;
-    itab[2] = 0;
-    i__1 = *order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	itab[i__ + 2] = irc[*order + 1 - i__] & 32767;
-    }
-/*   Put 54 bits into IBITS array */
-    for (i__ = 1; i__ <= 53; ++i__) {
-	ibits[i__] = itab[iblist[i__ - 1] - 1] & 1;
-	itab[iblist[i__ - 1] - 1] /= 2;
-    }
-    ibits[54] = *isync & 1;
-    *isync = 1 - *isync;
-    return 0;
-/* ***********************************************************************
- */
-/* 	Reconstruct parameters from bitstream */
-/* ***********************************************************************
- */
-
-L_chanrd:
-/*   Reconstruct ITAB */
-    for (i__ = 1; i__ <= 13; ++i__) {
-	itab[i__ - 1] = 0;
-    }
-    for (i__ = 1; i__ <= 53; ++i__) {
-	itab[iblist[54 - i__ - 1] - 1] = (itab[iblist[54 - i__ - 1] - 1] << 1)
-		 + ibits[54 - i__];
-    }
-/*   Sign extend RC's */
-    i__1 = *order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	if ((itab[i__ + 2] & bit[i__ - 1]) != 0) {
-	    itab[i__ + 2] -= bit[i__ - 1] << 1;
-	}
-    }
-/*   Restore variables */
-    *ipitv = itab[0];
-    *irms = itab[1];
-    i__1 = *order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	irc[i__] = itab[*order + 4 - i__ - 1];
-    }
-    return 0;
-} /* chanwr_ */
-
-/* Subroutine */ int chanwr_(integer *order, integer *ipitv, integer *irms, 
-	integer *irc, integer *ibits, struct lpc10_encoder_state *st)
-{
-    return chanwr_0_(0, order, ipitv, irms, irc, ibits, st);
-    }
-
-/* Subroutine */ int chanrd_(integer *order, integer *ipitv, integer *irms, 
-	integer *irc, integer *ibits)
-{
-    return chanwr_0_(1, order, ipitv, irms, irc, ibits, 0);
-    }
+/*
+
+$Log: chanwr.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:20:24  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Revision 1.1  1996/08/19  22:40:31  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int chanwr_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits, struct lpc10_encoder_state *st);
+extern int chanrd_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* *********************************************************************** */
+
+/* 	CHANL Version 49 */
+
+/* $Log: chanwr.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:20:24  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Revision 1.1  1996/08/19  22:40:31  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/21  15:14:57  jaf */
+/* Added comments about which indices of argument arrays are read or */
+/* written, and about the one bit of local state in CHANWR.  CHANRD */
+/* has no local state. */
+
+/* Revision 1.2  1996/03/13  18:55:10  jaf */
+/* Comments added explaining which of the local variables of this */
+/* subroutine need to be saved from one invocation to the next, and which */
+/* do not. */
+
+/* Revision 1.1  1996/02/07 14:43:31  jaf */
+/* Initial revision */
+
+
+/* *********************************************************************** */
+
+/* CHANWR: */
+/*   Place quantized parameters into bitstream */
+
+/* Input: */
+/*  ORDER  - Number of reflection coefficients (not really variable) */
+/*  IPITV  - Quantized pitch/voicing parameter */
+/*  IRMS   - Quantized energy parameter */
+/*  IRC    - Quantized reflection coefficients */
+/*           Indices 1 through ORDER read. */
+/* Output: */
+/*  IBITS  - Serial bitstream */
+/*           Indices 1 through 54 written. */
+/*           Bit 54, the SYNC bit, alternates from one call to the next. */
+
+/* Subroutine CHANWR maintains one bit of local state from one call to */
+/* the next, in the variable ISYNC.  I believe that this one bit is only */
+/* intended to allow a receiver to resynchronize its interpretation of */
+/* the bit stream, by looking for which of the 54 bits alternates every */
+/* frame time.  This is just a simple framing mechanism that is not */
+/* useful when other, higher overhead framing mechanisms are used to */
+/* transmit the coded frames. */
+
+/* I'm not going to make an entry to reinitialize this bit, since it */
+/* doesn't help a receiver much to know whether the first sync bit is a 0 */
+/* or a 1.  It needs to examine several frames in sequence to have */
+/* reasonably good assurance that its framing is correct. */
+
+
+/* CHANRD: */
+/*   Reconstruct parameters from bitstream */
+
+/* Input: */
+/*  ORDER  - Number of reflection coefficients (not really variable) */
+/*  IBITS  - Serial bitstream */
+/*           Indices 1 through 53 read (SYNC bit is ignored). */
+/* Output: */
+/*  IPITV  - Quantized pitch/voicing parameter */
+/*  IRMS   - Quantized energy parameter */
+/*  IRC    - Quantized reflection coefficients */
+/*           Indices 1 through ORDER written */
+
+/* Entry CHANRD has no local state. */
+
+
+
+/*   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 */
+/* Subroutine */ int chanwr_0_(int n__, integer *order, integer *ipitv, 
+	integer *irms, integer *irc, integer *ibits,
+			       struct lpc10_encoder_state *st)
+{
+    /* Initialized data */
+
+    integer *isync;
+    static integer bit[10] = { 2,4,8,8,8,8,16,16,16,16 };
+    static integer 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 };
+
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    integer itab[13], i__;
+
+/*       Arguments */
+/*       Parameters/constants */
+/*       These arrays are not Fortran PARAMETER's, but they are defined */
+/*       by DATA statements below, and their contents are never altered. 
+*/
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       ISYNC is only used by CHANWR, not by ENTRY CHANRD. */
+
+    /* Parameter adjustments */
+    --irc;
+    --ibits;
+
+    /* Function Body */
+    switch(n__) {
+	case 1: goto L_chanrd;
+	}
+
+    isync = &(st->isync);
+
+/* ***********************************************************************
+ */
+/* 	Place quantized parameters into bitstream */
+/* ***********************************************************************
+ */
+/*   Place parameters into ITAB */
+    itab[0] = *ipitv;
+    itab[1] = *irms;
+    itab[2] = 0;
+    i__1 = *order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	itab[i__ + 2] = irc[*order + 1 - i__] & 32767;
+    }
+/*   Put 54 bits into IBITS array */
+    for (i__ = 1; i__ <= 53; ++i__) {
+	ibits[i__] = itab[iblist[i__ - 1] - 1] & 1;
+	itab[iblist[i__ - 1] - 1] /= 2;
+    }
+    ibits[54] = *isync & 1;
+    *isync = 1 - *isync;
+    return 0;
+/* ***********************************************************************
+ */
+/* 	Reconstruct parameters from bitstream */
+/* ***********************************************************************
+ */
+
+L_chanrd:
+/*   Reconstruct ITAB */
+    for (i__ = 1; i__ <= 13; ++i__) {
+	itab[i__ - 1] = 0;
+    }
+    for (i__ = 1; i__ <= 53; ++i__) {
+	itab[iblist[54 - i__ - 1] - 1] = (itab[iblist[54 - i__ - 1] - 1] << 1)
+		 + ibits[54 - i__];
+    }
+/*   Sign extend RC's */
+    i__1 = *order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	if ((itab[i__ + 2] & bit[i__ - 1]) != 0) {
+	    itab[i__ + 2] -= bit[i__ - 1] << 1;
+	}
+    }
+/*   Restore variables */
+    *ipitv = itab[0];
+    *irms = itab[1];
+    i__1 = *order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	irc[i__] = itab[*order + 4 - i__ - 1];
+    }
+    return 0;
+} /* chanwr_ */
+
+/* Subroutine */ int chanwr_(integer *order, integer *ipitv, integer *irms, 
+	integer *irc, integer *ibits, struct lpc10_encoder_state *st)
+{
+    return chanwr_0_(0, order, ipitv, irms, irc, ibits, st);
+    }
+
+/* Subroutine */ int chanrd_(integer *order, integer *ipitv, integer *irms, 
+	integer *irc, integer *ibits)
+{
+    return chanwr_0_(1, order, ipitv, irms, irc, ibits, 0);
+    }

Modified: freeswitch/trunk/libs/codec/lpc10/src/dcbias.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/dcbias.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/dcbias.c	Fri Sep 21 14:49:14 2007
@@ -1,96 +1,96 @@
-/*
-
-$Log: dcbias.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:40:23  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int dcbias_(integer *len, real *speech, real *sigout);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************* */
-
-/* 	DCBIAS Version 50 */
-
-/* $Log: dcbias.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:40:23  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/18  21:19:22  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  16:44:53  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:44:21  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/* Calculate and remove DC bias from buffer. */
-
-/* Input: */
-/*  LEN    - Length of speech buffers */
-/*  SPEECH - Input speech buffer */
-/*           Indices 1 through LEN read. */
-/* Output: */
-/*  SIGOUT - Output speech buffer */
-/*           Indices 1 through LEN written */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
-{
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    real bias;
-    integer i__;
-
-/* 	Arguments */
-/*       Local variables that need not be saved */
-    /* Parameter adjustments */
-    --sigout;
-    --speech;
-
-    /* Function Body */
-    bias = 0.f;
-    i__1 = *len;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	bias += speech[i__];
-    }
-    bias /= *len;
-    i__1 = *len;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	sigout[i__] = speech[i__] - bias;
-    }
-    return 0;
-} /* dcbias_ */
-
+/*
+
+$Log: dcbias.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:40:23  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int dcbias_(integer *len, real *speech, real *sigout);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************* */
+
+/* 	DCBIAS Version 50 */
+
+/* $Log: dcbias.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:40:23  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/18  21:19:22  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  16:44:53  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:44:21  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/* Calculate and remove DC bias from buffer. */
+
+/* Input: */
+/*  LEN    - Length of speech buffers */
+/*  SPEECH - Input speech buffer */
+/*           Indices 1 through LEN read. */
+/* Output: */
+/*  SIGOUT - Output speech buffer */
+/*           Indices 1 through LEN written */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
+{
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    real bias;
+    integer i__;
+
+/* 	Arguments */
+/*       Local variables that need not be saved */
+    /* Parameter adjustments */
+    --sigout;
+    --speech;
+
+    /* Function Body */
+    bias = 0.f;
+    i__1 = *len;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	bias += speech[i__];
+    }
+    bias /= *len;
+    i__1 = *len;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	sigout[i__] = speech[i__] - bias;
+    }
+    return 0;
+} /* dcbias_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/decode.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/decode.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/decode.c	Fri Sep 21 14:49:14 2007
@@ -1,604 +1,604 @@
-/*
-
-$Log: decode_.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:22:39  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:38  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int decode_(integer *ipitv, integer *irms, integer *irc, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_decoder_state *st);
-/* comlen contrl_ 12 */
-/*:ref: ham84_ 14 3 4 4 4 */
-/*:ref: median_ 4 3 4 4 4 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* Table of constant values */
-
-static integer c__2 = 2;
-
-/* ***************************************************************** */
-
-/* 	DECODE Version 54 */
-
-/* $Log: decode_.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:22:39  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:38  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/05/23  20:06:03  jaf */
-/* Assigned PITCH a "default" value on the first call, since otherwise it */
-/* would be left uninitialized. */
-
-/* Revision 1.4  1996/03/26  19:35:18  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.3  1996/03/21  21:10:50  jaf */
-/* Added entry INITDECODE to reinitialize the local state of subroutine */
-/* DECODE. */
-
-/* Revision 1.2  1996/03/21  21:04:50  jaf */
-/* Determined which local variables should be saved from one invocation */
-/* to the next, and guessed initial values for some that should have been */
-/* saved, but weren't given initial values.  Many of the arrays are */
-/* "constants", and many local variables are only used if the "global" */
-/* variable CORRP is .TRUE. */
-
-/* Added comments explaining which indices of array arguments are read or */
-/* written. */
-
-/* Revision 1.1  1996/02/12 03:21:10  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*   This subroutine provides error correction and decoding */
-/*   for all LPC parameters */
-
-/* Input: */
-/*  IPITV  - Index value of pitch */
-/*  IRMS   - Coded Energy */
-/*  CORRP  - Error correction: */
-/*    If FALSE, parameters are decoded directly with no delay.  If TRUE, */
-/*    most important parameter bits are protected by Hamming code and */
-/*    median smoothed.  This requires an additional frame of delay. */
-/* Input/Output: */
-/*  IRC    - Coded Reflection Coefficients */
-/*           Indices 1 through ORDER always read, then written. */
-/* Output: */
-/*  VOICE  - Half frame voicing decisions */
-/*           Indices 1 through 2 written. */
-/*  PITCH  - Decoded pitch */
-/*  RMS    - Energy */
-/*  RC     - Reflection coefficients */
-/*           Indices 1 through ORDER written. */
-
-/*  NOTE: Zero RC's should be done more directly, but this would affect */
-/*   coded parameter printout. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITDECODE. */
-
-/* Subroutine */ int decode_(integer *ipitv, integer *irms, 
-	integer *irc, integer *voice, integer *pitch, real *rms, real *rc,
-			     struct lpc10_decoder_state *st)
-{
-    /* Initialized data */
-
-    logical *first;
-    static integer ethrs = 2048;
-    static integer ethrs1 = 128;
-    static integer ethrs2 = 1024;
-    static integer ethrs3 = 2048;
-    static integer 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 real corth[32]	/* was [4][8] */ = { 32767.f,10.f,5.f,0.f,
-	    32767.f,8.f,4.f,0.f,32.f,6.4f,3.2f,0.f,32.f,6.4f,3.2f,0.f,32.f,
-	    11.2f,6.4f,0.f,32.f,11.2f,6.4f,0.f,16.f,5.6f,3.2f,0.f,16.f,5.6f,
-	    3.2f,0.f };
-    static integer 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 integer 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 integer 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 real descl[8] = { .6953f,.625f,.5781f,.5469f,.5312f,.5391f,.4688f,
-	    .3828f };
-    integer *ivp2h;
-    static integer deadd[8] = { 1152,-2816,-1536,-3584,-1280,-2432,768,-1920 }
-	    ;
-    static integer qb[8] = { 511,511,1023,1023,1023,1023,2047,4095 };
-    static integer nbit[10] = { 8,8,5,5,4,4,4,4,3,2 };
-    static integer zrc[10] = { 0,0,0,0,0,3,0,2,0,0 };
-    static integer bit[5] = { 2,4,8,16,32 };
-    integer *iovoic;
-    integer *iavgp;
-    integer *iptold;
-    integer *erate;
-    integer *drc;
-    integer *dpit;
-    integer *drms;
-
-    /* System generated locals */
-    integer i__1, i__2;
-
-    /* Builtin functions */
-    integer pow_ii(integer *, integer *);
-
-    /* Local variables */
-    extern /* Subroutine */ int ham84_(integer *, integer *, integer *);
-    integer ipit, iout, i__, icorf, index, ivoic, ixcor, i1, i2, i4;
-    extern integer median_(integer *, integer *, integer *);
-    integer ishift, errcnt, lsb;
-
-/* $Log: decode_.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:22:39  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:38  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Arguments */
-/* $Log: decode_.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:22:39  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:38  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/*       Function return value definitions */
-
-/*       Parameters/constants */
-
-/*       The variables below that are not Fortran PARAMETER's are */
-/*       initialized with DATA statements, and then never modified. */
-/*       The following are used regardless of CORRP's value. */
-
-/*       DETAU, NBIT, QB, DEADD, DETAB7, RMST, DESCL */
-
-/*       The following are used only if CORRP is .TRUE. */
-
-/*       ETHRS, ETHRS1, ETHRS2, ETHRS3, IVTAB, BIT, CORTH, ZRC */
-
-/*       Local variables that need not be saved */
-
-/*       The following are used regardless of CORRP's value */
-/*       The following are used only if CORRP is .TRUE. */
-
-/*       Local state */
-
-/*       The following are used regardless of CORRP's value */
-/*       The following are used only if CORRP is .TRUE. */
-/*       I am guessing the initial values for IVP2H, IOVOIC, DRC, DPIT, */
-/*       and DRMS.  They should be checked to see if they are reasonable. 
-*/
-/*       I'm also guessing for ERATE, but I think 0 is the right initial 
-*/
-/*       value. */
-    /* Parameter adjustments */
-    if (irc) {
-	--irc;
-	}
-    if (voice) {
-	--voice;
-	}
-    if (rc) {
-	--rc;
-	}
-
-    /* Function Body */
-
-    iptold = &(st->iptold);
-    first = &(st->first);
-    ivp2h = &(st->ivp2h);
-    iovoic = &(st->iovoic);
-    iavgp = &(st->iavgp);
-    erate = &(st->erate);
-    drc = &(st->drc[0]);
-    dpit = &(st->dpit[0]);
-    drms = &(st->drms[0]);
-
-/* DATA statements for "constants" defined above. */
-/* 	IF (LISTL.GE.3) WRITE(FDEBUG,800) IPITV,IRMS,(IRC(J),J=1,ORDER) */
-/* 800	FORMAT(1X,' <<ERRCOR IN>>',T32,6X,I6,I5,T50,10I8) */
-/*  If no error correction, do pitch and voicing then jump to decode */
-    i4 = detau[*ipitv];
-    if (! contrl_1.corrp) {
-	voice[1] = 1;
-	voice[2] = 1;
-	if (*ipitv <= 1) {
-	    voice[1] = 0;
-	}
-	if (*ipitv == 0 || *ipitv == 2) {
-	    voice[2] = 0;
-	}
-	*pitch = i4;
-	if (*pitch <= 4) {
-	    *pitch = *iptold;
-	}
-	if (voice[1] == 1 && voice[2] == 1) {
-	    *iptold = *pitch;
-	}
-	if (voice[1] != voice[2]) {
-	    *pitch = *iptold;
-	}
-	goto L900;
-    }
-/*  Do error correction pitch and voicing */
-    if (i4 > 4) {
-	dpit[0] = i4;
-	ivoic = 2;
-	*iavgp = (*iavgp * 15 + i4 + 8) / 16;
-    } else {
-	ivoic = i4;
-	dpit[0] = *iavgp;
-    }
-    drms[0] = *irms;
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	drc[i__ * 3 - 3] = irc[i__];
-    }
-/*  Determine index to IVTAB from V/UV decision */
-/*  If error rate is high then use alternate table */
-    index = (*ivp2h << 4) + (*iovoic << 2) + ivoic + 1;
-    i1 = ivtab[index - 1];
-    ipit = i1 & 3;
-    icorf = i1 / 8;
-    if (*erate < ethrs) {
-	icorf /= 64;
-    }
-/*  Determine error rate:  4=high    1=low */
-    ixcor = 4;
-    if (*erate < ethrs3) {
-	ixcor = 3;
-    }
-    if (*erate < ethrs2) {
-	ixcor = 2;
-    }
-    if (*erate < ethrs1) {
-	ixcor = 1;
-    }
-/*  Voice/unvoice decision determined from bits 0 and 1 of IVTAB */
-    voice[1] = icorf / 2 & 1;
-    voice[2] = icorf & 1;
-/*  Skip decoding on first frame because present data not yet available */
-    if (*first) {
-	*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. */
-	*pitch = i4;
-	if (*pitch <= 4) {
-	    *pitch = *iptold;
-	}
-	goto L500;
-    }
-/*  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 or unvoiced frame.  If IOUT is negative, */
-/*    more than 1 error occurred, use previous frame's parameters. */
-    if ((icorf & bit[3]) != 0) {
-	errcnt = 0;
-	lsb = drms[1] & 1;
-	index = (drc[22] << 4) + drms[1] / 2;
-	ham84_(&index, &iout, &errcnt);
-	drms[1] = drms[2];
-	if (iout >= 0) {
-	    drms[1] = (iout << 1) + lsb;
-	}
-	for (i__ = 1; i__ <= 4; ++i__) {
-	    if (i__ == 1) {
-		i1 = ((drc[25] & 7) << 1) + (drc[28] & 1);
-	    } else {
-		i1 = drc[(9 - i__) * 3 - 2] & 15;
-	    }
-	    i2 = drc[(5 - i__) * 3 - 2] & 31;
-	    lsb = i2 & 1;
-	    index = (i1 << 4) + i2 / 2;
-	    ham84_(&index, &iout, &errcnt);
-	    if (iout >= 0) {
-		iout = (iout << 1) + lsb;
-		if ((iout & 16) == 16) {
-		    iout += -32;
-		}
-	    } else {
-		iout = drc[(5 - i__) * 3 - 1];
-	    }
-	    drc[(5 - i__) * 3 - 2] = iout;
-	}
-/*  Determine error rate */
-	*erate = (integer)(*erate * .96875f + errcnt * 102);
-    }
-/*  Get unsmoothed RMS, RC's, and PITCH */
-    *irms = drms[1];
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	irc[i__] = drc[i__ * 3 - 2];
-    }
-    if (ipit == 1) {
-	dpit[1] = dpit[2];
-    }
-    if (ipit == 3) {
-	dpit[1] = dpit[0];
-    }
-    *pitch = dpit[1];
-/*  If bit 2 of ICORF is set then smooth RMS and RC's, */
-    if ((icorf & bit[1]) != 0) {
-	if ((i__1 = drms[1] - drms[0], (real) abs(i__1)) >= corth[ixcor + 3] 
-		&& (i__2 = drms[1] - drms[2], (real) abs(i__2)) >= corth[
-		ixcor + 3]) {
-	    *irms = median_(&drms[2], &drms[1], drms);
-	}
-	for (i__ = 1; i__ <= 6; ++i__) {
-	    if ((i__1 = drc[i__ * 3 - 2] - drc[i__ * 3 - 3], (real) abs(i__1))
-		     >= corth[ixcor + (i__ + (2 << 2)) - 5] && (i__2 = drc[i__ *
-		     3 - 2] - drc[i__ * 3 - 1], (real) abs(i__2)) >= corth[
-		    ixcor + (i__ + (2 << 2)) - 5]) {
-		irc[i__] = median_(&drc[i__ * 3 - 1], &drc[i__ * 3 - 2], &drc[
-			i__ * 3 - 3]);
-	    }
-	}
-    }
-/*  If bit 3 of ICORF is set then smooth pitch */
-    if ((icorf & bit[2]) != 0) {
-	if ((i__1 = dpit[1] - dpit[0], (real) abs(i__1)) >= corth[ixcor - 1] 
-		&& (i__2 = dpit[1] - dpit[2], (real) abs(i__2)) >= corth[
-		ixcor - 1]) {
-	    *pitch = median_(&dpit[2], &dpit[1], dpit);
-	}
-    }
-/*  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. */
-L500:
-    if ((icorf & bit[4]) != 0) {
-	i__1 = contrl_1.order;
-	for (i__ = 5; i__ <= i__1; ++i__) {
-	    irc[i__] = zrc[i__ - 1];
-	}
-    }
-/*  House keeping  - one frame delay */
-    *iovoic = ivoic;
-    *ivp2h = voice[2];
-    dpit[2] = dpit[1];
-    dpit[1] = dpit[0];
-    drms[2] = drms[1];
-    drms[1] = drms[0];
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	drc[i__ * 3 - 1] = drc[i__ * 3 - 2];
-	drc[i__ * 3 - 2] = drc[i__ * 3 - 3];
-    }
-L900:
-/* 	IF (LISTL.GE.3)WRITE(FDEBUG,801)VOICE,PITCH,IRMS,(IRC(J),J=1,ORDER) */
-/* 801	FORMAT(1X,'<<ERRCOR OUT>>',T32,2I3,I6,I5,T50,10I8) */
-/*   Decode RMS */
-    *irms = rmst[(31 - *irms) * 2];
-/*  Decode RC(1) and RC(2) from log-area-ratios */
-/*  Protect from illegal coded value (-16) caused by bit errors */
-    for (i__ = 1; i__ <= 2; ++i__) {
-	i2 = 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__ - 1];
-	irc[i__] = i2 * pow_ii(&c__2, &ishift);
-    }
-/*  Decode RC(3)-RC(10) to sign plus 14 bits */
-    i__1 = contrl_1.order;
-    for (i__ = 3; i__ <= i__1; ++i__) {
-	i2 = irc[i__];
-	ishift = 15 - nbit[i__ - 1];
-	i2 *= pow_ii(&c__2, &ishift);
-	i2 += qb[i__ - 3];
-	irc[i__] = (integer)(i2 * descl[i__ - 3] + deadd[i__ - 3]);
-    }
-/* 	IF (LISTL.GE.3) WRITE(FDEBUG,811) IRMS, (IRC(I),I=1,ORDER) */
-/* 811	FORMAT(1X,'<<DECODE OUT>>',T45,I4,1X,10I8) */
-/*  Scale RMS and RC's to reals */
-    *rms = (real) (*irms);
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	rc[i__] = irc[i__] / 16384.f;
-    }
-    return 0;
-} /* decode_ */
+/*
+
+$Log: decode_.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:22:39  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:38  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int decode_(integer *ipitv, integer *irms, integer *irc, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_decoder_state *st);
+/* comlen contrl_ 12 */
+/*:ref: ham84_ 14 3 4 4 4 */
+/*:ref: median_ 4 3 4 4 4 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* Table of constant values */
+
+static integer c__2 = 2;
+
+/* ***************************************************************** */
+
+/* 	DECODE Version 54 */
+
+/* $Log: decode_.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:22:39  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:38  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/05/23  20:06:03  jaf */
+/* Assigned PITCH a "default" value on the first call, since otherwise it */
+/* would be left uninitialized. */
+
+/* Revision 1.4  1996/03/26  19:35:18  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.3  1996/03/21  21:10:50  jaf */
+/* Added entry INITDECODE to reinitialize the local state of subroutine */
+/* DECODE. */
+
+/* Revision 1.2  1996/03/21  21:04:50  jaf */
+/* Determined which local variables should be saved from one invocation */
+/* to the next, and guessed initial values for some that should have been */
+/* saved, but weren't given initial values.  Many of the arrays are */
+/* "constants", and many local variables are only used if the "global" */
+/* variable CORRP is .TRUE. */
+
+/* Added comments explaining which indices of array arguments are read or */
+/* written. */
+
+/* Revision 1.1  1996/02/12 03:21:10  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*   This subroutine provides error correction and decoding */
+/*   for all LPC parameters */
+
+/* Input: */
+/*  IPITV  - Index value of pitch */
+/*  IRMS   - Coded Energy */
+/*  CORRP  - Error correction: */
+/*    If FALSE, parameters are decoded directly with no delay.  If TRUE, */
+/*    most important parameter bits are protected by Hamming code and */
+/*    median smoothed.  This requires an additional frame of delay. */
+/* Input/Output: */
+/*  IRC    - Coded Reflection Coefficients */
+/*           Indices 1 through ORDER always read, then written. */
+/* Output: */
+/*  VOICE  - Half frame voicing decisions */
+/*           Indices 1 through 2 written. */
+/*  PITCH  - Decoded pitch */
+/*  RMS    - Energy */
+/*  RC     - Reflection coefficients */
+/*           Indices 1 through ORDER written. */
+
+/*  NOTE: Zero RC's should be done more directly, but this would affect */
+/*   coded parameter printout. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITDECODE. */
+
+/* Subroutine */ int decode_(integer *ipitv, integer *irms, 
+	integer *irc, integer *voice, integer *pitch, real *rms, real *rc,
+			     struct lpc10_decoder_state *st)
+{
+    /* Initialized data */
+
+    logical *first;
+    static integer ethrs = 2048;
+    static integer ethrs1 = 128;
+    static integer ethrs2 = 1024;
+    static integer ethrs3 = 2048;
+    static integer 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 real corth[32]	/* was [4][8] */ = { 32767.f,10.f,5.f,0.f,
+	    32767.f,8.f,4.f,0.f,32.f,6.4f,3.2f,0.f,32.f,6.4f,3.2f,0.f,32.f,
+	    11.2f,6.4f,0.f,32.f,11.2f,6.4f,0.f,16.f,5.6f,3.2f,0.f,16.f,5.6f,
+	    3.2f,0.f };
+    static integer 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 integer 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 integer 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 real descl[8] = { .6953f,.625f,.5781f,.5469f,.5312f,.5391f,.4688f,
+	    .3828f };
+    integer *ivp2h;
+    static integer deadd[8] = { 1152,-2816,-1536,-3584,-1280,-2432,768,-1920 }
+	    ;
+    static integer qb[8] = { 511,511,1023,1023,1023,1023,2047,4095 };
+    static integer nbit[10] = { 8,8,5,5,4,4,4,4,3,2 };
+    static integer zrc[10] = { 0,0,0,0,0,3,0,2,0,0 };
+    static integer bit[5] = { 2,4,8,16,32 };
+    integer *iovoic;
+    integer *iavgp;
+    integer *iptold;
+    integer *erate;
+    integer *drc;
+    integer *dpit;
+    integer *drms;
+
+    /* System generated locals */
+    integer i__1, i__2;
+
+    /* Builtin functions */
+    integer pow_ii(integer *, integer *);
+
+    /* Local variables */
+    extern /* Subroutine */ int ham84_(integer *, integer *, integer *);
+    integer ipit, iout, i__, icorf, index, ivoic, ixcor, i1, i2, i4;
+    extern integer median_(integer *, integer *, integer *);
+    integer ishift, errcnt, lsb;
+
+/* $Log: decode_.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:22:39  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:38  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Arguments */
+/* $Log: decode_.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:22:39  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:38  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/*       Function return value definitions */
+
+/*       Parameters/constants */
+
+/*       The variables below that are not Fortran PARAMETER's are */
+/*       initialized with DATA statements, and then never modified. */
+/*       The following are used regardless of CORRP's value. */
+
+/*       DETAU, NBIT, QB, DEADD, DETAB7, RMST, DESCL */
+
+/*       The following are used only if CORRP is .TRUE. */
+
+/*       ETHRS, ETHRS1, ETHRS2, ETHRS3, IVTAB, BIT, CORTH, ZRC */
+
+/*       Local variables that need not be saved */
+
+/*       The following are used regardless of CORRP's value */
+/*       The following are used only if CORRP is .TRUE. */
+
+/*       Local state */
+
+/*       The following are used regardless of CORRP's value */
+/*       The following are used only if CORRP is .TRUE. */
+/*       I am guessing the initial values for IVP2H, IOVOIC, DRC, DPIT, */
+/*       and DRMS.  They should be checked to see if they are reasonable. 
+*/
+/*       I'm also guessing for ERATE, but I think 0 is the right initial 
+*/
+/*       value. */
+    /* Parameter adjustments */
+    if (irc) {
+	--irc;
+	}
+    if (voice) {
+	--voice;
+	}
+    if (rc) {
+	--rc;
+	}
+
+    /* Function Body */
+
+    iptold = &(st->iptold);
+    first = &(st->first);
+    ivp2h = &(st->ivp2h);
+    iovoic = &(st->iovoic);
+    iavgp = &(st->iavgp);
+    erate = &(st->erate);
+    drc = &(st->drc[0]);
+    dpit = &(st->dpit[0]);
+    drms = &(st->drms[0]);
+
+/* DATA statements for "constants" defined above. */
+/* 	IF (LISTL.GE.3) WRITE(FDEBUG,800) IPITV,IRMS,(IRC(J),J=1,ORDER) */
+/* 800	FORMAT(1X,' <<ERRCOR IN>>',T32,6X,I6,I5,T50,10I8) */
+/*  If no error correction, do pitch and voicing then jump to decode */
+    i4 = detau[*ipitv];
+    if (! contrl_1.corrp) {
+	voice[1] = 1;
+	voice[2] = 1;
+	if (*ipitv <= 1) {
+	    voice[1] = 0;
+	}
+	if (*ipitv == 0 || *ipitv == 2) {
+	    voice[2] = 0;
+	}
+	*pitch = i4;
+	if (*pitch <= 4) {
+	    *pitch = *iptold;
+	}
+	if (voice[1] == 1 && voice[2] == 1) {
+	    *iptold = *pitch;
+	}
+	if (voice[1] != voice[2]) {
+	    *pitch = *iptold;
+	}
+	goto L900;
+    }
+/*  Do error correction pitch and voicing */
+    if (i4 > 4) {
+	dpit[0] = i4;
+	ivoic = 2;
+	*iavgp = (*iavgp * 15 + i4 + 8) / 16;
+    } else {
+	ivoic = i4;
+	dpit[0] = *iavgp;
+    }
+    drms[0] = *irms;
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	drc[i__ * 3 - 3] = irc[i__];
+    }
+/*  Determine index to IVTAB from V/UV decision */
+/*  If error rate is high then use alternate table */
+    index = (*ivp2h << 4) + (*iovoic << 2) + ivoic + 1;
+    i1 = ivtab[index - 1];
+    ipit = i1 & 3;
+    icorf = i1 / 8;
+    if (*erate < ethrs) {
+	icorf /= 64;
+    }
+/*  Determine error rate:  4=high    1=low */
+    ixcor = 4;
+    if (*erate < ethrs3) {
+	ixcor = 3;
+    }
+    if (*erate < ethrs2) {
+	ixcor = 2;
+    }
+    if (*erate < ethrs1) {
+	ixcor = 1;
+    }
+/*  Voice/unvoice decision determined from bits 0 and 1 of IVTAB */
+    voice[1] = icorf / 2 & 1;
+    voice[2] = icorf & 1;
+/*  Skip decoding on first frame because present data not yet available */
+    if (*first) {
+	*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. */
+	*pitch = i4;
+	if (*pitch <= 4) {
+	    *pitch = *iptold;
+	}
+	goto L500;
+    }
+/*  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 or unvoiced frame.  If IOUT is negative, */
+/*    more than 1 error occurred, use previous frame's parameters. */
+    if ((icorf & bit[3]) != 0) {
+	errcnt = 0;
+	lsb = drms[1] & 1;
+	index = (drc[22] << 4) + drms[1] / 2;
+	ham84_(&index, &iout, &errcnt);
+	drms[1] = drms[2];
+	if (iout >= 0) {
+	    drms[1] = (iout << 1) + lsb;
+	}
+	for (i__ = 1; i__ <= 4; ++i__) {
+	    if (i__ == 1) {
+		i1 = ((drc[25] & 7) << 1) + (drc[28] & 1);
+	    } else {
+		i1 = drc[(9 - i__) * 3 - 2] & 15;
+	    }
+	    i2 = drc[(5 - i__) * 3 - 2] & 31;
+	    lsb = i2 & 1;
+	    index = (i1 << 4) + i2 / 2;
+	    ham84_(&index, &iout, &errcnt);
+	    if (iout >= 0) {
+		iout = (iout << 1) + lsb;
+		if ((iout & 16) == 16) {
+		    iout += -32;
+		}
+	    } else {
+		iout = drc[(5 - i__) * 3 - 1];
+	    }
+	    drc[(5 - i__) * 3 - 2] = iout;
+	}
+/*  Determine error rate */
+	*erate = (integer)(*erate * .96875f + errcnt * 102);
+    }
+/*  Get unsmoothed RMS, RC's, and PITCH */
+    *irms = drms[1];
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	irc[i__] = drc[i__ * 3 - 2];
+    }
+    if (ipit == 1) {
+	dpit[1] = dpit[2];
+    }
+    if (ipit == 3) {
+	dpit[1] = dpit[0];
+    }
+    *pitch = dpit[1];
+/*  If bit 2 of ICORF is set then smooth RMS and RC's, */
+    if ((icorf & bit[1]) != 0) {
+	if ((i__1 = drms[1] - drms[0], (real) abs(i__1)) >= corth[ixcor + 3] 
+		&& (i__2 = drms[1] - drms[2], (real) abs(i__2)) >= corth[
+		ixcor + 3]) {
+	    *irms = median_(&drms[2], &drms[1], drms);
+	}
+	for (i__ = 1; i__ <= 6; ++i__) {
+	    if ((i__1 = drc[i__ * 3 - 2] - drc[i__ * 3 - 3], (real) abs(i__1))
+		     >= corth[ixcor + (i__ + (2 << 2)) - 5] && (i__2 = drc[i__ *
+		     3 - 2] - drc[i__ * 3 - 1], (real) abs(i__2)) >= corth[
+		    ixcor + (i__ + (2 << 2)) - 5]) {
+		irc[i__] = median_(&drc[i__ * 3 - 1], &drc[i__ * 3 - 2], &drc[
+			i__ * 3 - 3]);
+	    }
+	}
+    }
+/*  If bit 3 of ICORF is set then smooth pitch */
+    if ((icorf & bit[2]) != 0) {
+	if ((i__1 = dpit[1] - dpit[0], (real) abs(i__1)) >= corth[ixcor - 1] 
+		&& (i__2 = dpit[1] - dpit[2], (real) abs(i__2)) >= corth[
+		ixcor - 1]) {
+	    *pitch = median_(&dpit[2], &dpit[1], dpit);
+	}
+    }
+/*  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. */
+L500:
+    if ((icorf & bit[4]) != 0) {
+	i__1 = contrl_1.order;
+	for (i__ = 5; i__ <= i__1; ++i__) {
+	    irc[i__] = zrc[i__ - 1];
+	}
+    }
+/*  House keeping  - one frame delay */
+    *iovoic = ivoic;
+    *ivp2h = voice[2];
+    dpit[2] = dpit[1];
+    dpit[1] = dpit[0];
+    drms[2] = drms[1];
+    drms[1] = drms[0];
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	drc[i__ * 3 - 1] = drc[i__ * 3 - 2];
+	drc[i__ * 3 - 2] = drc[i__ * 3 - 3];
+    }
+L900:
+/* 	IF (LISTL.GE.3)WRITE(FDEBUG,801)VOICE,PITCH,IRMS,(IRC(J),J=1,ORDER) */
+/* 801	FORMAT(1X,'<<ERRCOR OUT>>',T32,2I3,I6,I5,T50,10I8) */
+/*   Decode RMS */
+    *irms = rmst[(31 - *irms) * 2];
+/*  Decode RC(1) and RC(2) from log-area-ratios */
+/*  Protect from illegal coded value (-16) caused by bit errors */
+    for (i__ = 1; i__ <= 2; ++i__) {
+	i2 = 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__ - 1];
+	irc[i__] = i2 * pow_ii(&c__2, &ishift);
+    }
+/*  Decode RC(3)-RC(10) to sign plus 14 bits */
+    i__1 = contrl_1.order;
+    for (i__ = 3; i__ <= i__1; ++i__) {
+	i2 = irc[i__];
+	ishift = 15 - nbit[i__ - 1];
+	i2 *= pow_ii(&c__2, &ishift);
+	i2 += qb[i__ - 3];
+	irc[i__] = (integer)(i2 * descl[i__ - 3] + deadd[i__ - 3]);
+    }
+/* 	IF (LISTL.GE.3) WRITE(FDEBUG,811) IRMS, (IRC(I),I=1,ORDER) */
+/* 811	FORMAT(1X,'<<DECODE OUT>>',T45,I4,1X,10I8) */
+/*  Scale RMS and RC's to reals */
+    *rms = (real) (*irms);
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	rc[i__] = irc[i__] / 16384.f;
+    }
+    return 0;
+} /* decode_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/deemp.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/deemp.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/deemp.c	Fri Sep 21 14:49:14 2007
@@ -1,143 +1,143 @@
-/*
-
-$Log: deemp.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:23:46  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:34  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ***************************************************************** */
-
-/* 	DEEMP Version 48 */
-
-/* $Log: deemp.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:23:46  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:34  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/20  15:54:37  jaf */
-/* Added comments about which indices of array arguments are read or */
-/* written. */
-
-/* Added entry INITDEEMP to reinitialize the local state variables, if */
-/* desired. */
-
-/* Revision 1.2  1996/03/14  22:11:13  jaf */
-/* Comments added explaining which of the local variables of this */
-/* subroutine need to be saved from one invocation to the next, and which */
-/* do not. */
-
-/* Revision 1.1  1996/02/07 14:44:53  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*  De-Emphasize output speech with   1 / ( 1 - .75z**-1 ) */
-/*    cascaded with 200 Hz high pass filter */
-/*    ( 1 - 1.9998z**-1 + z**-2 ) / ( 1 - 1.75z**-1 + .78z**-2 ) */
-
-/*  WARNING!  The coefficients above may be out of date with the code */
-/*  below.  Either that, or some kind of transformation was performed */
-/*  on the coefficients above to create the code below. */
-
-/* Input: */
-/*  N  - Number of samples */
-/* Input/Output: */
-/*  X  - Speech */
-/*       Indices 1 through N are read before being written. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITDEEMP. */
-
-/* Subroutine */ int deemp_(real *x, integer *n, struct lpc10_decoder_state *st)
-{
-    /* Initialized data */
-
-    real *dei1;
-    real *dei2;
-    real *deo1;
-    real *deo2;
-    real *deo3;
-
-    /* System generated locals */
-    integer i__1;
-    real r__1;
-
-    /* Local variables */
-    integer k;
-    real dei0;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       All of the locals saved below were not given explicit initial */
-/*       values in the original code.  I think 0 is a safe choice. */
-    /* Parameter adjustments */
-    if (x) {
-	--x;
-	}
-
-    /* Function Body */
-
-    dei1 = &(st->dei1);
-    dei2 = &(st->dei2);
-    deo1 = &(st->deo1);
-    deo2 = &(st->deo2);
-    deo3 = &(st->deo3);
-
-    i__1 = *n;
-    for (k = 1; k <= i__1; ++k) {
-	dei0 = x[k];
-	r__1 = x[k] - *dei1 * 1.9998f + *dei2;
-	x[k] = r__1 + *deo1 * 2.5f - *deo2 * 2.0925f + *deo3 * .585f;
-	*dei2 = *dei1;
-	*dei1 = dei0;
-	*deo3 = *deo2;
-	*deo2 = *deo1;
-	*deo1 = x[k];
-    }
-    return 0;
-} /* deemp_ */
+/*
+
+$Log: deemp.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:23:46  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:34  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ***************************************************************** */
+
+/* 	DEEMP Version 48 */
+
+/* $Log: deemp.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:23:46  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:34  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/20  15:54:37  jaf */
+/* Added comments about which indices of array arguments are read or */
+/* written. */
+
+/* Added entry INITDEEMP to reinitialize the local state variables, if */
+/* desired. */
+
+/* Revision 1.2  1996/03/14  22:11:13  jaf */
+/* Comments added explaining which of the local variables of this */
+/* subroutine need to be saved from one invocation to the next, and which */
+/* do not. */
+
+/* Revision 1.1  1996/02/07 14:44:53  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*  De-Emphasize output speech with   1 / ( 1 - .75z**-1 ) */
+/*    cascaded with 200 Hz high pass filter */
+/*    ( 1 - 1.9998z**-1 + z**-2 ) / ( 1 - 1.75z**-1 + .78z**-2 ) */
+
+/*  WARNING!  The coefficients above may be out of date with the code */
+/*  below.  Either that, or some kind of transformation was performed */
+/*  on the coefficients above to create the code below. */
+
+/* Input: */
+/*  N  - Number of samples */
+/* Input/Output: */
+/*  X  - Speech */
+/*       Indices 1 through N are read before being written. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITDEEMP. */
+
+/* Subroutine */ int deemp_(real *x, integer *n, struct lpc10_decoder_state *st)
+{
+    /* Initialized data */
+
+    real *dei1;
+    real *dei2;
+    real *deo1;
+    real *deo2;
+    real *deo3;
+
+    /* System generated locals */
+    integer i__1;
+    real r__1;
+
+    /* Local variables */
+    integer k;
+    real dei0;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       All of the locals saved below were not given explicit initial */
+/*       values in the original code.  I think 0 is a safe choice. */
+    /* Parameter adjustments */
+    if (x) {
+	--x;
+	}
+
+    /* Function Body */
+
+    dei1 = &(st->dei1);
+    dei2 = &(st->dei2);
+    deo1 = &(st->deo1);
+    deo2 = &(st->deo2);
+    deo3 = &(st->deo3);
+
+    i__1 = *n;
+    for (k = 1; k <= i__1; ++k) {
+	dei0 = x[k];
+	r__1 = x[k] - *dei1 * 1.9998f + *dei2;
+	x[k] = r__1 + *deo1 * 2.5f - *deo2 * 2.0925f + *deo3 * .585f;
+	*dei2 = *dei1;
+	*dei1 = dei0;
+	*deo3 = *deo2;
+	*deo2 = *deo1;
+	*deo1 = x[k];
+    }
+    return 0;
+} /* deemp_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/difmag.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/difmag.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/difmag.c	Fri Sep 21 14:49:14 2007
@@ -1,122 +1,122 @@
-/*
-
-$Log: difmag.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:32:31  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *maxptr);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************** */
-
-/* 	DIFMAG Version 49 */
-
-/* $Log: difmag.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:31  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/15  23:09:39  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  14:41:31  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:45:04  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*  Compute Average Magnitude Difference Function */
-
-/* Inputs: */
-/*  SPEECH - Low pass filtered speech */
-/*           Indices MIN_N1 through MAX_N1+LPITA-1 are read, where */
-/*      MIN_N1 = (MAXLAG - MAX_TAU)/2+1  MAX_TAU = max of TAU(I) for I=1,LTAU
-*/
-/*      MAX_N1 = (MAXLAG - MIN_TAU)/2+1  MIN_TAU = min of TAU(I) for I=1,LTAU
-*/
-/*  LPITA  - Length of speech buffer */
-/*  TAU    - Table of lags */
-/*           Indices 1 through LTAU read. */
-/*  LTAU   - Number of lag values to compute */
-/*  MAXLAG - Maximum possible lag value */
-/* Outputs: */
-/*  (All of these outputs are also read, but only after being written.) */
-/*  AMDF   - Average Magnitude Difference for each lag in TAU */
-/*           Indices 1 through LTAU written */
-/*  MINPTR - Index of minimum AMDF value */
-/*  MAXPTR - Index of maximum AMDF value */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int difmag_(real *speech, integer *lpita, integer *tau, 
-	integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *
-	maxptr)
-{
-    /* System generated locals */
-    integer i__1, i__2;
-    real r__1;
-
-    /* Local variables */
-    integer i__, j, n1, n2;
-    real sum;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       None */
-    /* Parameter adjustments */
-    --amdf;
-    --tau;
-    --speech;
-
-    /* Function Body */
-    *minptr = 1;
-    *maxptr = 1;
-    i__1 = *ltau;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	n1 = (*maxlag - tau[i__]) / 2 + 1;
-	n2 = n1 + *lpita - 1;
-	sum = 0.f;
-	i__2 = n2;
-	for (j = n1; j <= i__2; j += 4) {
-	    sum += (r__1 = speech[j] - speech[j + tau[i__]], abs(r__1));
-	}
-	amdf[i__] = sum;
-	if (amdf[i__] < amdf[*minptr]) {
-	    *minptr = i__;
-	}
-	if (amdf[i__] > amdf[*maxptr]) {
-	    *maxptr = i__;
-	}
-    }
-    return 0;
-} /* difmag_ */
-
+/*
+
+$Log: difmag.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:32:31  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *maxptr);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************** */
+
+/* 	DIFMAG Version 49 */
+
+/* $Log: difmag.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:31  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/15  23:09:39  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  14:41:31  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:45:04  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*  Compute Average Magnitude Difference Function */
+
+/* Inputs: */
+/*  SPEECH - Low pass filtered speech */
+/*           Indices MIN_N1 through MAX_N1+LPITA-1 are read, where */
+/*      MIN_N1 = (MAXLAG - MAX_TAU)/2+1  MAX_TAU = max of TAU(I) for I=1,LTAU
+*/
+/*      MAX_N1 = (MAXLAG - MIN_TAU)/2+1  MIN_TAU = min of TAU(I) for I=1,LTAU
+*/
+/*  LPITA  - Length of speech buffer */
+/*  TAU    - Table of lags */
+/*           Indices 1 through LTAU read. */
+/*  LTAU   - Number of lag values to compute */
+/*  MAXLAG - Maximum possible lag value */
+/* Outputs: */
+/*  (All of these outputs are also read, but only after being written.) */
+/*  AMDF   - Average Magnitude Difference for each lag in TAU */
+/*           Indices 1 through LTAU written */
+/*  MINPTR - Index of minimum AMDF value */
+/*  MAXPTR - Index of maximum AMDF value */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int difmag_(real *speech, integer *lpita, integer *tau, 
+	integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *
+	maxptr)
+{
+    /* System generated locals */
+    integer i__1, i__2;
+    real r__1;
+
+    /* Local variables */
+    integer i__, j, n1, n2;
+    real sum;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       None */
+    /* Parameter adjustments */
+    --amdf;
+    --tau;
+    --speech;
+
+    /* Function Body */
+    *minptr = 1;
+    *maxptr = 1;
+    i__1 = *ltau;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	n1 = (*maxlag - tau[i__]) / 2 + 1;
+	n2 = n1 + *lpita - 1;
+	sum = 0.f;
+	i__2 = n2;
+	for (j = n1; j <= i__2; j += 4) {
+	    sum += (r__1 = speech[j] - speech[j + tau[i__]], abs(r__1));
+	}
+	amdf[i__] = sum;
+	if (amdf[i__] < amdf[*minptr]) {
+	    *minptr = i__;
+	}
+	if (amdf[i__] > amdf[*maxptr]) {
+	    *maxptr = i__;
+	}
+    }
+    return 0;
+} /* difmag_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/dyptrk.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/dyptrk.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/dyptrk.c	Fri Sep 21 14:49:14 2007
@@ -1,389 +1,389 @@
-/*
-
-$Log: dyptrk.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:25:29  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:26  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int dyptrk_(real *amdf, integer *ltau, integer *minptr, integer *voice, integer *pitch, integer *midx, struct lpc10_encoder_state *st);
-/* comlen contrl_ 12 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* ********************************************************************* */
-
-/* 	DYPTRK Version 52 */
-
-/* $Log: dyptrk.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:25:29  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:26  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/03/26  19:35:35  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.4  1996/03/19  18:03:22  jaf */
-/* Replaced the initialization "DATA P/60*DEPTH*0/" with "DATA P/120*0/", */
-/* because apparently Fortran (or at least f2c) can't handle expressions */
-/* like that. */
-
-/* Revision 1.3  1996/03/19  17:38:32  jaf */
-/* Added comments about the local variables that should be saved from one */
-/* invocation to the next.  None of them were given initial values in the */
-/* original code, but from my testing, it appears that initializing them */
-/* all to 0 works. */
-
-/* Added entry INITDYPTRK to reinitialize these local variables. */
-
-/* Revision 1.2  1996/03/13  16:32:17  jaf */
-/* Comments added explaining which of the local variables of this */
-/* subroutine need to be saved from one invocation to the next, and which */
-/* do not. */
-
-/* WARNING!  Some of them that should are never given initial values in */
-/* this code.  Hopefully, Fortran 77 defines initial values for them, but */
-/* even so, giving them explicit initial values is preferable. */
-
-/* Revision 1.1  1996/02/07 14:45:14  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*   Dynamic Pitch Tracker */
-
-/* Input: */
-/*  AMDF   - Average Magnitude Difference Function array */
-/*           Indices 1 through LTAU read, and MINPTR */
-/*  LTAU   - Number of lags in AMDF */
-/*  MINPTR - Location of minimum AMDF value */
-/*  VOICE  - Voicing decision */
-/* Output: */
-/*  PITCH  - Smoothed pitch value, 2 frames delayed */
-/*  MIDX   - Initial estimate of current frame pitch */
-/* Compile time constant: */
-/*  DEPTH  - Number of frames to trace back */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITDYPTRK. */
-
-/* Subroutine */ int dyptrk_(real *amdf, integer *ltau, integer *
-	minptr, integer *voice, integer *pitch, integer *midx,
-			       struct lpc10_encoder_state *st)
-{
-    /* Initialized data */
-
-    real *s;
-    integer *p;
-    integer *ipoint;
-    real *alphax;
-
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    integer pbar;
-    real sbar;
-    integer path[2], iptr, i__, j;
-    real alpha, minsc, maxsc;
-
-/*       Arguments */
-/* $Log: dyptrk.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:25:29  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:26  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	Parameters/constants */
-/*       Local variables that need not be saved */
-/*       Note that PATH is only used for debugging purposes, and can be */
-/*       removed. */
-/*       Local state */
-/*       It would be a bit more "general" to define S(LTAU), if Fortran */
-/*       allows the argument of a function to be used as the dimension of 
-*/
-/*       a local array variable. */
-/*       IPOINT is always in the range 0 to DEPTH-1. */
-/*       WARNING! */
-
-/*       In the original version of this subroutine, IPOINT, ALPHAX, */
-/*       every element of S, and potentially any element of P with the */
-/*       second index value .NE. IPTR were read without being given */
-/*       initial values (all indices of P with second index equal to */
-/*       IPTR are all written before being read in this subroutine). */
-
-/*       From examining the code carefully, it appears that all of these 
-*/
-/*       should be saved from one invocation to the next. */
-
-/*       I've run lpcsim with the "-l 6" option to see all of the */
-/*       debugging information that is printed out by this subroutine */
-/*       below, and it appears that S, P, IPOINT, and ALPHAX are all */
-/*       initialized to 0 (these initial values would likely be different 
-*/
-/*       on different platforms, compilers, etc.).  Given that the output 
-*/
-/*       of the coder sounds reasonable, I'm going to initialize these */
-/*       variables to 0 explicitly. */
-
-    s = &(st->s[0]);
-    p = &(st->p[0]);
-    ipoint = &(st->ipoint);
-    alphax = &(st->alphax);
-
-
-    /* Parameter adjustments */
-    if (amdf) {
-	--amdf;
-	}
-
-    /* Function Body */
-
-/*   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) {
-	*alphax = *alphax * .75f + amdf[*minptr] / 2.f;
-    } else {
-	*alphax *= .984375f;
-    }
-    alpha = *alphax / 16;
-    if (*voice == 0 && *alphax < 128.f) {
-	alpha = 8.f;
-    }
-/* SEESAW: Construct a pitch pointer array and intermediate winner functio
-n*/
-/*   Left to right pass: */
-    iptr = *ipoint + 1;
-    p[iptr * 60 - 60] = 1;
-    i__ = 1;
-    pbar = 1;
-    sbar = s[0];
-    i__1 = *ltau;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	sbar += alpha;
-	if (sbar < s[i__ - 1]) {
-	    s[i__ - 1] = sbar;
-	    p[i__ + iptr * 60 - 61] = pbar;
-	} else {
-	    sbar = s[i__ - 1];
-	    p[i__ + iptr * 60 - 61] = i__;
-	    pbar = i__;
-	}
-    }
-/*   Right to left pass: */
-    i__ = pbar - 1;
-    sbar = s[i__];
-    while(i__ >= 1) {
-	sbar += alpha;
-	if (sbar < s[i__ - 1]) {
-	    s[i__ - 1] = sbar;
-	    p[i__ + iptr * 60 - 61] = pbar;
-	} else {
-	    pbar = p[i__ + iptr * 60 - 61];
-	    i__ = pbar;
-	    sbar = s[i__ - 1];
-	}
-	--i__;
-    }
-/*   Update S using AMDF */
-/*   Find maximum, minimum, and location of minimum */
-    s[0] += amdf[1] / 2;
-    minsc = s[0];
-    maxsc = minsc;
-    *midx = 1;
-    i__1 = *ltau;
-    for (i__ = 2; i__ <= i__1; ++i__) {
-	s[i__ - 1] += amdf[i__] / 2;
-	if (s[i__ - 1] > maxsc) {
-	    maxsc = s[i__ - 1];
-	}
-	if (s[i__ - 1] < minsc) {
-	    *midx = i__;
-	    minsc = s[i__ - 1];
-	}
-    }
-/*   Subtract MINSC from S to prevent overflow */
-    i__1 = *ltau;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	s[i__ - 1] -= 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[*midx - i__ - 1] < maxsc / 4) {
-		j = i__;
-	    }
-	}
-    }
-    *midx -= j;
-/*   TRACE: look back two frames to find minimum cost pitch estimate */
-    j = *ipoint;
-    *pitch = *midx;
-    for (i__ = 1; i__ <= 2; ++i__) {
-	j = j % 2 + 1;
-	*pitch = p[*pitch + j * 60 - 61];
-	path[i__ - 1] = *pitch;
-    }
-
-/*       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. */
-
-    *ipoint = (*ipoint + 1) % 2;
-    return 0;
-} /* dyptrk_ */
+/*
+
+$Log: dyptrk.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:25:29  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:26  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int dyptrk_(real *amdf, integer *ltau, integer *minptr, integer *voice, integer *pitch, integer *midx, struct lpc10_encoder_state *st);
+/* comlen contrl_ 12 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* ********************************************************************* */
+
+/* 	DYPTRK Version 52 */
+
+/* $Log: dyptrk.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:25:29  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:26  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/03/26  19:35:35  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.4  1996/03/19  18:03:22  jaf */
+/* Replaced the initialization "DATA P/60*DEPTH*0/" with "DATA P/120*0/", */
+/* because apparently Fortran (or at least f2c) can't handle expressions */
+/* like that. */
+
+/* Revision 1.3  1996/03/19  17:38:32  jaf */
+/* Added comments about the local variables that should be saved from one */
+/* invocation to the next.  None of them were given initial values in the */
+/* original code, but from my testing, it appears that initializing them */
+/* all to 0 works. */
+
+/* Added entry INITDYPTRK to reinitialize these local variables. */
+
+/* Revision 1.2  1996/03/13  16:32:17  jaf */
+/* Comments added explaining which of the local variables of this */
+/* subroutine need to be saved from one invocation to the next, and which */
+/* do not. */
+
+/* WARNING!  Some of them that should are never given initial values in */
+/* this code.  Hopefully, Fortran 77 defines initial values for them, but */
+/* even so, giving them explicit initial values is preferable. */
+
+/* Revision 1.1  1996/02/07 14:45:14  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*   Dynamic Pitch Tracker */
+
+/* Input: */
+/*  AMDF   - Average Magnitude Difference Function array */
+/*           Indices 1 through LTAU read, and MINPTR */
+/*  LTAU   - Number of lags in AMDF */
+/*  MINPTR - Location of minimum AMDF value */
+/*  VOICE  - Voicing decision */
+/* Output: */
+/*  PITCH  - Smoothed pitch value, 2 frames delayed */
+/*  MIDX   - Initial estimate of current frame pitch */
+/* Compile time constant: */
+/*  DEPTH  - Number of frames to trace back */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITDYPTRK. */
+
+/* Subroutine */ int dyptrk_(real *amdf, integer *ltau, integer *
+	minptr, integer *voice, integer *pitch, integer *midx,
+			       struct lpc10_encoder_state *st)
+{
+    /* Initialized data */
+
+    real *s;
+    integer *p;
+    integer *ipoint;
+    real *alphax;
+
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    integer pbar;
+    real sbar;
+    integer path[2], iptr, i__, j;
+    real alpha, minsc, maxsc;
+
+/*       Arguments */
+/* $Log: dyptrk.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:25:29  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:26  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	Parameters/constants */
+/*       Local variables that need not be saved */
+/*       Note that PATH is only used for debugging purposes, and can be */
+/*       removed. */
+/*       Local state */
+/*       It would be a bit more "general" to define S(LTAU), if Fortran */
+/*       allows the argument of a function to be used as the dimension of 
+*/
+/*       a local array variable. */
+/*       IPOINT is always in the range 0 to DEPTH-1. */
+/*       WARNING! */
+
+/*       In the original version of this subroutine, IPOINT, ALPHAX, */
+/*       every element of S, and potentially any element of P with the */
+/*       second index value .NE. IPTR were read without being given */
+/*       initial values (all indices of P with second index equal to */
+/*       IPTR are all written before being read in this subroutine). */
+
+/*       From examining the code carefully, it appears that all of these 
+*/
+/*       should be saved from one invocation to the next. */
+
+/*       I've run lpcsim with the "-l 6" option to see all of the */
+/*       debugging information that is printed out by this subroutine */
+/*       below, and it appears that S, P, IPOINT, and ALPHAX are all */
+/*       initialized to 0 (these initial values would likely be different 
+*/
+/*       on different platforms, compilers, etc.).  Given that the output 
+*/
+/*       of the coder sounds reasonable, I'm going to initialize these */
+/*       variables to 0 explicitly. */
+
+    s = &(st->s[0]);
+    p = &(st->p[0]);
+    ipoint = &(st->ipoint);
+    alphax = &(st->alphax);
+
+
+    /* Parameter adjustments */
+    if (amdf) {
+	--amdf;
+	}
+
+    /* Function Body */
+
+/*   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) {
+	*alphax = *alphax * .75f + amdf[*minptr] / 2.f;
+    } else {
+	*alphax *= .984375f;
+    }
+    alpha = *alphax / 16;
+    if (*voice == 0 && *alphax < 128.f) {
+	alpha = 8.f;
+    }
+/* SEESAW: Construct a pitch pointer array and intermediate winner functio
+n*/
+/*   Left to right pass: */
+    iptr = *ipoint + 1;
+    p[iptr * 60 - 60] = 1;
+    i__ = 1;
+    pbar = 1;
+    sbar = s[0];
+    i__1 = *ltau;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	sbar += alpha;
+	if (sbar < s[i__ - 1]) {
+	    s[i__ - 1] = sbar;
+	    p[i__ + iptr * 60 - 61] = pbar;
+	} else {
+	    sbar = s[i__ - 1];
+	    p[i__ + iptr * 60 - 61] = i__;
+	    pbar = i__;
+	}
+    }
+/*   Right to left pass: */
+    i__ = pbar - 1;
+    sbar = s[i__];
+    while(i__ >= 1) {
+	sbar += alpha;
+	if (sbar < s[i__ - 1]) {
+	    s[i__ - 1] = sbar;
+	    p[i__ + iptr * 60 - 61] = pbar;
+	} else {
+	    pbar = p[i__ + iptr * 60 - 61];
+	    i__ = pbar;
+	    sbar = s[i__ - 1];
+	}
+	--i__;
+    }
+/*   Update S using AMDF */
+/*   Find maximum, minimum, and location of minimum */
+    s[0] += amdf[1] / 2;
+    minsc = s[0];
+    maxsc = minsc;
+    *midx = 1;
+    i__1 = *ltau;
+    for (i__ = 2; i__ <= i__1; ++i__) {
+	s[i__ - 1] += amdf[i__] / 2;
+	if (s[i__ - 1] > maxsc) {
+	    maxsc = s[i__ - 1];
+	}
+	if (s[i__ - 1] < minsc) {
+	    *midx = i__;
+	    minsc = s[i__ - 1];
+	}
+    }
+/*   Subtract MINSC from S to prevent overflow */
+    i__1 = *ltau;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	s[i__ - 1] -= 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[*midx - i__ - 1] < maxsc / 4) {
+		j = i__;
+	    }
+	}
+    }
+    *midx -= j;
+/*   TRACE: look back two frames to find minimum cost pitch estimate */
+    j = *ipoint;
+    *pitch = *midx;
+    for (i__ = 1; i__ <= 2; ++i__) {
+	j = j % 2 + 1;
+	*pitch = p[*pitch + j * 60 - 61];
+	path[i__ - 1] = *pitch;
+    }
+
+/*       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. */
+
+    *ipoint = (*ipoint + 1) % 2;
+    return 0;
+} /* dyptrk_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/encode.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/encode.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/encode.c	Fri Sep 21 14:49:14 2007
@@ -1,364 +1,364 @@
-/*
-
-$Log: encode_.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:32:21  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int encode_(integer *voice, integer *pitch, real *rms, real *rc, integer *ipitch, integer *irms, integer *irc);
-/* comlen contrl_ 12 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* Table of constant values */
-
-static integer c__2 = 2;
-
-/* ***************************************************************** */
-
-/* 	ENCODE Version 54 */
-
-/* $Log: encode_.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:21  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/03/26  19:35:50  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.4  1996/03/21  00:26:29  jaf */
-/* Added the comment that this subroutine has no local state. */
-
-/* In the last check-in, I forgot to mention that I had added comments */
-/* explaining which indices of array arguments are read or written. */
-
-/* Revision 1.3  1996/03/21  00:22:39  jaf */
-/* Added comments explaining that all local arrays are effectively */
-/* constants. */
-
-/* Revision 1.2  1996/03/13  18:48:33  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:45:29  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*  Quantize LPC parameters for transmission */
-
-/* INPUTS: */
-/*  VOICE  - Half frame voicing decisions */
-/*           Indices 1 through 2 read. */
-/*  PITCH  - Pitch */
-/*  RMS    - Energy */
-/*  RC     - Reflection coefficients */
-/*           Indices 1 through ORDER read. */
-/*  CORRP  - Error Correction: TRUE = yes, FALSE = none */
-/*           (this is defined in file control.fh) */
-/* OUTPUTS: */
-/*  IPITCH - Coded pitch and voicing */
-/*  IRMS   - Quantized energy */
-/*  IRC    - Quantized reflection coefficients */
-/*           Indices 1 through MAX(ORDER,2) written. */
-/*           If CORRP is .TRUE., then indices 1 through 10 written */
-/*           for unvoiced frames. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int encode_(integer *voice, integer *pitch, real *rms, real *
-	rc, integer *ipitch, integer *irms, integer *irc)
-{
-    /* Initialized data */
-
-    static integer enctab[16] = { 0,7,11,12,13,10,6,1,14,9,5,2,3,4,8,15 };
-    static integer 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 integer enadd[8] = { 1920,-768,2432,1280,3584,1536,2816,-1152 };
-    static real enscl[8] = { .0204f,.0167f,.0145f,.0147f,.0143f,.0135f,.0125f,
-	    .0112f };
-    static integer enbits[8] = { 6,5,4,4,4,4,3,3 };
-    static integer 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 integer 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 };
-
-    /* System generated locals */
-    integer i__1, i__2;
-
-    /* Builtin functions */
-    integer pow_ii(integer *, integer *);
-
-    /* Local variables */
-    integer idel, nbit, i__, j, i2, i3, mrk;
-
-/* $Log: encode_.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:21  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Arguments */
-/* $Log: encode_.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:21  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/*       Parameters/constants */
-/*       These arrays are not Fortran PARAMETER's, but they are defined */
-/*       by DATA statements below, and their contents are never altered. 
-*/
-/*       Local variables that need not be saved */
-    /* Parameter adjustments */
-    --irc;
-    --rc;
-    --voice;
-
-    /* Function Body */
-/*  Scale RMS and RC's to integers */
-    *irms = (integer)*rms;
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	irc[i__] = (integer)(rc[i__] * 32768.f);
-    }
-/* 	IF(LISTL.GE.3)WRITE(FDEBUG,800)VOICE,PITCH,IRMS,(IRC(I),I=1,ORDER) */
-/* 800	FORMAT(1X,/,' <<ENCODE IN>>',T32,2I3,I6,I5,T50,10I8) */
-/*  Encode pitch and voicing */
-    if (voice[1] != 0 && voice[2] != 0) {
-	*ipitch = entau[*pitch - 1];
-    } else {
-	if (contrl_1.corrp) {
-	    *ipitch = 0;
-	    if (voice[1] != voice[2]) {
-		*ipitch = 127;
-	    }
-	} else {
-	    *ipitch = (voice[1] << 1) + voice[2];
-	}
-    }
-/*  Encode RMS by binary table search */
-    j = 32;
-    idel = 16;
-    *irms = min(*irms,1023);
-    while(idel > 0) {
-	if (*irms > rmst[j - 1]) {
-	    j -= idel;
-	}
-	if (*irms < rmst[j - 1]) {
-	    j += idel;
-	}
-	idel /= 2;
-    }
-    if (*irms > rmst[j - 1]) {
-	--j;
-    }
-    *irms = 31 - j / 2;
-/*  Encode RC(1) and (2) as log-area-ratios */
-    for (i__ = 1; i__ <= 2; ++i__) {
-	i2 = irc[i__];
-	mrk = 0;
-	if (i2 < 0) {
-	    i2 = -i2;
-	    mrk = 1;
-	}
-	i2 /= 512;
-	i2 = min(i2,63);
-	i2 = entab6[i2];
-	if (mrk != 0) {
-	    i2 = -i2;
-	}
-	irc[i__] = i2;
-    }
-/*  Encode RC(3) - (10) linearly, remove bias then scale */
-    i__1 = contrl_1.order;
-    for (i__ = 3; i__ <= i__1; ++i__) {
-	i2 = irc[i__] / 2;
-	i2 = (integer)((i2 + enadd[contrl_1.order + 1 - i__ - 1]) * enscl[
-		contrl_1.order + 1 - i__ - 1]);
-/* Computing MIN */
-	i__2 = max(i2,-127);
-	i2 = min(i__2,127);
-	nbit = enbits[contrl_1.order + 1 - i__ - 1];
-	i3 = 0;
-	if (i2 < 0) {
-	    i3 = -1;
-	}
-	i2 /= pow_ii(&c__2, &nbit);
-	if (i3 == -1) {
-	    --i2;
-	}
-	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 (contrl_1.corrp) {
-	if (*ipitch == 0 || *ipitch == 127) {
-	    irc[5] = enctab[(irc[1] & 30) / 2];
-	    irc[6] = enctab[(irc[2] & 30) / 2];
-	    irc[7] = enctab[(irc[3] & 30) / 2];
-	    irc[8] = enctab[(*irms & 30) / 2];
-	    irc[9] = enctab[(irc[4] & 30) / 2] / 2;
-	    irc[10] = enctab[(irc[4] & 30) / 2] & 1;
-	}
-    }
-/* 	IF(LISTL.GE.3)WRITE(FDEBUG,801)VOICE,IPITCH,IRMS,(IRC(J),J=1,ORDER) */
-/* 801	FORMAT(1X,'<<ENCODE OUT>>',T32,2I3,I6,I5,T50,10I8) */
-    return 0;
-} /* encode_ */
-
+/*
+
+$Log: encode_.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:32:21  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int encode_(integer *voice, integer *pitch, real *rms, real *rc, integer *ipitch, integer *irms, integer *irc);
+/* comlen contrl_ 12 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* Table of constant values */
+
+static integer c__2 = 2;
+
+/* ***************************************************************** */
+
+/* 	ENCODE Version 54 */
+
+/* $Log: encode_.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:21  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/03/26  19:35:50  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.4  1996/03/21  00:26:29  jaf */
+/* Added the comment that this subroutine has no local state. */
+
+/* In the last check-in, I forgot to mention that I had added comments */
+/* explaining which indices of array arguments are read or written. */
+
+/* Revision 1.3  1996/03/21  00:22:39  jaf */
+/* Added comments explaining that all local arrays are effectively */
+/* constants. */
+
+/* Revision 1.2  1996/03/13  18:48:33  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:45:29  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*  Quantize LPC parameters for transmission */
+
+/* INPUTS: */
+/*  VOICE  - Half frame voicing decisions */
+/*           Indices 1 through 2 read. */
+/*  PITCH  - Pitch */
+/*  RMS    - Energy */
+/*  RC     - Reflection coefficients */
+/*           Indices 1 through ORDER read. */
+/*  CORRP  - Error Correction: TRUE = yes, FALSE = none */
+/*           (this is defined in file control.fh) */
+/* OUTPUTS: */
+/*  IPITCH - Coded pitch and voicing */
+/*  IRMS   - Quantized energy */
+/*  IRC    - Quantized reflection coefficients */
+/*           Indices 1 through MAX(ORDER,2) written. */
+/*           If CORRP is .TRUE., then indices 1 through 10 written */
+/*           for unvoiced frames. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int encode_(integer *voice, integer *pitch, real *rms, real *
+	rc, integer *ipitch, integer *irms, integer *irc)
+{
+    /* Initialized data */
+
+    static integer enctab[16] = { 0,7,11,12,13,10,6,1,14,9,5,2,3,4,8,15 };
+    static integer 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 integer enadd[8] = { 1920,-768,2432,1280,3584,1536,2816,-1152 };
+    static real enscl[8] = { .0204f,.0167f,.0145f,.0147f,.0143f,.0135f,.0125f,
+	    .0112f };
+    static integer enbits[8] = { 6,5,4,4,4,4,3,3 };
+    static integer 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 integer 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 };
+
+    /* System generated locals */
+    integer i__1, i__2;
+
+    /* Builtin functions */
+    integer pow_ii(integer *, integer *);
+
+    /* Local variables */
+    integer idel, nbit, i__, j, i2, i3, mrk;
+
+/* $Log: encode_.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:21  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Arguments */
+/* $Log: encode_.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:21  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/*       Parameters/constants */
+/*       These arrays are not Fortran PARAMETER's, but they are defined */
+/*       by DATA statements below, and their contents are never altered. 
+*/
+/*       Local variables that need not be saved */
+    /* Parameter adjustments */
+    --irc;
+    --rc;
+    --voice;
+
+    /* Function Body */
+/*  Scale RMS and RC's to integers */
+    *irms = (integer)*rms;
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	irc[i__] = (integer)(rc[i__] * 32768.f);
+    }
+/* 	IF(LISTL.GE.3)WRITE(FDEBUG,800)VOICE,PITCH,IRMS,(IRC(I),I=1,ORDER) */
+/* 800	FORMAT(1X,/,' <<ENCODE IN>>',T32,2I3,I6,I5,T50,10I8) */
+/*  Encode pitch and voicing */
+    if (voice[1] != 0 && voice[2] != 0) {
+	*ipitch = entau[*pitch - 1];
+    } else {
+	if (contrl_1.corrp) {
+	    *ipitch = 0;
+	    if (voice[1] != voice[2]) {
+		*ipitch = 127;
+	    }
+	} else {
+	    *ipitch = (voice[1] << 1) + voice[2];
+	}
+    }
+/*  Encode RMS by binary table search */
+    j = 32;
+    idel = 16;
+    *irms = min(*irms,1023);
+    while(idel > 0) {
+	if (*irms > rmst[j - 1]) {
+	    j -= idel;
+	}
+	if (*irms < rmst[j - 1]) {
+	    j += idel;
+	}
+	idel /= 2;
+    }
+    if (*irms > rmst[j - 1]) {
+	--j;
+    }
+    *irms = 31 - j / 2;
+/*  Encode RC(1) and (2) as log-area-ratios */
+    for (i__ = 1; i__ <= 2; ++i__) {
+	i2 = irc[i__];
+	mrk = 0;
+	if (i2 < 0) {
+	    i2 = -i2;
+	    mrk = 1;
+	}
+	i2 /= 512;
+	i2 = min(i2,63);
+	i2 = entab6[i2];
+	if (mrk != 0) {
+	    i2 = -i2;
+	}
+	irc[i__] = i2;
+    }
+/*  Encode RC(3) - (10) linearly, remove bias then scale */
+    i__1 = contrl_1.order;
+    for (i__ = 3; i__ <= i__1; ++i__) {
+	i2 = irc[i__] / 2;
+	i2 = (integer)((i2 + enadd[contrl_1.order + 1 - i__ - 1]) * enscl[
+		contrl_1.order + 1 - i__ - 1]);
+/* Computing MIN */
+	i__2 = max(i2,-127);
+	i2 = min(i__2,127);
+	nbit = enbits[contrl_1.order + 1 - i__ - 1];
+	i3 = 0;
+	if (i2 < 0) {
+	    i3 = -1;
+	}
+	i2 /= pow_ii(&c__2, &nbit);
+	if (i3 == -1) {
+	    --i2;
+	}
+	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 (contrl_1.corrp) {
+	if (*ipitch == 0 || *ipitch == 127) {
+	    irc[5] = enctab[(irc[1] & 30) / 2];
+	    irc[6] = enctab[(irc[2] & 30) / 2];
+	    irc[7] = enctab[(irc[3] & 30) / 2];
+	    irc[8] = enctab[(*irms & 30) / 2];
+	    irc[9] = enctab[(irc[4] & 30) / 2] / 2;
+	    irc[10] = enctab[(irc[4] & 30) / 2] & 1;
+	}
+    }
+/* 	IF(LISTL.GE.3)WRITE(FDEBUG,801)VOICE,IPITCH,IRMS,(IRC(J),J=1,ORDER) */
+/* 801	FORMAT(1X,'<<ENCODE OUT>>',T32,2I3,I6,I5,T50,10I8) */
+    return 0;
+} /* encode_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/energy.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/energy.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/energy.c	Fri Sep 21 14:49:14 2007
@@ -1,98 +1,98 @@
-/*
-
-$Log: energy.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:32:17  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int energy_(integer *len, real *speech, real *rms);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************* */
-
-/* 	ENERGY Version 50 */
-
-/* $Log: energy.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:17  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/18  21:17:41  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  16:46:02  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:45:40  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/* Compute RMS energy. */
-
-/* Input: */
-/*  LEN    - Length of speech buffer */
-/*  SPEECH - Speech buffer */
-/*           Indices 1 through LEN read. */
-/* Output: */
-/*  RMS    - Root Mean Square energy */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int energy_(integer *len, real *speech, real *rms)
-{
-    /* System generated locals */
-    integer i__1;
-
-    /* Builtin functions */
-    double sqrt(doublereal);
-
-    /* Local variables */
-    integer i__;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-    /* Parameter adjustments */
-    --speech;
-
-    /* Function Body */
-    *rms = 0.f;
-    i__1 = *len;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	*rms += speech[i__] * speech[i__];
-    }
-    *rms = (real)sqrt(*rms / *len);
-    return 0;
-} /* energy_ */
-
+/*
+
+$Log: energy.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:32:17  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int energy_(integer *len, real *speech, real *rms);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************* */
+
+/* 	ENERGY Version 50 */
+
+/* $Log: energy.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:17  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/18  21:17:41  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  16:46:02  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:45:40  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/* Compute RMS energy. */
+
+/* Input: */
+/*  LEN    - Length of speech buffer */
+/*  SPEECH - Speech buffer */
+/*           Indices 1 through LEN read. */
+/* Output: */
+/*  RMS    - Root Mean Square energy */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int energy_(integer *len, real *speech, real *rms)
+{
+    /* System generated locals */
+    integer i__1;
+
+    /* Builtin functions */
+    double sqrt(doublereal);
+
+    /* Local variables */
+    integer i__;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+    /* Parameter adjustments */
+    --speech;
+
+    /* Function Body */
+    *rms = 0.f;
+    i__1 = *len;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	*rms += speech[i__] * speech[i__];
+    }
+    *rms = (real)sqrt(*rms / *len);
+    return 0;
+} /* energy_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/f2c.h
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/f2c.h	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/f2c.h	Fri Sep 21 14:49:14 2007
@@ -1,252 +1,252 @@
-/*
-
-$Log: f2c.h,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:26:28  jaf
- * Any typedef defining a type that was used in lpc10_encoder_state or
- * lpc10_decoder_state struct's was commented out here and added to
- * lpc10.h.
- *
- * Revision 1.1  1996/08/19  22:32:13  jaf
- * Initial revision
- *
-
-*/
-
-/*
- * f2c.h
- *
- * SCCS ID:  @(#)f2c.h 1.2 96/05/19
- */
-
-/* f2c.h  --  Standard Fortran to C header file */
-
-/**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
-
-	- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
-
-#ifndef F2C_INCLUDE
-#define F2C_INCLUDE
-
-#include "lpc10.h"
-
-/*typedef long int integer;*/
-/*typedef INT32 integer;*/
-/*typedef short int shortint;*/
-/*typedef INT16 shortint;*/
-/*typedef float real;*/
-/* doublereal only used for function arguments to sqrt, exp, etc. */
-typedef double doublereal;
-/* 32 bits seems wasteful, but there really aren't that many logical
- * variables around, and making them 32 bits could avoid word
- * alignment problems, perhaps.  */
-/*typedef long int logical;*/
-/*typedef INT32 logical;*/
-/* The following types are not used in the translated C code for the
- * LPC-10 coder, but they might be needed by the definitions down
- * below, so they don't cause compilation errors.  */
-typedef char *address;
-typedef struct { real r, i; } complex;
-typedef struct { doublereal r, i; } doublecomplex;
-typedef short int shortlogical;
-typedef char logical1;
-typedef char integer1;
-/* typedef long long longint; */ /* system-dependent */
-
-#define TRUE_ (1)
-#define FALSE_ (0)
-
-/* Extern is for use with -E */
-#ifndef Extern
-#define Extern extern
-#endif
-
-/* I/O stuff */
-
-#ifdef f2c_i2
-/* for -i2 */
-typedef short flag;
-typedef short ftnlen;
-typedef short ftnint;
-#else
-typedef long int flag;
-typedef long int ftnlen;
-typedef long int ftnint;
-#endif
-
-/*external read, write*/
-typedef struct
-{	flag cierr;
-	ftnint ciunit;
-	flag ciend;
-	char *cifmt;
-	ftnint cirec;
-} cilist;
-
-/*internal read, write*/
-typedef struct
-{	flag icierr;
-	char *iciunit;
-	flag iciend;
-	char *icifmt;
-	ftnint icirlen;
-	ftnint icirnum;
-} icilist;
-
-/*open*/
-typedef struct
-{	flag oerr;
-	ftnint ounit;
-	char *ofnm;
-	ftnlen ofnmlen;
-	char *osta;
-	char *oacc;
-	char *ofm;
-	ftnint orl;
-	char *oblnk;
-} olist;
-
-/*close*/
-typedef struct
-{	flag cerr;
-	ftnint cunit;
-	char *csta;
-} cllist;
-
-/*rewind, backspace, endfile*/
-typedef struct
-{	flag aerr;
-	ftnint aunit;
-} alist;
-
-/* inquire */
-typedef struct
-{	flag inerr;
-	ftnint inunit;
-	char *infile;
-	ftnlen infilen;
-	ftnint	*inex;	/*parameters in standard's order*/
-	ftnint	*inopen;
-	ftnint	*innum;
-	ftnint	*innamed;
-	char	*inname;
-	ftnlen	innamlen;
-	char	*inacc;
-	ftnlen	inacclen;
-	char	*inseq;
-	ftnlen	inseqlen;
-	char 	*indir;
-	ftnlen	indirlen;
-	char	*infmt;
-	ftnlen	infmtlen;
-	char	*inform;
-	ftnint	informlen;
-	char	*inunf;
-	ftnlen	inunflen;
-	ftnint	*inrecl;
-	ftnint	*innrec;
-	char	*inblank;
-	ftnlen	inblanklen;
-} inlist;
-
-#define VOID void
-
-union Multitype {	/* for multiple entry points */
-	integer1 g;
-	shortint h;
-	integer i;
-	/* longint j; */
-	real r;
-	doublereal d;
-	complex c;
-	doublecomplex z;
-	};
-
-typedef union Multitype Multitype;
-
-/*typedef long int Long;*/	/* No longer used; formerly in Namelist */
-
-struct Vardesc {	/* for Namelist */
-	char *name;
-	char *addr;
-	ftnlen *dims;
-	int  type;
-	};
-typedef struct Vardesc Vardesc;
-
-struct Namelist {
-	char *name;
-	Vardesc **vars;
-	int nvars;
-	};
-typedef struct Namelist Namelist;
-
-#define abs(x) ((x) >= 0 ? (x) : -(x))
-#define dabs(x) (doublereal)abs(x)
-#define min(a,b) ((a) <= (b) ? (a) : (b))
-#define max(a,b) ((a) >= (b) ? (a) : (b))
-#define dmin(a,b) (doublereal)min(a,b)
-#define dmax(a,b) (doublereal)max(a,b)
-
-/* procedure parameter types for -A and -C++ */
-
-#define F2C_proc_par_types 1
-#ifdef __cplusplus
-typedef int /* Unknown procedure type */ (*U_fp)(...);
-typedef shortint (*J_fp)(...);
-typedef integer (*I_fp)(...);
-typedef real (*R_fp)(...);
-typedef doublereal (*D_fp)(...), (*E_fp)(...);
-typedef /* Complex */ VOID (*C_fp)(...);
-typedef /* Double Complex */ VOID (*Z_fp)(...);
-typedef logical (*L_fp)(...);
-typedef shortlogical (*K_fp)(...);
-typedef /* Character */ VOID (*H_fp)(...);
-typedef /* Subroutine */ int (*S_fp)(...);
-#else
-typedef int /* Unknown procedure type */ (*U_fp)();
-typedef shortint (*J_fp)();
-typedef integer (*I_fp)();
-typedef real (*R_fp)();
-typedef doublereal (*D_fp)(), (*E_fp)();
-typedef /* Complex */ VOID (*C_fp)();
-typedef /* Double Complex */ VOID (*Z_fp)();
-typedef logical (*L_fp)();
-typedef shortlogical (*K_fp)();
-typedef /* Character */ VOID (*H_fp)();
-typedef /* Subroutine */ int (*S_fp)();
-#endif
-/* E_fp is for real functions when -R is not specified */
-typedef VOID C_f;	/* complex function */
-typedef VOID H_f;	/* character function */
-typedef VOID Z_f;	/* double complex function */
-typedef doublereal E_f;	/* real function with -R not specified */
-
-/* undef any lower-case symbols that your C compiler predefines, e.g.: */
-
-#ifndef Skip_f2c_Undefs
-#undef cray
-#undef gcos
-#undef mc68010
-#undef mc68020
-#undef mips
-#undef pdp11
-#undef sgi
-#undef sparc
-#undef sun
-#undef sun2
-#undef sun3
-#undef sun4
-#undef u370
-#undef u3b
-#undef u3b2
-#undef u3b5
-#undef unix
-#undef vax
-#endif
-#endif
+/*
+
+$Log: f2c.h,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:26:28  jaf
+ * Any typedef defining a type that was used in lpc10_encoder_state or
+ * lpc10_decoder_state struct's was commented out here and added to
+ * lpc10.h.
+ *
+ * Revision 1.1  1996/08/19  22:32:13  jaf
+ * Initial revision
+ *
+
+*/
+
+/*
+ * f2c.h
+ *
+ * SCCS ID:  @(#)f2c.h 1.2 96/05/19
+ */
+
+/* f2c.h  --  Standard Fortran to C header file */
+
+/**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
+
+	- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
+
+#ifndef F2C_INCLUDE
+#define F2C_INCLUDE
+
+#include "lpc10.h"
+
+/*typedef long int integer;*/
+/*typedef INT32 integer;*/
+/*typedef short int shortint;*/
+/*typedef INT16 shortint;*/
+/*typedef float real;*/
+/* doublereal only used for function arguments to sqrt, exp, etc. */
+typedef double doublereal;
+/* 32 bits seems wasteful, but there really aren't that many logical
+ * variables around, and making them 32 bits could avoid word
+ * alignment problems, perhaps.  */
+/*typedef long int logical;*/
+/*typedef INT32 logical;*/
+/* The following types are not used in the translated C code for the
+ * LPC-10 coder, but they might be needed by the definitions down
+ * below, so they don't cause compilation errors.  */
+typedef char *address;
+typedef struct { real r, i; } complex;
+typedef struct { doublereal r, i; } doublecomplex;
+typedef short int shortlogical;
+typedef char logical1;
+typedef char integer1;
+/* typedef long long longint; */ /* system-dependent */
+
+#define TRUE_ (1)
+#define FALSE_ (0)
+
+/* Extern is for use with -E */
+#ifndef Extern
+#define Extern extern
+#endif
+
+/* I/O stuff */
+
+#ifdef f2c_i2
+/* for -i2 */
+typedef short flag;
+typedef short ftnlen;
+typedef short ftnint;
+#else
+typedef long int flag;
+typedef long int ftnlen;
+typedef long int ftnint;
+#endif
+
+/*external read, write*/
+typedef struct
+{	flag cierr;
+	ftnint ciunit;
+	flag ciend;
+	char *cifmt;
+	ftnint cirec;
+} cilist;
+
+/*internal read, write*/
+typedef struct
+{	flag icierr;
+	char *iciunit;
+	flag iciend;
+	char *icifmt;
+	ftnint icirlen;
+	ftnint icirnum;
+} icilist;
+
+/*open*/
+typedef struct
+{	flag oerr;
+	ftnint ounit;
+	char *ofnm;
+	ftnlen ofnmlen;
+	char *osta;
+	char *oacc;
+	char *ofm;
+	ftnint orl;
+	char *oblnk;
+} olist;
+
+/*close*/
+typedef struct
+{	flag cerr;
+	ftnint cunit;
+	char *csta;
+} cllist;
+
+/*rewind, backspace, endfile*/
+typedef struct
+{	flag aerr;
+	ftnint aunit;
+} alist;
+
+/* inquire */
+typedef struct
+{	flag inerr;
+	ftnint inunit;
+	char *infile;
+	ftnlen infilen;
+	ftnint	*inex;	/*parameters in standard's order*/
+	ftnint	*inopen;
+	ftnint	*innum;
+	ftnint	*innamed;
+	char	*inname;
+	ftnlen	innamlen;
+	char	*inacc;
+	ftnlen	inacclen;
+	char	*inseq;
+	ftnlen	inseqlen;
+	char 	*indir;
+	ftnlen	indirlen;
+	char	*infmt;
+	ftnlen	infmtlen;
+	char	*inform;
+	ftnint	informlen;
+	char	*inunf;
+	ftnlen	inunflen;
+	ftnint	*inrecl;
+	ftnint	*innrec;
+	char	*inblank;
+	ftnlen	inblanklen;
+} inlist;
+
+#define VOID void
+
+union Multitype {	/* for multiple entry points */
+	integer1 g;
+	shortint h;
+	integer i;
+	/* longint j; */
+	real r;
+	doublereal d;
+	complex c;
+	doublecomplex z;
+	};
+
+typedef union Multitype Multitype;
+
+/*typedef long int Long;*/	/* No longer used; formerly in Namelist */
+
+struct Vardesc {	/* for Namelist */
+	char *name;
+	char *addr;
+	ftnlen *dims;
+	int  type;
+	};
+typedef struct Vardesc Vardesc;
+
+struct Namelist {
+	char *name;
+	Vardesc **vars;
+	int nvars;
+	};
+typedef struct Namelist Namelist;
+
+#define abs(x) ((x) >= 0 ? (x) : -(x))
+#define dabs(x) (doublereal)abs(x)
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+#define max(a,b) ((a) >= (b) ? (a) : (b))
+#define dmin(a,b) (doublereal)min(a,b)
+#define dmax(a,b) (doublereal)max(a,b)
+
+/* procedure parameter types for -A and -C++ */
+
+#define F2C_proc_par_types 1
+#ifdef __cplusplus
+typedef int /* Unknown procedure type */ (*U_fp)(...);
+typedef shortint (*J_fp)(...);
+typedef integer (*I_fp)(...);
+typedef real (*R_fp)(...);
+typedef doublereal (*D_fp)(...), (*E_fp)(...);
+typedef /* Complex */ VOID (*C_fp)(...);
+typedef /* Double Complex */ VOID (*Z_fp)(...);
+typedef logical (*L_fp)(...);
+typedef shortlogical (*K_fp)(...);
+typedef /* Character */ VOID (*H_fp)(...);
+typedef /* Subroutine */ int (*S_fp)(...);
+#else
+typedef int /* Unknown procedure type */ (*U_fp)();
+typedef shortint (*J_fp)();
+typedef integer (*I_fp)();
+typedef real (*R_fp)();
+typedef doublereal (*D_fp)(), (*E_fp)();
+typedef /* Complex */ VOID (*C_fp)();
+typedef /* Double Complex */ VOID (*Z_fp)();
+typedef logical (*L_fp)();
+typedef shortlogical (*K_fp)();
+typedef /* Character */ VOID (*H_fp)();
+typedef /* Subroutine */ int (*S_fp)();
+#endif
+/* E_fp is for real functions when -R is not specified */
+typedef VOID C_f;	/* complex function */
+typedef VOID H_f;	/* character function */
+typedef VOID Z_f;	/* double complex function */
+typedef doublereal E_f;	/* real function with -R not specified */
+
+/* undef any lower-case symbols that your C compiler predefines, e.g.: */
+
+#ifndef Skip_f2c_Undefs
+#undef cray
+#undef gcos
+#undef mc68010
+#undef mc68020
+#undef mips
+#undef pdp11
+#undef sgi
+#undef sparc
+#undef sun
+#undef sun2
+#undef sun3
+#undef sun4
+#undef u370
+#undef u3b
+#undef u3b2
+#undef u3b5
+#undef unix
+#undef vax
+#endif
+#endif

Modified: freeswitch/trunk/libs/codec/lpc10/src/f2clib.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/f2clib.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/f2clib.c	Fri Sep 21 14:49:14 2007
@@ -1,91 +1,91 @@
-/*
-
-$Log: f2clib.c,v $
-Revision 1.2  2004/05/05 13:25:38  rjongbloed
-Fixed clearly incorrect code (dived by zero) found with an MSVC warning
-
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.3  2004/02/17 09:21:45  csoutheren
-Fix for GM bug 134591
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:32:10  jaf
- * Initial revision
- *
-
-*/
-
-/*
- * f2clib.c
- *
- * SCCS ID:  @(#)f2clib.c 1.2 96/05/19
- */
-
-#include "f2c.h"
-
-#ifdef KR_headers
-integer pow_ii(ap, bp) integer *ap, *bp;
-#else
-integer pow_ii(integer *ap, integer *bp)
-#endif
-{
-	integer pow, x, n;
-	unsigned long u;
-
-	x = *ap;
-	n = *bp;
-
-	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 & 01)
-			pow *= x;
-		if(u >>= 1)
-			x *= x;
-		else
-			break;
-		}
-	return(pow);
-	}
-
-
-
-#ifdef KR_headers
-double r_sign(a,b) real *a, *b;
-#else
-double r_sign(real *a, real *b)
-#endif
-{
-double x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
-
-
-
-#ifdef KR_headers
-double floor();
-integer i_nint(x) real *x;
-#else
-#undef abs
-#include "math.h"
-integer i_nint(real *x)
-#endif
-{
-return (integer)( (*x)>=0 ?
-	floor(*x + .5) : -(floor(.5 - *x)) );
-}
+/*
+
+$Log: f2clib.c,v $
+Revision 1.2  2004/05/05 13:25:38  rjongbloed
+Fixed clearly incorrect code (dived by zero) found with an MSVC warning
+
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.3  2004/02/17 09:21:45  csoutheren
+Fix for GM bug 134591
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:32:10  jaf
+ * Initial revision
+ *
+
+*/
+
+/*
+ * f2clib.c
+ *
+ * SCCS ID:  @(#)f2clib.c 1.2 96/05/19
+ */
+
+#include "f2c.h"
+
+#ifdef KR_headers
+integer pow_ii(ap, bp) integer *ap, *bp;
+#else
+integer pow_ii(integer *ap, integer *bp)
+#endif
+{
+	integer pow, x, n;
+	unsigned long u;
+
+	x = *ap;
+	n = *bp;
+
+	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 & 01)
+			pow *= x;
+		if(u >>= 1)
+			x *= x;
+		else
+			break;
+		}
+	return(pow);
+	}
+
+
+
+#ifdef KR_headers
+double r_sign(a,b) real *a, *b;
+#else
+double r_sign(real *a, real *b)
+#endif
+{
+double x;
+x = (*a >= 0 ? *a : - *a);
+return( *b >= 0 ? x : -x);
+}
+
+
+
+#ifdef KR_headers
+double floor();
+integer i_nint(x) real *x;
+#else
+#undef abs
+#include "math.h"
+integer i_nint(real *x)
+#endif
+{
+return (integer)( (*x)>=0 ?
+	floor(*x + .5) : -(floor(.5 - *x)) );
+}

Modified: freeswitch/trunk/libs/codec/lpc10/src/ham84.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/ham84.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/ham84.c	Fri Sep 21 14:49:14 2007
@@ -1,115 +1,115 @@
-/*
-
-$Log: ham84.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:32:07  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int ham84_(integer *input, integer *output, integer *errcnt);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ***************************************************************** */
-
-/* 	HAM84 Version 45G */
-
-/* $Log: ham84.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:07  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/21  15:26:00  jaf */
-/* Put comment header in standard form. */
-
-/* Revision 1.2  1996/03/13  22:00:13  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:47:04  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*  Hamming 8,4 Decoder - can correct 1 out of seven bits */
-/*   and can detect up to two errors. */
-
-/* Input: */
-/*  INPUT  - Seven bit data word, 4 bits parameter and */
-/*           4 bits parity information */
-/* Input/Output: */
-/*  ERRCNT - Sums errors detected by Hamming code */
-/* Output: */
-/*  OUTPUT - 4 corrected parameter bits */
-
-/* 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. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int ham84_(integer *input, integer *output, integer *errcnt)
-{
-    /* Initialized data */
-
-    static integer 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 };
-
-    integer i__, j, parity;
-
-/*       Arguments */
-/*       Parameters/constants */
-/*       Local variables that need not be saved */
-/*  Determine parity of input word */
-    parity = *input & 255;
-    parity ^= parity / 16;
-    parity ^= parity / 4;
-    parity ^= parity / 2;
-    parity &= 1;
-    i__ = dactab[*input & 127];
-    *output = i__ & 15;
-    j = i__ & 16;
-    if (j != 0) {
-/*          No errors detected in seven bits */
-	if (parity != 0) {
-	    ++(*errcnt);
-	}
-    } else {
-/*          One or two errors detected */
-	++(*errcnt);
-	if (parity == 0) {
-/*             Two errors detected */
-	    ++(*errcnt);
-	    *output = -1;
-	}
-    }
-    return 0;
-} /* ham84_ */
-
+/*
+
+$Log: ham84.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:32:07  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int ham84_(integer *input, integer *output, integer *errcnt);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ***************************************************************** */
+
+/* 	HAM84 Version 45G */
+
+/* $Log: ham84.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:07  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/21  15:26:00  jaf */
+/* Put comment header in standard form. */
+
+/* Revision 1.2  1996/03/13  22:00:13  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:47:04  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*  Hamming 8,4 Decoder - can correct 1 out of seven bits */
+/*   and can detect up to two errors. */
+
+/* Input: */
+/*  INPUT  - Seven bit data word, 4 bits parameter and */
+/*           4 bits parity information */
+/* Input/Output: */
+/*  ERRCNT - Sums errors detected by Hamming code */
+/* Output: */
+/*  OUTPUT - 4 corrected parameter bits */
+
+/* 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. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int ham84_(integer *input, integer *output, integer *errcnt)
+{
+    /* Initialized data */
+
+    static integer 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 };
+
+    integer i__, j, parity;
+
+/*       Arguments */
+/*       Parameters/constants */
+/*       Local variables that need not be saved */
+/*  Determine parity of input word */
+    parity = *input & 255;
+    parity ^= parity / 16;
+    parity ^= parity / 4;
+    parity ^= parity / 2;
+    parity &= 1;
+    i__ = dactab[*input & 127];
+    *output = i__ & 15;
+    j = i__ & 16;
+    if (j != 0) {
+/*          No errors detected in seven bits */
+	if (parity != 0) {
+	    ++(*errcnt);
+	}
+    } else {
+/*          One or two errors detected */
+	++(*errcnt);
+	if (parity == 0) {
+/*             Two errors detected */
+	    ++(*errcnt);
+	    *output = -1;
+	}
+    }
+    return 0;
+} /* ham84_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/hp100.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/hp100.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/hp100.c	Fri Sep 21 14:49:14 2007
@@ -1,158 +1,158 @@
-/*
-
-$Log: hp100.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:28:05  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:04  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int hp100_(real *speech, integer *start, integer *end,
-		  struct lpc10_encoder_state *st);
-extern int inithp100_(void);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************* */
-
-/*      HP100 Version 55 */
-
-/* $Log: hp100.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:28:05  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:32:04  jaf
- * Initial revision
- *
- */
-/* Revision 1.6  1996/03/15  16:45:25  jaf */
-/* Rearranged a few comments. */
-
-/* Revision 1.5  1996/03/14  23:20:54  jaf */
-/* Added comments about when INITHP100 should be used. */
-
-/* Revision 1.4  1996/03/14  23:08:08  jaf */
-/* Added an entry named INITHP100 that initializes the local state of */
-/* subroutine HP100. */
-
-/* Revision 1.3  1996/03/14  22:09:20  jaf */
-/* Comments added explaining which of the local variables of this */
-/* subroutine need to be saved from one invocation to the next, and which */
-/* do not. */
-
-/* Revision 1.2  1996/02/12  15:05:54  jaf */
-/* Added lots of comments explaining why I changed one line, which was a */
-/* declaration with initializations. */
-
-/* Revision 1.1  1996/02/07 14:47:12  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*    100 Hz High Pass Filter */
-
-/* Jan 92 - corrected typo (1.937148 to 1.935715), */
-/*          rounded coefficients to 7 places, */
-/*          corrected and merged gain (.97466**4), */
-/*          merged numerator into first two sections. */
-
-/* Input: */
-/*  start, end - Range of samples to filter */
-/* Input/Output: */
-/*  speech(end) - Speech data. */
-/*                Indices start through end are read and modified. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITHP100. */
-/* Subroutine */ int hp100_(real *speech, integer *start, integer *end,
-	struct lpc10_encoder_state *st)
-{
-    /* Temporary local copies of variables in lpc10_encoder_state.
-       I've only created these because it might cause the loop below
-       to execute a bit faster to access local variables, rather than
-       variables in the lpc10_encoder_state structure.  It is just a
-       guess that it will be faster. */
-
-    real z11;
-    real z21;
-    real z12;
-    real z22;
-
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    integer i__;
-    real si, err;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-/*       Local state */
-    /* Parameter adjustments */
-    if (speech) {
-	--speech;
-	}
-
-    /* Function Body */
-
-    z11 = st->z11;
-    z21 = st->z21;
-    z12 = st->z12;
-    z22 = st->z22;
-
-    i__1 = *end;
-    for (i__ = *start; i__ <= i__1; ++i__) {
-	si = speech[i__];
-	err = si + z11 * 1.859076f - z21 * .8648249f;
-	si = err - z11 * 2.f + z21;
-	z21 = z11;
-	z11 = err;
-	err = si + z12 * 1.935715f - z22 * .9417004f;
-	si = err - z12 * 2.f + z22;
-	z22 = z12;
-	z12 = err;
-	speech[i__] = si * .902428f;
-    }
-
-    st->z11 = z11;
-    st->z21 = z21;
-    st->z12 = z12;
-    st->z22 = z22;
-
-    return 0;
-} /* hp100_ */
+/*
+
+$Log: hp100.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:28:05  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:04  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int hp100_(real *speech, integer *start, integer *end,
+		  struct lpc10_encoder_state *st);
+extern int inithp100_(void);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************* */
+
+/*      HP100 Version 55 */
+
+/* $Log: hp100.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:28:05  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:32:04  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.6  1996/03/15  16:45:25  jaf */
+/* Rearranged a few comments. */
+
+/* Revision 1.5  1996/03/14  23:20:54  jaf */
+/* Added comments about when INITHP100 should be used. */
+
+/* Revision 1.4  1996/03/14  23:08:08  jaf */
+/* Added an entry named INITHP100 that initializes the local state of */
+/* subroutine HP100. */
+
+/* Revision 1.3  1996/03/14  22:09:20  jaf */
+/* Comments added explaining which of the local variables of this */
+/* subroutine need to be saved from one invocation to the next, and which */
+/* do not. */
+
+/* Revision 1.2  1996/02/12  15:05:54  jaf */
+/* Added lots of comments explaining why I changed one line, which was a */
+/* declaration with initializations. */
+
+/* Revision 1.1  1996/02/07 14:47:12  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*    100 Hz High Pass Filter */
+
+/* Jan 92 - corrected typo (1.937148 to 1.935715), */
+/*          rounded coefficients to 7 places, */
+/*          corrected and merged gain (.97466**4), */
+/*          merged numerator into first two sections. */
+
+/* Input: */
+/*  start, end - Range of samples to filter */
+/* Input/Output: */
+/*  speech(end) - Speech data. */
+/*                Indices start through end are read and modified. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITHP100. */
+/* Subroutine */ int hp100_(real *speech, integer *start, integer *end,
+	struct lpc10_encoder_state *st)
+{
+    /* Temporary local copies of variables in lpc10_encoder_state.
+       I've only created these because it might cause the loop below
+       to execute a bit faster to access local variables, rather than
+       variables in the lpc10_encoder_state structure.  It is just a
+       guess that it will be faster. */
+
+    real z11;
+    real z21;
+    real z12;
+    real z22;
+
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    integer i__;
+    real si, err;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+/*       Local state */
+    /* Parameter adjustments */
+    if (speech) {
+	--speech;
+	}
+
+    /* Function Body */
+
+    z11 = st->z11;
+    z21 = st->z21;
+    z12 = st->z12;
+    z22 = st->z22;
+
+    i__1 = *end;
+    for (i__ = *start; i__ <= i__1; ++i__) {
+	si = speech[i__];
+	err = si + z11 * 1.859076f - z21 * .8648249f;
+	si = err - z11 * 2.f + z21;
+	z21 = z11;
+	z11 = err;
+	err = si + z12 * 1.935715f - z22 * .9417004f;
+	si = err - z12 * 2.f + z22;
+	z22 = z12;
+	z12 = err;
+	speech[i__] = si * .902428f;
+    }
+
+    st->z11 = z11;
+    st->z21 = z21;
+    st->z12 = z12;
+    st->z22 = z22;
+
+    return 0;
+} /* hp100_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/invert.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/invert.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/invert.c	Fri Sep 21 14:49:14 2007
@@ -1,177 +1,177 @@
-/*
-
-$Log: invert.c,v $
-Revision 1.1  2004/05/04 11:16:42  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:32:00  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int invert_(integer *order, real *phi, real *psi, real *rc);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* **************************************************************** */
-
-/* 	INVERT Version 45G */
-
-/* $Log: invert.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:00  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/18  20:52:47  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  16:51:32  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Eliminated a comment from the original, describing a local array X */
-/* that appeared nowhere in the code. */
-
-/* Revision 1.1  1996/02/07 14:47:20  jaf */
-/* Initial revision */
-
-
-/* **************************************************************** */
-
-/*  Invert a covariance matrix using Choleski decomposition method. */
-
-/* Input: */
-/*  ORDER            - Analysis order */
-/*  PHI(ORDER,ORDER) - Covariance matrix */
-/*                    Indices (I,J) read, where ORDER .GE. I .GE. J .GE. 1.*/
-/*                     All other indices untouched. */
-/*  PSI(ORDER)       - Column vector to be predicted */
-/*                     Indices 1 through ORDER read. */
-/* Output: */
-/*  RC(ORDER)        - Pseudo reflection coefficients */
-/*                    Indices 1 through ORDER written, and then possibly read.
-*/
-/* Internal: */
-/*  V(ORDER,ORDER)   - Temporary matrix */
-/*                     Same indices written as read from PHI. */
-/*                     Many indices may be read and written again after */
-/*                     initially being copied from PHI, but all indices */
-/*                     are written before being read. */
-
-/*  NOTE: Temporary matrix V is not needed and may be replaced */
-/*    by PHI if the original PHI values do not need to be preserved. */
-
-/* Subroutine */ int invert_(integer *order, real *phi, real *psi, real *rc)
-{
-    /* System generated locals */
-    integer phi_dim1, phi_offset, i__1, i__2, i__3;
-    real r__1, r__2;
-
-    /* Local variables */
-    real save;
-    integer i__, j, k;
-    real v[100]	/* was [10][10] */;
-
-/*       Arguments */
-/* $Log: invert.c,v $
- * Revision 1.1  2004/05/04 11:16:42  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:32:00  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/* 	Parameters/constants */
-/*       Local variables that need not be saved */
-/*  Decompose PHI into V * D * V' where V is a triangular matrix whose */
-/*   main diagonal elements are all 1, V' is the transpose of V, and */
-/*   D is a vector.  Here D(n) is stored in location V(n,n). */
-    /* Parameter adjustments */
-    --rc;
-    --psi;
-    phi_dim1 = *order;
-    phi_offset = phi_dim1 + 1;
-    phi -= phi_offset;
-
-    /* Function Body */
-    i__1 = *order;
-    for (j = 1; j <= i__1; ++j) {
-	i__2 = *order;
-	for (i__ = j; i__ <= i__2; ++i__) {
-	    v[i__ + j * 10 - 11] = phi[i__ + j * phi_dim1];
-	}
-	i__2 = j - 1;
-	for (k = 1; k <= i__2; ++k) {
-	    save = v[j + k * 10 - 11] * v[k + k * 10 - 11];
-	    i__3 = *order;
-	    for (i__ = j; i__ <= i__3; ++i__) {
-		v[i__ + j * 10 - 11] -= v[i__ + k * 10 - 11] * save;
-	    }
-	}
-/*  Compute intermediate results, which are similar to RC's */
-	if ((r__1 = v[j + j * 10 - 11], abs(r__1)) < 1e-10f) {
-	    goto L100;
-	}
-	rc[j] = psi[j];
-	i__2 = j - 1;
-	for (k = 1; k <= i__2; ++k) {
-	    rc[j] -= rc[k] * v[j + k * 10 - 11];
-	}
-	v[j + j * 10 - 11] = 1.f / v[j + j * 10 - 11];
-	rc[j] *= v[j + j * 10 - 11];
-/* Computing MAX */
-/* Computing MIN */
-	r__2 = rc[j];
-	r__1 = min(r__2,.999f);
-	rc[j] = max(r__1,-.999f);
-    }
-    return 0;
-/*  Zero out higher order RC's if algorithm terminated early */
-L100:
-    i__1 = *order;
-    for (i__ = j; i__ <= i__1; ++i__) {
-	rc[i__] = 0.f;
-    }
-/*  Back substitute for PC's (if needed) */
-/* 110	DO J = ORDER,1,-1 */
-/* 	   PC(J) = RC(J) */
-/* 	   DO I = 1,J-1 */
-/* 	      PC(J) = PC(J) - PC(I)*V(J,I) */
-/* 	   END DO */
-/* 	END DO */
-    return 0;
-} /* invert_ */
-
+/*
+
+$Log: invert.c,v $
+Revision 1.1  2004/05/04 11:16:42  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:32:00  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int invert_(integer *order, real *phi, real *psi, real *rc);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* **************************************************************** */
+
+/* 	INVERT Version 45G */
+
+/* $Log: invert.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:00  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/18  20:52:47  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  16:51:32  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Eliminated a comment from the original, describing a local array X */
+/* that appeared nowhere in the code. */
+
+/* Revision 1.1  1996/02/07 14:47:20  jaf */
+/* Initial revision */
+
+
+/* **************************************************************** */
+
+/*  Invert a covariance matrix using Choleski decomposition method. */
+
+/* Input: */
+/*  ORDER            - Analysis order */
+/*  PHI(ORDER,ORDER) - Covariance matrix */
+/*                    Indices (I,J) read, where ORDER .GE. I .GE. J .GE. 1.*/
+/*                     All other indices untouched. */
+/*  PSI(ORDER)       - Column vector to be predicted */
+/*                     Indices 1 through ORDER read. */
+/* Output: */
+/*  RC(ORDER)        - Pseudo reflection coefficients */
+/*                    Indices 1 through ORDER written, and then possibly read.
+*/
+/* Internal: */
+/*  V(ORDER,ORDER)   - Temporary matrix */
+/*                     Same indices written as read from PHI. */
+/*                     Many indices may be read and written again after */
+/*                     initially being copied from PHI, but all indices */
+/*                     are written before being read. */
+
+/*  NOTE: Temporary matrix V is not needed and may be replaced */
+/*    by PHI if the original PHI values do not need to be preserved. */
+
+/* Subroutine */ int invert_(integer *order, real *phi, real *psi, real *rc)
+{
+    /* System generated locals */
+    integer phi_dim1, phi_offset, i__1, i__2, i__3;
+    real r__1, r__2;
+
+    /* Local variables */
+    real save;
+    integer i__, j, k;
+    real v[100]	/* was [10][10] */;
+
+/*       Arguments */
+/* $Log: invert.c,v $
+ * Revision 1.1  2004/05/04 11:16:42  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:32:00  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/* 	Parameters/constants */
+/*       Local variables that need not be saved */
+/*  Decompose PHI into V * D * V' where V is a triangular matrix whose */
+/*   main diagonal elements are all 1, V' is the transpose of V, and */
+/*   D is a vector.  Here D(n) is stored in location V(n,n). */
+    /* Parameter adjustments */
+    --rc;
+    --psi;
+    phi_dim1 = *order;
+    phi_offset = phi_dim1 + 1;
+    phi -= phi_offset;
+
+    /* Function Body */
+    i__1 = *order;
+    for (j = 1; j <= i__1; ++j) {
+	i__2 = *order;
+	for (i__ = j; i__ <= i__2; ++i__) {
+	    v[i__ + j * 10 - 11] = phi[i__ + j * phi_dim1];
+	}
+	i__2 = j - 1;
+	for (k = 1; k <= i__2; ++k) {
+	    save = v[j + k * 10 - 11] * v[k + k * 10 - 11];
+	    i__3 = *order;
+	    for (i__ = j; i__ <= i__3; ++i__) {
+		v[i__ + j * 10 - 11] -= v[i__ + k * 10 - 11] * save;
+	    }
+	}
+/*  Compute intermediate results, which are similar to RC's */
+	if ((r__1 = v[j + j * 10 - 11], abs(r__1)) < 1e-10f) {
+	    goto L100;
+	}
+	rc[j] = psi[j];
+	i__2 = j - 1;
+	for (k = 1; k <= i__2; ++k) {
+	    rc[j] -= rc[k] * v[j + k * 10 - 11];
+	}
+	v[j + j * 10 - 11] = 1.f / v[j + j * 10 - 11];
+	rc[j] *= v[j + j * 10 - 11];
+/* Computing MAX */
+/* Computing MIN */
+	r__2 = rc[j];
+	r__1 = min(r__2,.999f);
+	rc[j] = max(r__1,-.999f);
+    }
+    return 0;
+/*  Zero out higher order RC's if algorithm terminated early */
+L100:
+    i__1 = *order;
+    for (i__ = j; i__ <= i__1; ++i__) {
+	rc[i__] = 0.f;
+    }
+/*  Back substitute for PC's (if needed) */
+/* 110	DO J = ORDER,1,-1 */
+/* 	   PC(J) = RC(J) */
+/* 	   DO I = 1,J-1 */
+/* 	      PC(J) = PC(J) - PC(I)*V(J,I) */
+/* 	   END DO */
+/* 	END DO */
+    return 0;
+} /* invert_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/irc2pc.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/irc2pc.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/irc2pc.c	Fri Sep 21 14:49:14 2007
@@ -1,144 +1,144 @@
-/*
-
-$Log: irc2pc.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:56  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ***************************************************************** */
-
-/* 	IRC2PC Version 48 */
-
-/* $Log: irc2pc.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:56  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/20  15:47:19  jaf */
-/* Added comments about which indices of array arguments are read or */
-/* written. */
-
-/* Revision 1.2  1996/03/14  16:59:04  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:47:27  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*   Convert Reflection Coefficients to Predictor Coeficients */
-
-/* Inputs: */
-/*  RC     - Reflection coefficients */
-/*           Indices 1 through ORDER read. */
-/*  ORDER  - Number of RC's */
-/*  GPRIME - Excitation modification gain */
-/* Outputs: */
-/*  PC     - Predictor coefficients */
-/*           Indices 1 through ORDER written. */
-/*           Indices 1 through ORDER-1 are read after being written. */
-/*  G2PASS - Excitation modification sharpening factor */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int irc2pc_(real *rc, real *pc, integer *order, real *gprime,
-	 real *g2pass)
-{
-    /* System generated locals */
-    integer i__1, i__2;
-
-    /* Builtin functions */
-    double sqrt(doublereal);
-
-    /* Local variables */
-    real temp[10];
-    integer i__, j;
-
-/* 	Arguments */
-/* $Log: irc2pc.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:56  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Local variables that need not be saved */
-    /* Parameter adjustments */
-    --pc;
-    --rc;
-
-    /* Function Body */
-    *g2pass = 1.f;
-    i__1 = *order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	*g2pass *= 1.f - rc[i__] * rc[i__];
-    }
-    *g2pass = (real)(*gprime * sqrt(*g2pass));
-    pc[1] = rc[1];
-    i__1 = *order;
-    for (i__ = 2; i__ <= i__1; ++i__) {
-	i__2 = i__ - 1;
-	for (j = 1; j <= i__2; ++j) {
-	    temp[j - 1] = pc[j] - rc[i__] * pc[i__ - j];
-	}
-	i__2 = i__ - 1;
-	for (j = 1; j <= i__2; ++j) {
-	    pc[j] = temp[j - 1];
-	}
-	pc[i__] = rc[i__];
-    }
-    return 0;
-} /* irc2pc_ */
-
+/*
+
+$Log: irc2pc.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:56  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ***************************************************************** */
+
+/* 	IRC2PC Version 48 */
+
+/* $Log: irc2pc.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:56  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/20  15:47:19  jaf */
+/* Added comments about which indices of array arguments are read or */
+/* written. */
+
+/* Revision 1.2  1996/03/14  16:59:04  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:47:27  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*   Convert Reflection Coefficients to Predictor Coeficients */
+
+/* Inputs: */
+/*  RC     - Reflection coefficients */
+/*           Indices 1 through ORDER read. */
+/*  ORDER  - Number of RC's */
+/*  GPRIME - Excitation modification gain */
+/* Outputs: */
+/*  PC     - Predictor coefficients */
+/*           Indices 1 through ORDER written. */
+/*           Indices 1 through ORDER-1 are read after being written. */
+/*  G2PASS - Excitation modification sharpening factor */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int irc2pc_(real *rc, real *pc, integer *order, real *gprime,
+	 real *g2pass)
+{
+    /* System generated locals */
+    integer i__1, i__2;
+
+    /* Builtin functions */
+    double sqrt(doublereal);
+
+    /* Local variables */
+    real temp[10];
+    integer i__, j;
+
+/* 	Arguments */
+/* $Log: irc2pc.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:56  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Local variables that need not be saved */
+    /* Parameter adjustments */
+    --pc;
+    --rc;
+
+    /* Function Body */
+    *g2pass = 1.f;
+    i__1 = *order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	*g2pass *= 1.f - rc[i__] * rc[i__];
+    }
+    *g2pass = (real)(*gprime * sqrt(*g2pass));
+    pc[1] = rc[1];
+    i__1 = *order;
+    for (i__ = 2; i__ <= i__1; ++i__) {
+	i__2 = i__ - 1;
+	for (j = 1; j <= i__2; ++j) {
+	    temp[j - 1] = pc[j] - rc[i__] * pc[i__ - j];
+	}
+	i__2 = i__ - 1;
+	for (j = 1; j <= i__2; ++j) {
+	    pc[j] = temp[j - 1];
+	}
+	pc[i__] = rc[i__];
+    }
+    return 0;
+} /* irc2pc_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/ivfilt.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/ivfilt.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/ivfilt.c	Fri Sep 21 14:49:14 2007
@@ -1,125 +1,125 @@
-/*
-
-$Log: ivfilt.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:53  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real *ivrc);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************* */
-
-/* 	IVFILT Version 48 */
-
-/* $Log: ivfilt.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:53  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/15  21:36:29  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  00:01:00  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:47:34  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*   2nd order inverse filter, speech is decimated 4:1 */
-
-/* Input: */
-/*  LEN    - Length of speech buffers */
-/*  NSAMP  - Number of samples to filter */
-/*  LPBUF  - Low pass filtered speech buffer */
-/*           Indices LEN-NSAMP-7 through LEN read. */
-/* Output: */
-/*  IVBUF  - Inverse filtered speech buffer */
-/*           Indices LEN-NSAMP+1 through LEN written. */
-/*  IVRC   - Inverse filter reflection coefficients (for voicing) */
-/*          Indices 1 and 2 both written (also read, but only after writing).
-*/
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *
-	nsamp, real *ivrc)
-{
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    integer i__, j, k;
-    real r__[3], pc1, pc2;
-
-/* 	Arguments */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       None */
-/*  Calculate Autocorrelations */
-    /* Parameter adjustments */
-    --ivbuf;
-    --lpbuf;
-    --ivrc;
-
-    /* Function Body */
-    for (i__ = 1; i__ <= 3; ++i__) {
-	r__[i__ - 1] = 0.f;
-	k = i__ - (1 << 2);
-	i__1 = *len;
-	for (j = (i__ << 2) + *len - *nsamp; j <= i__1; j += 2) {
-	    r__[i__ - 1] += lpbuf[j] * lpbuf[j - k];
-	}
-    }
-/*  Calculate predictor coefficients */
-    pc1 = 0.f;
-    pc2 = 0.f;
-    ivrc[1] = 0.f;
-    ivrc[2] = 0.f;
-    if (r__[0] > 1e-10f) {
-	ivrc[1] = r__[1] / r__[0];
-	ivrc[2] = (r__[2] - ivrc[1] * r__[1]) / (r__[0] - ivrc[1] * r__[1]);
-	pc1 = ivrc[1] - ivrc[1] * ivrc[2];
-	pc2 = ivrc[2];
-    }
-/*  Inverse filter LPBUF into IVBUF */
-    i__1 = *len;
-    for (i__ = *len + 1 - *nsamp; i__ <= i__1; ++i__) {
-	ivbuf[i__] = lpbuf[i__] - pc1 * lpbuf[i__ - 4] - pc2 * lpbuf[i__ - 8];
-    }
-    return 0;
-} /* ivfilt_ */
-
+/*
+
+$Log: ivfilt.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:53  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real *ivrc);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************* */
+
+/* 	IVFILT Version 48 */
+
+/* $Log: ivfilt.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:53  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/15  21:36:29  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  00:01:00  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:47:34  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*   2nd order inverse filter, speech is decimated 4:1 */
+
+/* Input: */
+/*  LEN    - Length of speech buffers */
+/*  NSAMP  - Number of samples to filter */
+/*  LPBUF  - Low pass filtered speech buffer */
+/*           Indices LEN-NSAMP-7 through LEN read. */
+/* Output: */
+/*  IVBUF  - Inverse filtered speech buffer */
+/*           Indices LEN-NSAMP+1 through LEN written. */
+/*  IVRC   - Inverse filter reflection coefficients (for voicing) */
+/*          Indices 1 and 2 both written (also read, but only after writing).
+*/
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *
+	nsamp, real *ivrc)
+{
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    integer i__, j, k;
+    real r__[3], pc1, pc2;
+
+/* 	Arguments */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       None */
+/*  Calculate Autocorrelations */
+    /* Parameter adjustments */
+    --ivbuf;
+    --lpbuf;
+    --ivrc;
+
+    /* Function Body */
+    for (i__ = 1; i__ <= 3; ++i__) {
+	r__[i__ - 1] = 0.f;
+	k = i__ - (1 << 2);
+	i__1 = *len;
+	for (j = (i__ << 2) + *len - *nsamp; j <= i__1; j += 2) {
+	    r__[i__ - 1] += lpbuf[j] * lpbuf[j - k];
+	}
+    }
+/*  Calculate predictor coefficients */
+    pc1 = 0.f;
+    pc2 = 0.f;
+    ivrc[1] = 0.f;
+    ivrc[2] = 0.f;
+    if (r__[0] > 1e-10f) {
+	ivrc[1] = r__[1] / r__[0];
+	ivrc[2] = (r__[2] - ivrc[1] * r__[1]) / (r__[0] - ivrc[1] * r__[1]);
+	pc1 = ivrc[1] - ivrc[1] * ivrc[2];
+	pc2 = ivrc[2];
+    }
+/*  Inverse filter LPBUF into IVBUF */
+    i__1 = *len;
+    for (i__ = *len + 1 - *nsamp; i__ <= i__1; ++i__) {
+	ivbuf[i__] = lpbuf[i__] - pc1 * lpbuf[i__ - 4] - pc2 * lpbuf[i__ - 8];
+    }
+    return 0;
+} /* ivfilt_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/lpc10.h
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/lpc10.h	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/lpc10.h	Fri Sep 21 14:49:14 2007
@@ -1,211 +1,211 @@
-/*
-
-$Log: lpc10.h,v $
-Revision 1.1  2004/05/04 11:30:49  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:11  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:47:31  jaf
- * Initial revision
- *
-
-*/
-
-#ifndef __LPC10_H__
-#define __LPC10_H__
-
-#define LPC10_SAMPLES_PER_FRAME 180
-#define LPC10_BITS_IN_COMPRESSED_FRAME 54
-
-
-typedef short		INT16;
-typedef int		INT32;
-
-
-/* The initial values for every member of this structure is 0, except
-   where noted in comments. */
-
-/* These two lines are copied from f2c.h.  There should be a more
-   elegant way of doing this than having the same declarations in two
-   files. */
-
-typedef float real;
-typedef INT32 integer;
-typedef INT32 logical;
-typedef INT16 shortint;
-
-struct lpc10_encoder_state {
-    /* State used only by function hp100 */
-    real z11;
-    real z21;
-    real z12;
-    real z22;
-    
-    /* State used by function analys */
-    real inbuf[540], pebuf[540];
-    real lpbuf[696], ivbuf[312];
-    real bias;
-    integer osbuf[10];  /* no initial value necessary */
-    integer osptr;     /* initial value 1 */
-    integer obound[3];
-    integer vwin[6]	/* was [2][3] */;   /* initial value vwin[4] = 307; vwin[5] = 462; */
-    integer awin[6]	/* was [2][3] */;   /* initial value awin[4] = 307; awin[5] = 462; */
-    integer voibuf[8]	/* was [2][4] */;
-    real rmsbuf[3];
-    real rcbuf[30]	/* was [10][3] */;
-    real zpre;
-
-
-    /* State used by function onset */
-    real n;
-    real d__;   /* initial value 1.f */
-    real fpc;   /* no initial value necessary */
-    real l2buf[16];
-    real l2sum1;
-    integer l2ptr1;   /* initial value 1 */
-    integer l2ptr2;   /* initial value 9 */
-    integer lasti;    /* no initial value necessary */
-    logical hyst;   /* initial value FALSE_ */
-
-    /* State used by function voicin */
-    real dither;   /* initial value 20.f */
-    real snr;
-    real maxmin;
-    real voice[6]	/* was [2][3] */;   /* initial value is probably unnecessary */
-    integer lbve, lbue, fbve, fbue;
-    integer ofbue, sfbue;
-    integer olbue, slbue;
-    /* Initial values:
-	lbve = 3000;
-	fbve = 3000;
-	fbue = 187;
-	ofbue = 187;
-	sfbue = 187;
-	lbue = 93;
-	olbue = 93;
-	slbue = 93;
-	snr = (real) (fbve / fbue << 6);
-	*/
-
-    /* State used by function dyptrk */
-    real s[60];
-    integer p[120]	/* was [60][2] */;
-    integer ipoint;
-    real alphax;
-
-    /* State used by function chanwr */
-    integer isync;
-
-};
-
-
-struct lpc10_decoder_state {
-
-    /* State used by function decode */
-    integer iptold;   /* initial value 60 */
-    logical first;   /* initial value TRUE_ */
-    integer ivp2h;
-    integer iovoic;
-    integer iavgp;   /* initial value 60 */
-    integer erate;
-    integer drc[30]	/* was [3][10] */;
-    integer dpit[3];
-    integer drms[3];
-
-    /* State used by function synths */
-    real buf[360];
-    integer buflen;   /* initial value 180 */
-
-    /* State used by function pitsyn */
-    integer ivoico;   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    integer ipito;   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    real rmso;   /* initial value 1.f */
-    real rco[10];   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    integer jsamp;   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    logical first_pitsyn;   /* initial value TRUE_ */
-
-    /* State used by function bsynz */
-    integer ipo;
-    real exc[166];
-    real exc2[166];
-    real lpi1;
-    real lpi2;
-    real lpi3;
-    real hpi1;
-    real hpi2;
-    real hpi3;
-    real rmso_bsynz;
-
-    /* State used by function random */
-    integer j;   /* initial value 2 */
-    integer k;   /* initial value 5 */
-    shortint y[5];  /* initial value { -21161,-8478,30892,-10216,16950 } */
-
-    /* State used by function deemp */
-    real dei1;
-    real dei2;
-    real deo1;
-    real deo2;
-    real deo3;
-
-};
-
-
-
-/*
-
-  Calling sequence:
-
-  Call create_lpc10_encoder_state(), which returns a pointer to an
-  already initialized lpc10_encoder_state structure.
-
-  lpc10_encode reads indices 0 through (LPC10_SAMPLES_PER_FRAME-1) of
-  array speech[], and writes indices 0 through
-  (LPC10_BITS_IN_COMPRESSED_FRAME-1) of array bits[], and both reads
-  and writes the lpc10_encoder_state structure contents.  The
-  lpc10_encoder_state structure should *not* be initialized for every
-  frame of encoded speech.  Once at the beginning of execution, done
-  automatically for you by create_lpc10_encoder_state(), is enough.
-
-  init_lpc10_encoder_state() reinitializes the lpc10_encoder_state
-  structure.  This might be useful if you are finished processing one
-  sound sample, and want to reuse the same lpc10_encoder_state
-  structure to process another sound sample.  There might be other
-  uses as well.
-
-  Note that the comments in the lpc10/lpcenc.c file imply that indices
-  1 through 180 of array speech[] are read.  These comments were
-  written for the Fortran version of the code, before it was
-  automatically converted to C by the conversion program f2c.  f2c
-  seems to use the convention that the pointers to arrays passed as
-  function arguments point to the first index used in the Fortran
-  code, whatever index that might be (usually 1), and then it modifies
-  the pointer inside of the function, like so:
-
-  if (speech) {
-      --speech;
-  }
-
-  So that the code can access the first value at index 1 and the last
-  at index 180.  This makes the translated C code "closer" to the
-  original Fortran code.
-
-  The calling sequence for the decoder is similar to the encoder.  The
-  only significant difference is that the array bits[] is read
-  (indices 0 through (LPC10_BITS_IN_COMPRESSED_FRAME-1)), and the
-  array speech[] is written (indices 0 through
-  (LPC10_SAMPLES_PER_FRAME-1)).
-  
-  */
-
-struct lpc10_encoder_state * create_lpc10_encoder_state ();
-void init_lpc10_encoder_state (struct lpc10_encoder_state *st);
-int lpc10_encode (real *speech, INT32 *bits, struct lpc10_encoder_state *st);
-
-struct lpc10_decoder_state * create_lpc10_decoder_state ();
-void init_lpc10_decoder_state (struct lpc10_decoder_state *st);
-int lpc10_decode (INT32 *bits, real *speech, struct lpc10_decoder_state *st);
-
-#endif /* __LPC10_H__ */
+/*
+
+$Log: lpc10.h,v $
+Revision 1.1  2004/05/04 11:30:49  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:11  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:47:31  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifndef __LPC10_H__
+#define __LPC10_H__
+
+#define LPC10_SAMPLES_PER_FRAME 180
+#define LPC10_BITS_IN_COMPRESSED_FRAME 54
+
+
+typedef short		INT16;
+typedef int		INT32;
+
+
+/* The initial values for every member of this structure is 0, except
+   where noted in comments. */
+
+/* These two lines are copied from f2c.h.  There should be a more
+   elegant way of doing this than having the same declarations in two
+   files. */
+
+typedef float real;
+typedef INT32 integer;
+typedef INT32 logical;
+typedef INT16 shortint;
+
+struct lpc10_encoder_state {
+    /* State used only by function hp100 */
+    real z11;
+    real z21;
+    real z12;
+    real z22;
+    
+    /* State used by function analys */
+    real inbuf[540], pebuf[540];
+    real lpbuf[696], ivbuf[312];
+    real bias;
+    integer osbuf[10];  /* no initial value necessary */
+    integer osptr;     /* initial value 1 */
+    integer obound[3];
+    integer vwin[6]	/* was [2][3] */;   /* initial value vwin[4] = 307; vwin[5] = 462; */
+    integer awin[6]	/* was [2][3] */;   /* initial value awin[4] = 307; awin[5] = 462; */
+    integer voibuf[8]	/* was [2][4] */;
+    real rmsbuf[3];
+    real rcbuf[30]	/* was [10][3] */;
+    real zpre;
+
+
+    /* State used by function onset */
+    real n;
+    real d__;   /* initial value 1.f */
+    real fpc;   /* no initial value necessary */
+    real l2buf[16];
+    real l2sum1;
+    integer l2ptr1;   /* initial value 1 */
+    integer l2ptr2;   /* initial value 9 */
+    integer lasti;    /* no initial value necessary */
+    logical hyst;   /* initial value FALSE_ */
+
+    /* State used by function voicin */
+    real dither;   /* initial value 20.f */
+    real snr;
+    real maxmin;
+    real voice[6]	/* was [2][3] */;   /* initial value is probably unnecessary */
+    integer lbve, lbue, fbve, fbue;
+    integer ofbue, sfbue;
+    integer olbue, slbue;
+    /* Initial values:
+	lbve = 3000;
+	fbve = 3000;
+	fbue = 187;
+	ofbue = 187;
+	sfbue = 187;
+	lbue = 93;
+	olbue = 93;
+	slbue = 93;
+	snr = (real) (fbve / fbue << 6);
+	*/
+
+    /* State used by function dyptrk */
+    real s[60];
+    integer p[120]	/* was [60][2] */;
+    integer ipoint;
+    real alphax;
+
+    /* State used by function chanwr */
+    integer isync;
+
+};
+
+
+struct lpc10_decoder_state {
+
+    /* State used by function decode */
+    integer iptold;   /* initial value 60 */
+    logical first;   /* initial value TRUE_ */
+    integer ivp2h;
+    integer iovoic;
+    integer iavgp;   /* initial value 60 */
+    integer erate;
+    integer drc[30]	/* was [3][10] */;
+    integer dpit[3];
+    integer drms[3];
+
+    /* State used by function synths */
+    real buf[360];
+    integer buflen;   /* initial value 180 */
+
+    /* State used by function pitsyn */
+    integer ivoico;   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    integer ipito;   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    real rmso;   /* initial value 1.f */
+    real rco[10];   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    integer jsamp;   /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    logical first_pitsyn;   /* initial value TRUE_ */
+
+    /* State used by function bsynz */
+    integer ipo;
+    real exc[166];
+    real exc2[166];
+    real lpi1;
+    real lpi2;
+    real lpi3;
+    real hpi1;
+    real hpi2;
+    real hpi3;
+    real rmso_bsynz;
+
+    /* State used by function random */
+    integer j;   /* initial value 2 */
+    integer k;   /* initial value 5 */
+    shortint y[5];  /* initial value { -21161,-8478,30892,-10216,16950 } */
+
+    /* State used by function deemp */
+    real dei1;
+    real dei2;
+    real deo1;
+    real deo2;
+    real deo3;
+
+};
+
+
+
+/*
+
+  Calling sequence:
+
+  Call create_lpc10_encoder_state(), which returns a pointer to an
+  already initialized lpc10_encoder_state structure.
+
+  lpc10_encode reads indices 0 through (LPC10_SAMPLES_PER_FRAME-1) of
+  array speech[], and writes indices 0 through
+  (LPC10_BITS_IN_COMPRESSED_FRAME-1) of array bits[], and both reads
+  and writes the lpc10_encoder_state structure contents.  The
+  lpc10_encoder_state structure should *not* be initialized for every
+  frame of encoded speech.  Once at the beginning of execution, done
+  automatically for you by create_lpc10_encoder_state(), is enough.
+
+  init_lpc10_encoder_state() reinitializes the lpc10_encoder_state
+  structure.  This might be useful if you are finished processing one
+  sound sample, and want to reuse the same lpc10_encoder_state
+  structure to process another sound sample.  There might be other
+  uses as well.
+
+  Note that the comments in the lpc10/lpcenc.c file imply that indices
+  1 through 180 of array speech[] are read.  These comments were
+  written for the Fortran version of the code, before it was
+  automatically converted to C by the conversion program f2c.  f2c
+  seems to use the convention that the pointers to arrays passed as
+  function arguments point to the first index used in the Fortran
+  code, whatever index that might be (usually 1), and then it modifies
+  the pointer inside of the function, like so:
+
+  if (speech) {
+      --speech;
+  }
+
+  So that the code can access the first value at index 1 and the last
+  at index 180.  This makes the translated C code "closer" to the
+  original Fortran code.
+
+  The calling sequence for the decoder is similar to the encoder.  The
+  only significant difference is that the array bits[] is read
+  (indices 0 through (LPC10_BITS_IN_COMPRESSED_FRAME-1)), and the
+  array speech[] is written (indices 0 through
+  (LPC10_SAMPLES_PER_FRAME-1)).
+  
+  */
+
+struct lpc10_encoder_state * create_lpc10_encoder_state ();
+void init_lpc10_encoder_state (struct lpc10_encoder_state *st);
+int lpc10_encode (real *speech, INT32 *bits, struct lpc10_encoder_state *st);
+
+struct lpc10_decoder_state * create_lpc10_decoder_state ();
+void init_lpc10_decoder_state (struct lpc10_decoder_state *st);
+int lpc10_decode (INT32 *bits, real *speech, struct lpc10_decoder_state *st);
+
+#endif /* __LPC10_H__ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/lpcdec.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/lpcdec.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/lpcdec.c	Fri Sep 21 14:49:14 2007
@@ -1,276 +1,276 @@
-/*
-
-$Log: lpcdec.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:30:11  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:48  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int lpcdec_(integer *bits, real *speech);
-extern int initlpcdec_(void);
-/* comlen contrl_ 12 */
-/*:ref: chanrd_ 14 5 4 4 4 4 4 */
-/*:ref: decode_ 14 7 4 4 4 4 4 6 6 */
-/*:ref: synths_ 14 6 4 4 6 6 6 4 */
-/*:ref: initdecode_ 14 0 */
-/*:ref: initsynths_ 14 0 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* Table of constant values */
-
-static integer c__10 = 10;
-
-/* ***************************************************************** */
-
-/* $Log: lpcdec.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:30:11  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:48  jaf
- * Initial revision
- *
- */
-/* Revision 1.1  1996/03/28  00:03:00  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/* Decode 54 bits to one frame of 180 speech samples. */
-
-/* Input: */
-/*  BITS   - 54 encoded bits, stored 1 per array element. */
-/*           Indices 1 through 53 read (SYNC bit ignored). */
-/* Output: */
-/*  SPEECH - Speech encoded as real values in the range [-1,+1]. */
-/*           Indices 1 through 180 written. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITLPCDEC. */
-
-/* Subroutine */ int lpc10_decode(integer *bits, real *speech,
-				  struct lpc10_decoder_state *st)
-{
-    integer irms, voice[2], pitch, ipitv;
-    extern /* Subroutine */ int decode_(integer *, integer *, integer *, 
-	    integer *, integer *, real *, real *, struct lpc10_decoder_state *);
-    real rc[10];
-    extern /* Subroutine */ int chanrd_(integer *, integer *, integer *, 
-	    integer *, integer *), synths_(integer *, 
-	    integer *, real *, real *, real *, integer *,
-					   struct lpc10_decoder_state *);
-    integer irc[10], len;
-    real rms;
-
-/* $Log: lpcdec.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:30:11  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:48  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Arguments */
-/* $Log: lpcdec.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:30:11  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:48  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/*       Local variables that need not be saved */
-/*       Uncoded speech parameters */
-/*       Coded speech parameters */
-/*       Others */
-/*       Local state */
-/*       None */
-    /* Parameter adjustments */
-    if (bits) {
-	--bits;
-	}
-    if (speech) {
-	--speech;
-	}
-
-    /* Function Body */
-
-    chanrd_(&c__10, &ipitv, &irms, irc, &bits[1]);
-    decode_(&ipitv, &irms, irc, voice, &pitch, &rms, rc, st);
-    synths_(voice, &pitch, &rms, rc, &speech[1], &len, st);
-    return 0;
-} /* lpcdec_ */
+/*
+
+$Log: lpcdec.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:30:11  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:48  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int lpcdec_(integer *bits, real *speech);
+extern int initlpcdec_(void);
+/* comlen contrl_ 12 */
+/*:ref: chanrd_ 14 5 4 4 4 4 4 */
+/*:ref: decode_ 14 7 4 4 4 4 4 6 6 */
+/*:ref: synths_ 14 6 4 4 6 6 6 4 */
+/*:ref: initdecode_ 14 0 */
+/*:ref: initsynths_ 14 0 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* Table of constant values */
+
+static integer c__10 = 10;
+
+/* ***************************************************************** */
+
+/* $Log: lpcdec.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:30:11  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:48  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.1  1996/03/28  00:03:00  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/* Decode 54 bits to one frame of 180 speech samples. */
+
+/* Input: */
+/*  BITS   - 54 encoded bits, stored 1 per array element. */
+/*           Indices 1 through 53 read (SYNC bit ignored). */
+/* Output: */
+/*  SPEECH - Speech encoded as real values in the range [-1,+1]. */
+/*           Indices 1 through 180 written. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITLPCDEC. */
+
+/* Subroutine */ int lpc10_decode(integer *bits, real *speech,
+				  struct lpc10_decoder_state *st)
+{
+    integer irms, voice[2], pitch, ipitv;
+    extern /* Subroutine */ int decode_(integer *, integer *, integer *, 
+	    integer *, integer *, real *, real *, struct lpc10_decoder_state *);
+    real rc[10];
+    extern /* Subroutine */ int chanrd_(integer *, integer *, integer *, 
+	    integer *, integer *), synths_(integer *, 
+	    integer *, real *, real *, real *, integer *,
+					   struct lpc10_decoder_state *);
+    integer irc[10], len;
+    real rms;
+
+/* $Log: lpcdec.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:30:11  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:48  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Arguments */
+/* $Log: lpcdec.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:30:11  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:48  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/*       Local variables that need not be saved */
+/*       Uncoded speech parameters */
+/*       Coded speech parameters */
+/*       Others */
+/*       Local state */
+/*       None */
+    /* Parameter adjustments */
+    if (bits) {
+	--bits;
+	}
+    if (speech) {
+	--speech;
+	}
+
+    /* Function Body */
+
+    chanrd_(&c__10, &ipitv, &irms, irc, &bits[1]);
+    decode_(&ipitv, &irms, irc, voice, &pitch, &rms, rc, st);
+    synths_(voice, &pitch, &rms, rc, &speech[1], &len, st);
+    return 0;
+} /* lpcdec_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/lpcenc.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/lpcenc.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/lpcenc.c	Fri Sep 21 14:49:14 2007
@@ -1,165 +1,165 @@
-/*
-
-$Log: lpcenc.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:31:21  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:44  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int lpcenc_(real *speech, integer *bits);
-extern int initlpcenc_(void);
-/*:ref: prepro_ 14 2 6 4 */
-/*:ref: analys_ 14 5 6 4 4 6 6 */
-/*:ref: encode_ 14 7 4 4 6 6 4 4 4 */
-/*:ref: chanwr_ 14 5 4 4 4 4 4 */
-/*:ref: initprepro_ 14 0 */
-/*:ref: initanalys_ 14 0 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Table of constant values */
-
-static integer c__180 = 180;
-static integer c__10 = 10;
-
-/* ***************************************************************** */
-
-/* $Log: lpcenc.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:31:21  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:44  jaf
- * Initial revision
- *
- */
-/* Revision 1.2  1996/03/28  00:01:22  jaf */
-/* Commented out some trace statements. */
-
-/* Revision 1.1  1996/03/28  00:00:27  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/* Encode one frame of 180 speech samples to 54 bits. */
-
-/* Input: */
-/*  SPEECH - Speech encoded as real values in the range [-1,+1]. */
-/*           Indices 1 through 180 read, and modified (by PREPRO). */
-/* Output: */
-/*  BITS   - 54 encoded bits, stored 1 per array element. */
-/*           Indices 1 through 54 written. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITLPCENC. */
-
-/* Subroutine */ int lpc10_encode(real *speech, integer *bits,
-				  struct lpc10_encoder_state *st)
-{
-    integer irms, voice[2], pitch, ipitv;
-    real rc[10];
-    extern /* Subroutine */ int encode_(integer *, integer *, real *, real *, 
-	    integer *, integer *, integer *), chanwr_(integer *, integer *, 
-	    integer *, integer *, integer *, struct lpc10_encoder_state *),
-            analys_(real *, integer *, 
-	    integer *, real *, real *, struct lpc10_encoder_state *),
-            prepro_(real *, integer *, struct lpc10_encoder_state *);
-    integer irc[10];
-    real rms;
-
-/*       Arguments */
-/* $Log: lpcenc.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:31:21  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Changed name of function from lpcenc_ to lpc10_encode, simply to make
- * all lpc10 functions have more consistent naming with each other.
- *
- * Revision 1.1  1996/08/19  22:31:44  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Local variables that need not be saved */
-/*       Uncoded speech parameters */
-/*       Coded speech parameters */
-/*       Local state */
-/*       None */
-    /* Parameter adjustments */
-    if (speech) {
-	--speech;
-	}
-    if (bits) {
-	--bits;
-	}
-
-    /* Function Body */
-    prepro_(&speech[1], &c__180, st);
-    analys_(&speech[1], voice, &pitch, &rms, rc, st);
-    encode_(voice, &pitch, &rms, rc, &ipitv, &irms, irc);
-    chanwr_(&c__10, &ipitv, &irms, irc, &bits[1], st);
-    return 0;
-} /* lpcenc_ */
+/*
+
+$Log: lpcenc.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:31:21  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:44  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int lpcenc_(real *speech, integer *bits);
+extern int initlpcenc_(void);
+/*:ref: prepro_ 14 2 6 4 */
+/*:ref: analys_ 14 5 6 4 4 6 6 */
+/*:ref: encode_ 14 7 4 4 6 6 4 4 4 */
+/*:ref: chanwr_ 14 5 4 4 4 4 4 */
+/*:ref: initprepro_ 14 0 */
+/*:ref: initanalys_ 14 0 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Table of constant values */
+
+static integer c__180 = 180;
+static integer c__10 = 10;
+
+/* ***************************************************************** */
+
+/* $Log: lpcenc.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:31:21  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:44  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.2  1996/03/28  00:01:22  jaf */
+/* Commented out some trace statements. */
+
+/* Revision 1.1  1996/03/28  00:00:27  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/* Encode one frame of 180 speech samples to 54 bits. */
+
+/* Input: */
+/*  SPEECH - Speech encoded as real values in the range [-1,+1]. */
+/*           Indices 1 through 180 read, and modified (by PREPRO). */
+/* Output: */
+/*  BITS   - 54 encoded bits, stored 1 per array element. */
+/*           Indices 1 through 54 written. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITLPCENC. */
+
+/* Subroutine */ int lpc10_encode(real *speech, integer *bits,
+				  struct lpc10_encoder_state *st)
+{
+    integer irms, voice[2], pitch, ipitv;
+    real rc[10];
+    extern /* Subroutine */ int encode_(integer *, integer *, real *, real *, 
+	    integer *, integer *, integer *), chanwr_(integer *, integer *, 
+	    integer *, integer *, integer *, struct lpc10_encoder_state *),
+            analys_(real *, integer *, 
+	    integer *, real *, real *, struct lpc10_encoder_state *),
+            prepro_(real *, integer *, struct lpc10_encoder_state *);
+    integer irc[10];
+    real rms;
+
+/*       Arguments */
+/* $Log: lpcenc.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:31:21  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Changed name of function from lpcenc_ to lpc10_encode, simply to make
+ * all lpc10 functions have more consistent naming with each other.
+ *
+ * Revision 1.1  1996/08/19  22:31:44  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Local variables that need not be saved */
+/*       Uncoded speech parameters */
+/*       Coded speech parameters */
+/*       Local state */
+/*       None */
+    /* Parameter adjustments */
+    if (speech) {
+	--speech;
+	}
+    if (bits) {
+	--bits;
+	}
+
+    /* Function Body */
+    prepro_(&speech[1], &c__180, st);
+    analys_(&speech[1], voice, &pitch, &rms, rc, st);
+    encode_(voice, &pitch, &rms, rc, &ipitv, &irms, irc);
+    chanwr_(&c__10, &ipitv, &irms, irc, &bits[1], st);
+    return 0;
+} /* lpcenc_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/lpcini.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/lpcini.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/lpcini.c	Fri Sep 21 14:49:14 2007
@@ -1,435 +1,435 @@
-/*
-
-$Log: lpcini.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.3  2002/10/10 05:29:04  robertj
-Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
-
-Revision 1.2  2001/02/24 14:00:10  rogerh
-Select the correct header file for malloc (stdlib.h or malloc.h)
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:35:41  jaf
- * Added functions for allocating and initializing lpc10_encoder_state
- * and lpc10_decoder_state structures.
- *
- * Revision 1.1  1996/08/19  22:31:40  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int lpcini_(void);
-/* comlen contrl_ 12 */
-/*:ref: initlpcenc_ 14 0 */
-/*:ref: initlpcdec_ 14 0 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* malloc is now defined in stdlib.h in serveral systems */
-#ifdef  HAS_STDLIB_H
-#       include <stdlib.h>
-#else
-#       ifdef   HAS_MALLOC_H
-#               include         <malloc.h>
-#       else
-                extern char * malloc();
-#       endif
-#endif
-
-/* Common Block Declarations */
-
-struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* ***************************************************************** */
-
-/* $Log: lpcini.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.3  2002/10/10 05:29:04  robertj
- * Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
- *
- * Revision 1.2  2001/02/24 14:00:10  rogerh
- * Select the correct header file for malloc (stdlib.h or malloc.h)
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:35:41  jaf
- * Added functions for allocating and initializing lpc10_encoder_state
- * and lpc10_decoder_state structures.
- *
- * Revision 1.1  1996/08/19  22:31:40  jaf
- * Initial revision
- *
- */
-/* Revision 1.1  1996/03/28  00:04:05  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/* Initialize COMMON block variables used by LPC-10 encoder and decoder, */
-/* and call initialization routines for both of them. */
-
-/* Subroutine */ int lpcini_(void)
-{
-
-/* $Log: lpcini.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.3  2002/10/10 05:29:04  robertj
- * Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
- *
- * Revision 1.2  2001/02/24 14:00:10  rogerh
- * Select the correct header file for malloc (stdlib.h or malloc.h)
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:35:41  jaf
- * Added functions for allocating and initializing lpc10_encoder_state
- * and lpc10_decoder_state structures.
- *
- * Revision 1.1  1996/08/19  22:31:40  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/* $Log: lpcini.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.3  2002/10/10 05:29:04  robertj
- * Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
- *
- * Revision 1.2  2001/02/24 14:00:10  rogerh
- * Select the correct header file for malloc (stdlib.h or malloc.h)
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:35:41  jaf
- * Added functions for allocating and initializing lpc10_encoder_state
- * and lpc10_decoder_state structures.
- *
- * Revision 1.1  1996/08/19  22:31:40  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-    contrl_1.order = 10;
-    contrl_1.lframe = 180;
-    contrl_1.corrp = TRUE_;
-    return 0;
-} /* lpcini_ */
-
-
-
-/* Allocate memory for, and initialize, the state that needs to be
-   kept from encoding one frame to the next for a single
-   LPC-10-compressed audio stream.  Return 0 if malloc fails,
-   otherwise return pointer to new structure. */
-
-struct lpc10_encoder_state *
-create_lpc10_encoder_state()
-{
-    struct lpc10_encoder_state *st;
-
-    st = (struct lpc10_encoder_state *)
-	malloc((unsigned) sizeof (struct lpc10_encoder_state));
-    if (st != 0) {
-	init_lpc10_encoder_state(st);
-    }
-    return (st);
-}
-
-
-
-void init_lpc10_encoder_state(struct lpc10_encoder_state *st)
-{
-    int i;
-
-    lpcini_();
-
-    /* State used only by function hp100 */
-    st->z11 = 0.0f;
-    st->z21 = 0.0f;
-    st->z12 = 0.0f;
-    st->z22 = 0.0f;
-    
-    /* State used by function analys */
-    for (i = 0; i < 540; i++) {
-	st->inbuf[i] = 0.0f;
-	st->pebuf[i] = 0.0f;
-    }
-    for (i = 0; i < 696; i++) {
-	st->lpbuf[i] = 0.0f;
-    }
-    for (i = 0; i < 312; i++) {
-	st->ivbuf[i] = 0.0f;
-    }
-    st->bias = 0.0f;
-    /* integer osbuf[10];  no initial value necessary */
-    st->osptr = 1;
-    for (i = 0; i < 3; i++) {
-	st->obound[i] = 0;
-    }
-    st->vwin[4] = 307;
-    st->vwin[5] = 462;
-    st->awin[4] = 307;
-    st->awin[5] = 462;
-    for (i = 0; i < 8; i++) {
-	st->voibuf[i] = 0;
-    }
-    for (i = 0; i < 3; i++) {
-	st->rmsbuf[i] = 0.0f;
-    }
-    for (i = 0; i < 30; i++) {
-	st->rcbuf[i] = 0.0f;
-    }
-    st->zpre = 0.0f;
-
-
-    /* State used by function onset */
-    st->n = 0.0f;
-    st->d__ = 1.0f;
-    /* real fpc;   no initial value necessary */
-    for (i = 0; i < 16; i++) {
-	st->l2buf[i] = 0.0f;
-    }
-    st->l2sum1 = 0.0f;
-    st->l2ptr1 = 1;
-    st->l2ptr2 = 9;
-    /* integer lasti;    no initial value necessary */
-    st->hyst = FALSE_;
-
-    /* State used by function voicin */
-    st->dither = 20.0f;
-    st->maxmin = 0.0f;
-    for (i = 0; i < 6; i++) {
-	st->voice[i] = 0.0f;
-    }
-    st->lbve = 3000;
-    st->fbve = 3000;
-    st->fbue = 187;
-    st->ofbue = 187;
-    st->sfbue = 187;
-    st->lbue = 93;
-    st->olbue = 93;
-    st->slbue = 93;
-    st->snr = (real) (st->fbve / st->fbue << 6);
-
-    /* State used by function dyptrk */
-    for (i = 0; i < 60; i++) {
-	st->s[i] = 0.0f;
-    }
-    for (i = 0; i < 120; i++) {
-	st->p[i] = 0;
-    }
-    st->ipoint = 0;
-    st->alphax = 0.0f;
-
-    /* State used by function chanwr */
-    st->isync = 0;
-
-}
-
-
-
-/* Allocate memory for, and initialize, the state that needs to be
-   kept from decoding one frame to the next for a single
-   LPC-10-compressed audio stream.  Return 0 if malloc fails,
-   otherwise return pointer to new structure. */
-
-struct lpc10_decoder_state *
-create_lpc10_decoder_state()
-{
-    struct lpc10_decoder_state *st;
-
-    st = (struct lpc10_decoder_state *)
-	malloc((unsigned) sizeof (struct lpc10_decoder_state));
-    if (st != 0) {
-	init_lpc10_decoder_state(st);
-    }
-    return (st);
-}
-
-
-
-void init_lpc10_decoder_state(struct lpc10_decoder_state *st)
-{
-    int i;
-
-    lpcini_();
-
-    /* State used by function decode */
-    st->iptold = 60;
-    st->first = TRUE_;
-    st->ivp2h = 0;
-    st->iovoic = 0;
-    st->iavgp = 60;
-    st->erate = 0;
-    for (i = 0; i < 30; i++) {
-	st->drc[i] = 0;
-    }
-    for (i = 0; i < 3; i++) {
-	st->dpit[i] = 0;
-	st->drms[i] = 0;
-    }
-
-    /* State used by function synths */
-    for (i = 0; i < 360; i++) {
-	st->buf[i] = 0.0f;
-    }
-    st->buflen = 180;
-
-    /* State used by function pitsyn */
-    /* ivoico;    no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    /* ipito;    no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    st->rmso = 1.0f;
-    /* rco[10];    no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    /* integer jsamp;    no initial value necessary as long as first_pitsyn is initially TRUE_ */
-    st->first_pitsyn = TRUE_;
-
-    /* State used by function bsynz */
-    st->ipo = 0;
-    for (i = 0; i < 166; i++) {
-	st->exc[i] = 0.0f;
-	st->exc2[i] = 0.0f;
-    }
-    st->lpi1 = 0.0f;
-    st->lpi2 = 0.0f;
-    st->lpi3 = 0.0f;
-    st->hpi1 = 0.0f;
-    st->hpi2 = 0.0f;
-    st->hpi3 = 0.0f;
-    st->rmso_bsynz = 0.0f;
-
-    /* State used by function random */
-    st->j = 2;
-    st->k = 5;
-    st->y[0] = (shortint) -21161;
-    st->y[1] = (shortint) -8478;
-    st->y[2] = (shortint) 30892;
-    st->y[3] = (shortint) -10216;
-    st->y[4] = (shortint) 16950;
-
-    /* State used by function deemp */
-    st->dei1 = 0.0f;
-    st->dei2 = 0.0f;
-    st->deo1 = 0.0f;
-    st->deo2 = 0.0f;
-    st->deo3 = 0.0f;
-}
+/*
+
+$Log: lpcini.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.3  2002/10/10 05:29:04  robertj
+Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
+
+Revision 1.2  2001/02/24 14:00:10  rogerh
+Select the correct header file for malloc (stdlib.h or malloc.h)
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:35:41  jaf
+ * Added functions for allocating and initializing lpc10_encoder_state
+ * and lpc10_decoder_state structures.
+ *
+ * Revision 1.1  1996/08/19  22:31:40  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int lpcini_(void);
+/* comlen contrl_ 12 */
+/*:ref: initlpcenc_ 14 0 */
+/*:ref: initlpcdec_ 14 0 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* malloc is now defined in stdlib.h in serveral systems */
+#ifdef  HAS_STDLIB_H
+#       include <stdlib.h>
+#else
+#       ifdef   HAS_MALLOC_H
+#               include         <malloc.h>
+#       else
+                extern char * malloc();
+#       endif
+#endif
+
+/* Common Block Declarations */
+
+struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* ***************************************************************** */
+
+/* $Log: lpcini.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.3  2002/10/10 05:29:04  robertj
+ * Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
+ *
+ * Revision 1.2  2001/02/24 14:00:10  rogerh
+ * Select the correct header file for malloc (stdlib.h or malloc.h)
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:35:41  jaf
+ * Added functions for allocating and initializing lpc10_encoder_state
+ * and lpc10_decoder_state structures.
+ *
+ * Revision 1.1  1996/08/19  22:31:40  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.1  1996/03/28  00:04:05  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/* Initialize COMMON block variables used by LPC-10 encoder and decoder, */
+/* and call initialization routines for both of them. */
+
+/* Subroutine */ int lpcini_(void)
+{
+
+/* $Log: lpcini.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.3  2002/10/10 05:29:04  robertj
+ * Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
+ *
+ * Revision 1.2  2001/02/24 14:00:10  rogerh
+ * Select the correct header file for malloc (stdlib.h or malloc.h)
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:35:41  jaf
+ * Added functions for allocating and initializing lpc10_encoder_state
+ * and lpc10_decoder_state structures.
+ *
+ * Revision 1.1  1996/08/19  22:31:40  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/* $Log: lpcini.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.3  2002/10/10 05:29:04  robertj
+ * Removed non-ansi-C comments to maximise portability, thanks Martijn Roest
+ *
+ * Revision 1.2  2001/02/24 14:00:10  rogerh
+ * Select the correct header file for malloc (stdlib.h or malloc.h)
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:35:41  jaf
+ * Added functions for allocating and initializing lpc10_encoder_state
+ * and lpc10_decoder_state structures.
+ *
+ * Revision 1.1  1996/08/19  22:31:40  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+    contrl_1.order = 10;
+    contrl_1.lframe = 180;
+    contrl_1.corrp = TRUE_;
+    return 0;
+} /* lpcini_ */
+
+
+
+/* Allocate memory for, and initialize, the state that needs to be
+   kept from encoding one frame to the next for a single
+   LPC-10-compressed audio stream.  Return 0 if malloc fails,
+   otherwise return pointer to new structure. */
+
+struct lpc10_encoder_state *
+create_lpc10_encoder_state()
+{
+    struct lpc10_encoder_state *st;
+
+    st = (struct lpc10_encoder_state *)
+	malloc((unsigned) sizeof (struct lpc10_encoder_state));
+    if (st != 0) {
+	init_lpc10_encoder_state(st);
+    }
+    return (st);
+}
+
+
+
+void init_lpc10_encoder_state(struct lpc10_encoder_state *st)
+{
+    int i;
+
+    lpcini_();
+
+    /* State used only by function hp100 */
+    st->z11 = 0.0f;
+    st->z21 = 0.0f;
+    st->z12 = 0.0f;
+    st->z22 = 0.0f;
+    
+    /* State used by function analys */
+    for (i = 0; i < 540; i++) {
+	st->inbuf[i] = 0.0f;
+	st->pebuf[i] = 0.0f;
+    }
+    for (i = 0; i < 696; i++) {
+	st->lpbuf[i] = 0.0f;
+    }
+    for (i = 0; i < 312; i++) {
+	st->ivbuf[i] = 0.0f;
+    }
+    st->bias = 0.0f;
+    /* integer osbuf[10];  no initial value necessary */
+    st->osptr = 1;
+    for (i = 0; i < 3; i++) {
+	st->obound[i] = 0;
+    }
+    st->vwin[4] = 307;
+    st->vwin[5] = 462;
+    st->awin[4] = 307;
+    st->awin[5] = 462;
+    for (i = 0; i < 8; i++) {
+	st->voibuf[i] = 0;
+    }
+    for (i = 0; i < 3; i++) {
+	st->rmsbuf[i] = 0.0f;
+    }
+    for (i = 0; i < 30; i++) {
+	st->rcbuf[i] = 0.0f;
+    }
+    st->zpre = 0.0f;
+
+
+    /* State used by function onset */
+    st->n = 0.0f;
+    st->d__ = 1.0f;
+    /* real fpc;   no initial value necessary */
+    for (i = 0; i < 16; i++) {
+	st->l2buf[i] = 0.0f;
+    }
+    st->l2sum1 = 0.0f;
+    st->l2ptr1 = 1;
+    st->l2ptr2 = 9;
+    /* integer lasti;    no initial value necessary */
+    st->hyst = FALSE_;
+
+    /* State used by function voicin */
+    st->dither = 20.0f;
+    st->maxmin = 0.0f;
+    for (i = 0; i < 6; i++) {
+	st->voice[i] = 0.0f;
+    }
+    st->lbve = 3000;
+    st->fbve = 3000;
+    st->fbue = 187;
+    st->ofbue = 187;
+    st->sfbue = 187;
+    st->lbue = 93;
+    st->olbue = 93;
+    st->slbue = 93;
+    st->snr = (real) (st->fbve / st->fbue << 6);
+
+    /* State used by function dyptrk */
+    for (i = 0; i < 60; i++) {
+	st->s[i] = 0.0f;
+    }
+    for (i = 0; i < 120; i++) {
+	st->p[i] = 0;
+    }
+    st->ipoint = 0;
+    st->alphax = 0.0f;
+
+    /* State used by function chanwr */
+    st->isync = 0;
+
+}
+
+
+
+/* Allocate memory for, and initialize, the state that needs to be
+   kept from decoding one frame to the next for a single
+   LPC-10-compressed audio stream.  Return 0 if malloc fails,
+   otherwise return pointer to new structure. */
+
+struct lpc10_decoder_state *
+create_lpc10_decoder_state()
+{
+    struct lpc10_decoder_state *st;
+
+    st = (struct lpc10_decoder_state *)
+	malloc((unsigned) sizeof (struct lpc10_decoder_state));
+    if (st != 0) {
+	init_lpc10_decoder_state(st);
+    }
+    return (st);
+}
+
+
+
+void init_lpc10_decoder_state(struct lpc10_decoder_state *st)
+{
+    int i;
+
+    lpcini_();
+
+    /* State used by function decode */
+    st->iptold = 60;
+    st->first = TRUE_;
+    st->ivp2h = 0;
+    st->iovoic = 0;
+    st->iavgp = 60;
+    st->erate = 0;
+    for (i = 0; i < 30; i++) {
+	st->drc[i] = 0;
+    }
+    for (i = 0; i < 3; i++) {
+	st->dpit[i] = 0;
+	st->drms[i] = 0;
+    }
+
+    /* State used by function synths */
+    for (i = 0; i < 360; i++) {
+	st->buf[i] = 0.0f;
+    }
+    st->buflen = 180;
+
+    /* State used by function pitsyn */
+    /* ivoico;    no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    /* ipito;    no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    st->rmso = 1.0f;
+    /* rco[10];    no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    /* integer jsamp;    no initial value necessary as long as first_pitsyn is initially TRUE_ */
+    st->first_pitsyn = TRUE_;
+
+    /* State used by function bsynz */
+    st->ipo = 0;
+    for (i = 0; i < 166; i++) {
+	st->exc[i] = 0.0f;
+	st->exc2[i] = 0.0f;
+    }
+    st->lpi1 = 0.0f;
+    st->lpi2 = 0.0f;
+    st->lpi3 = 0.0f;
+    st->hpi1 = 0.0f;
+    st->hpi2 = 0.0f;
+    st->hpi3 = 0.0f;
+    st->rmso_bsynz = 0.0f;
+
+    /* State used by function random */
+    st->j = 2;
+    st->k = 5;
+    st->y[0] = (shortint) -21161;
+    st->y[1] = (shortint) -8478;
+    st->y[2] = (shortint) 30892;
+    st->y[3] = (shortint) -10216;
+    st->y[4] = (shortint) 16950;
+
+    /* State used by function deemp */
+    st->dei1 = 0.0f;
+    st->dei2 = 0.0f;
+    st->deo1 = 0.0f;
+    st->deo2 = 0.0f;
+    st->deo3 = 0.0f;
+}

Modified: freeswitch/trunk/libs/codec/lpc10/src/lpfilt.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/lpfilt.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/lpfilt.c	Fri Sep 21 14:49:14 2007
@@ -1,114 +1,114 @@
-/*
-
-$Log: lpfilt.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:35  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* *********************************************************************** */
-
-/* 	LPFILT Version 55 */
-
-/* $Log: lpfilt.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:35  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/15  16:53:49  jaf */
-/* Just put comment header in standard form. */
-
-/* Revision 1.2  1996/03/12  23:58:06  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:47:44  jaf */
-/* Initial revision */
-
-
-/* *********************************************************************** */
-
-/*   31 Point Equiripple FIR Low-Pass Filter */
-/*     Linear phase, delay = 15 samples */
-
-/* 	Passband:  ripple = 0.25 dB, cutoff =  800 Hz */
-/* 	Stopband:  atten. =  40. dB, cutoff = 1240 Hz */
-
-/* Inputs: */
-/*  LEN    - Length of speech buffers */
-/*  NSAMP  - Number of samples to filter */
-/*  INBUF  - Input speech buffer */
-/*           Indices len-nsamp-29 through len are read. */
-/* Output: */
-/*  LPBUF  - Low passed speech buffer (must be different array than INBUF) */
-/*           Indices len+1-nsamp through len are written. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *
-	nsamp)
-{
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    integer j;
-    real t;
-
-/* 	Arguments */
-/* 	Parameters/constants */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       None */
-    /* Parameter adjustments */
-    --lpbuf;
-    --inbuf;
-
-    /* Function Body */
-    i__1 = *len;
-    for (j = *len + 1 - *nsamp; j <= i__1; ++j) {
-	t = (inbuf[j] + inbuf[j - 30]) * -.0097201988f;
-	t += (inbuf[j - 1] + inbuf[j - 29]) * -.0105179986f;
-	t += (inbuf[j - 2] + inbuf[j - 28]) * -.0083479648f;
-	t += (inbuf[j - 3] + inbuf[j - 27]) * 5.860774e-4f;
-	t += (inbuf[j - 4] + inbuf[j - 26]) * .0130892089f;
-	t += (inbuf[j - 5] + inbuf[j - 25]) * .0217052232f;
-	t += (inbuf[j - 6] + inbuf[j - 24]) * .0184161253f;
-	t += (inbuf[j - 7] + inbuf[j - 23]) * 3.39723e-4f;
-	t += (inbuf[j - 8] + inbuf[j - 22]) * -.0260797087f;
-	t += (inbuf[j - 9] + inbuf[j - 21]) * -.0455563702f;
-	t += (inbuf[j - 10] + inbuf[j - 20]) * -.040306855f;
-	t += (inbuf[j - 11] + inbuf[j - 19]) * 5.029835e-4f;
-	t += (inbuf[j - 12] + inbuf[j - 18]) * .0729262903f;
-	t += (inbuf[j - 13] + inbuf[j - 17]) * .1572008878f;
-	t += (inbuf[j - 14] + inbuf[j - 16]) * .2247288674f;
-	t += inbuf[j - 15] * .250535965f;
-	lpbuf[j] = t;
-    }
-    return 0;
-} /* lpfilt_ */
-
+/*
+
+$Log: lpfilt.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:35  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* *********************************************************************** */
+
+/* 	LPFILT Version 55 */
+
+/* $Log: lpfilt.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:35  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/15  16:53:49  jaf */
+/* Just put comment header in standard form. */
+
+/* Revision 1.2  1996/03/12  23:58:06  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:47:44  jaf */
+/* Initial revision */
+
+
+/* *********************************************************************** */
+
+/*   31 Point Equiripple FIR Low-Pass Filter */
+/*     Linear phase, delay = 15 samples */
+
+/* 	Passband:  ripple = 0.25 dB, cutoff =  800 Hz */
+/* 	Stopband:  atten. =  40. dB, cutoff = 1240 Hz */
+
+/* Inputs: */
+/*  LEN    - Length of speech buffers */
+/*  NSAMP  - Number of samples to filter */
+/*  INBUF  - Input speech buffer */
+/*           Indices len-nsamp-29 through len are read. */
+/* Output: */
+/*  LPBUF  - Low passed speech buffer (must be different array than INBUF) */
+/*           Indices len+1-nsamp through len are written. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *
+	nsamp)
+{
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    integer j;
+    real t;
+
+/* 	Arguments */
+/* 	Parameters/constants */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       None */
+    /* Parameter adjustments */
+    --lpbuf;
+    --inbuf;
+
+    /* Function Body */
+    i__1 = *len;
+    for (j = *len + 1 - *nsamp; j <= i__1; ++j) {
+	t = (inbuf[j] + inbuf[j - 30]) * -.0097201988f;
+	t += (inbuf[j - 1] + inbuf[j - 29]) * -.0105179986f;
+	t += (inbuf[j - 2] + inbuf[j - 28]) * -.0083479648f;
+	t += (inbuf[j - 3] + inbuf[j - 27]) * 5.860774e-4f;
+	t += (inbuf[j - 4] + inbuf[j - 26]) * .0130892089f;
+	t += (inbuf[j - 5] + inbuf[j - 25]) * .0217052232f;
+	t += (inbuf[j - 6] + inbuf[j - 24]) * .0184161253f;
+	t += (inbuf[j - 7] + inbuf[j - 23]) * 3.39723e-4f;
+	t += (inbuf[j - 8] + inbuf[j - 22]) * -.0260797087f;
+	t += (inbuf[j - 9] + inbuf[j - 21]) * -.0455563702f;
+	t += (inbuf[j - 10] + inbuf[j - 20]) * -.040306855f;
+	t += (inbuf[j - 11] + inbuf[j - 19]) * 5.029835e-4f;
+	t += (inbuf[j - 12] + inbuf[j - 18]) * .0729262903f;
+	t += (inbuf[j - 13] + inbuf[j - 17]) * .1572008878f;
+	t += (inbuf[j - 14] + inbuf[j - 16]) * .2247288674f;
+	t += inbuf[j - 15] * .250535965f;
+	lpbuf[j] = t;
+    }
+    return 0;
+} /* lpfilt_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/median.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/median.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/median.c	Fri Sep 21 14:49:14 2007
@@ -1,78 +1,78 @@
-/*
-
-$Log: median.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:31  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern integer median_(integer *d1, integer *d2, integer *d3);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************* */
-
-/* 	MEDIAN Version 45G */
-
-/* $Log: median.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:31  jaf
- * Initial revision
- *
- */
-/* Revision 1.2  1996/03/14  22:30:22  jaf */
-/* Just rearranged the comments and local variable declarations a bit. */
-
-/* Revision 1.1  1996/02/07 14:47:53  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*  Find median of three values */
-
-/* Input: */
-/*  D1,D2,D3 - Three input values */
-/* Output: */
-/*  MEDIAN - Median value */
-
-integer median_(integer *d1, integer *d2, integer *d3)
-{
-    /* System generated locals */
-    integer ret_val;
-
-/*       Arguments */
-    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;
-} /* median_ */
-
+/*
+
+$Log: median.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:31  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern integer median_(integer *d1, integer *d2, integer *d3);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************* */
+
+/* 	MEDIAN Version 45G */
+
+/* $Log: median.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:31  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.2  1996/03/14  22:30:22  jaf */
+/* Just rearranged the comments and local variable declarations a bit. */
+
+/* Revision 1.1  1996/02/07 14:47:53  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*  Find median of three values */
+
+/* Input: */
+/*  D1,D2,D3 - Three input values */
+/* Output: */
+/*  MEDIAN - Median value */
+
+integer median_(integer *d1, integer *d2, integer *d3)
+{
+    /* System generated locals */
+    integer ret_val;
+
+/*       Arguments */
+    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;
+} /* median_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/mload.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/mload.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/mload.c	Fri Sep 21 14:49:14 2007
@@ -1,152 +1,152 @@
-/*
-
-$Log: mload.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:25  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int mload_(integer *order, integer *awins, integer *awinf, real *speech, real *phi, real *psi);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ***************************************************************** */
-
-/* 	MLOAD Version 48 */
-
-/* $Log: mload.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:25  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/03/27  23:59:51  jaf */
-/* Added some more accurate comments about which indices of the argument */
-/* array SPEECH are read.  I thought that this might be the cause of a */
-/* problem I've been having, but it isn't. */
-
-/* Revision 1.4  1996/03/26  19:16:53  jaf */
-/* Commented out the code at the end that copied the lower triangular */
-/* half of PHI into the upper triangular half (making the resulting */
-/* matrix symmetric).  The upper triangular half was never used by later */
-/* code in subroutine ANALYS. */
-
-/* Revision 1.3  1996/03/18  21:16:00  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  16:47:41  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:48:01  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/* Load a covariance matrix. */
-
-/* Input: */
-/*  ORDER            - Analysis order */
-/*  AWINS            - Analysis window start */
-/*  AWINF            - Analysis window finish */
-/*  SPEECH(AWINF)    - Speech buffer */
-/*                     Indices MIN(AWINS, AWINF-(ORDER-1)) through */
-/*                             MAX(AWINF, AWINS+(ORDER-1)) read. */
-/*                     As long as (AWINF-AWINS) .GE. (ORDER-1), */
-/*                     this is just indices AWINS through AWINF. */
-/* Output: */
-/*  PHI(ORDER,ORDER) - Covariance matrix */
-/*                    Lower triangular half and diagonal written, and read.*/
-/*                     Upper triangular half untouched. */
-/*  PSI(ORDER)       - Prediction vector */
-/*                     Indices 1 through ORDER written, */
-/*                     and most are read after that. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int mload_(integer *order, integer *awins, integer *awinf, 
-	real *speech, real *phi, real *psi)
-{
-    /* System generated locals */
-    integer phi_dim1, phi_offset, i__1, i__2;
-
-    /* Local variables */
-    integer c__, i__, r__, start;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-/*   Load first column of triangular covariance matrix PHI */
-    /* Parameter adjustments */
-    --psi;
-    phi_dim1 = *order;
-    phi_offset = phi_dim1 + 1;
-    phi -= phi_offset;
-    --speech;
-
-    /* Function Body */
-    start = *awins + *order;
-    i__1 = *order;
-    for (r__ = 1; r__ <= i__1; ++r__) {
-	phi[r__ + phi_dim1] = 0.f;
-	i__2 = *awinf;
-	for (i__ = start; i__ <= i__2; ++i__) {
-	    phi[r__ + phi_dim1] += speech[i__ - 1] * speech[i__ - r__];
-	}
-    }
-/*   Load last element of vector PSI */
-    psi[*order] = 0.f;
-    i__1 = *awinf;
-    for (i__ = start; i__ <= i__1; ++i__) {
-	psi[*order] += speech[i__] * speech[i__ - *order];
-    }
-/*   End correct to get additional columns of PHI */
-    i__1 = *order;
-    for (r__ = 2; r__ <= i__1; ++r__) {
-	i__2 = r__;
-	for (c__ = 2; c__ <= i__2; ++c__) {
-	    phi[r__ + c__ * phi_dim1] = phi[r__ - 1 + (c__ - 1) * phi_dim1] - 
-		    speech[*awinf + 1 - r__] * speech[*awinf + 1 - c__] + 
-		    speech[start - r__] * speech[start - c__];
-	}
-    }
-/*   End correct to get additional elements of PSI */
-    i__1 = *order - 1;
-    for (c__ = 1; c__ <= i__1; ++c__) {
-	psi[c__] = phi[c__ + 1 + phi_dim1] - speech[start - 1] * speech[start 
-		- 1 - c__] + speech[*awinf] * speech[*awinf - c__];
-    }
-/*   Copy lower triangular section into upper (why bother?) */
-/*       I'm commenting this out, since the upper triangular half of PHI 
-*/
-/*       is never used by later code, unless a sufficiently high level of 
-*/
-/*       tracing is turned on. */
-/* 	DO R = 1,ORDER */
-/* 	   DO C = 1,R-1 */
-/* 	      PHI(C,R) = PHI(R,C) */
-/* 	   END DO */
-/* 	END DO */
-    return 0;
-} /* mload_ */
-
+/*
+
+$Log: mload.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:25  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int mload_(integer *order, integer *awins, integer *awinf, real *speech, real *phi, real *psi);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ***************************************************************** */
+
+/* 	MLOAD Version 48 */
+
+/* $Log: mload.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:25  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/03/27  23:59:51  jaf */
+/* Added some more accurate comments about which indices of the argument */
+/* array SPEECH are read.  I thought that this might be the cause of a */
+/* problem I've been having, but it isn't. */
+
+/* Revision 1.4  1996/03/26  19:16:53  jaf */
+/* Commented out the code at the end that copied the lower triangular */
+/* half of PHI into the upper triangular half (making the resulting */
+/* matrix symmetric).  The upper triangular half was never used by later */
+/* code in subroutine ANALYS. */
+
+/* Revision 1.3  1996/03/18  21:16:00  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  16:47:41  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:48:01  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/* Load a covariance matrix. */
+
+/* Input: */
+/*  ORDER            - Analysis order */
+/*  AWINS            - Analysis window start */
+/*  AWINF            - Analysis window finish */
+/*  SPEECH(AWINF)    - Speech buffer */
+/*                     Indices MIN(AWINS, AWINF-(ORDER-1)) through */
+/*                             MAX(AWINF, AWINS+(ORDER-1)) read. */
+/*                     As long as (AWINF-AWINS) .GE. (ORDER-1), */
+/*                     this is just indices AWINS through AWINF. */
+/* Output: */
+/*  PHI(ORDER,ORDER) - Covariance matrix */
+/*                    Lower triangular half and diagonal written, and read.*/
+/*                     Upper triangular half untouched. */
+/*  PSI(ORDER)       - Prediction vector */
+/*                     Indices 1 through ORDER written, */
+/*                     and most are read after that. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int mload_(integer *order, integer *awins, integer *awinf, 
+	real *speech, real *phi, real *psi)
+{
+    /* System generated locals */
+    integer phi_dim1, phi_offset, i__1, i__2;
+
+    /* Local variables */
+    integer c__, i__, r__, start;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+/*   Load first column of triangular covariance matrix PHI */
+    /* Parameter adjustments */
+    --psi;
+    phi_dim1 = *order;
+    phi_offset = phi_dim1 + 1;
+    phi -= phi_offset;
+    --speech;
+
+    /* Function Body */
+    start = *awins + *order;
+    i__1 = *order;
+    for (r__ = 1; r__ <= i__1; ++r__) {
+	phi[r__ + phi_dim1] = 0.f;
+	i__2 = *awinf;
+	for (i__ = start; i__ <= i__2; ++i__) {
+	    phi[r__ + phi_dim1] += speech[i__ - 1] * speech[i__ - r__];
+	}
+    }
+/*   Load last element of vector PSI */
+    psi[*order] = 0.f;
+    i__1 = *awinf;
+    for (i__ = start; i__ <= i__1; ++i__) {
+	psi[*order] += speech[i__] * speech[i__ - *order];
+    }
+/*   End correct to get additional columns of PHI */
+    i__1 = *order;
+    for (r__ = 2; r__ <= i__1; ++r__) {
+	i__2 = r__;
+	for (c__ = 2; c__ <= i__2; ++c__) {
+	    phi[r__ + c__ * phi_dim1] = phi[r__ - 1 + (c__ - 1) * phi_dim1] - 
+		    speech[*awinf + 1 - r__] * speech[*awinf + 1 - c__] + 
+		    speech[start - r__] * speech[start - c__];
+	}
+    }
+/*   End correct to get additional elements of PSI */
+    i__1 = *order - 1;
+    for (c__ = 1; c__ <= i__1; ++c__) {
+	psi[c__] = phi[c__ + 1 + phi_dim1] - speech[start - 1] * speech[start 
+		- 1 - c__] + speech[*awinf] * speech[*awinf - c__];
+    }
+/*   Copy lower triangular section into upper (why bother?) */
+/*       I'm commenting this out, since the upper triangular half of PHI 
+*/
+/*       is never used by later code, unless a sufficiently high level of 
+*/
+/*       tracing is turned on. */
+/* 	DO R = 1,ORDER */
+/* 	   DO C = 1,R-1 */
+/* 	      PHI(C,R) = PHI(R,C) */
+/* 	   END DO */
+/* 	END DO */
+    return 0;
+} /* mload_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/onset.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/onset.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/onset.c	Fri Sep 21 14:49:14 2007
@@ -1,317 +1,317 @@
-/*
-
-$Log: onset.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:37:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:31:18  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int onset_(real *pebuf, integer *osbuf, integer *osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *lframe, struct lpc10_encoder_state *st);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Table of constant values */
-
-static real c_b2 = 1.f;
-
-/* ****************************************************************** */
-
-/* 	ONSET Version 49 */
-
-/* $Log: onset.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:37:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:31:18  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/03/15  16:41:01  jaf */
-/* Just rearranged INITONSET assignment orders to be consistent with */
-/* order of DATA statements in ONSET. */
-
-/* Revision 1.4  1996/03/15  15:48:27  jaf */
-/* Changed some comments, and only reordered the DATA statements (their */
-/* meaning wasn't changed). */
-
-/* Revision 1.3  1996/03/14  23:53:06  jaf */
-/* Added an entry INITONSET that reinitializes the local state variables */
-/* of subroutine ONSET. */
-
-/* Rearranged quite a few comments, adding more explaining which */
-/* arguments were inputs, and how the modified ones can be changed. */
-
-/* Revision 1.2  1996/03/12  23:53:00  jaf */
-/* Lots of comments added about the local state of this subroutine that */
-/* must be saved from one invocation to the next. */
-
-/* One constant 180 replaced with LFRAME, which should be "more general", */
-/* even though it would probably require many more changes than this to */
-/* get this coder to work for other frame sizes. */
-
-/* Revision 1.1  1996/02/07 14:48:09  jaf */
-/* Initial revision */
-
-
-/* ****************************************************************** */
-
-/* 	Floating point version */
-
-
-/*   Detection of onsets in (or slightly preceding) the futuremost frame */
-/*   of speech. */
-
-
-/* Input: */
-/*  PEBUF(SBUFL:SBUFH)  - Preemphasized speech */
-/*                        Indices SBUFH-LFRAME through SBUFH are read. */
-/*  OSLEN  - Maximum number of onsets that can be stored in OSBUF. */
-/*  SBUFL, SBUFH        - Range of PEBUF */
-/*  LFRAME              - length of a frame, in samples */
-/* Input/Output: */
-/*  OSBUF(OSLEN) - Buffer which holds sorted indexes of onsets */
-/*                 Indices A through B are modified, where A */
-/*                 is the original value of OSPTR, and B is the final */
-/*                 value of OSPTR-1.  B is at most OSLEN. */
-/*  OSPTR        - Free pointer into OSBUF */
-/*                 Initial value should be .LE. OSLEN+1. */
-/*                 If so, final value grows by one for each new onset */
-/*                 found, and final value will be .LE. OSLEN+1. */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this subroutine, or */
-/* reinitialize its state for any other reason, call the ENTRY INITONSET. */
-
-/* Subroutine */ int onset_(real *pebuf, integer *osbuf, integer *
-	osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *
-	lframe, struct lpc10_encoder_state *st)
-{
-    /* Initialized data */
-
-    real *n;
-    real *d__;
-    real *l2buf;
-    real *l2sum1;
-    integer *l2ptr1;
-    integer *l2ptr2;
-    logical *hyst;
-
-    /* System generated locals */
-    integer pebuf_offset, i__1;
-    real r__1;
-
-    /* Builtin functions */
-    double r_sign(real *, real *);
-
-    /* Local variables */
-    integer i__;
-    integer *lasti;
-    real l2sum2;
-    real *fpc;
-
-/*       Arguments */
-/* $Log: onset.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:37:55  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:31:18  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Parameters/constants */
-/*   Parameters for onset detection algorithm: */
-/*    L2		Threshold for filtered slope of FPC (function of L2WID!) */
-/*    L2LAG	Lag due to both filters which compute filtered slope of FPC */
-/*    L2WID	Width of the filter which computes the slope of FPC */
-/*    OSHYST	The number of samples of slope(FPC) which must be below */
-/* 	        the threshold before a new onset may be declared. */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*   Variables */
-/*    N, D       Numerator and denominator of prediction filters */
-/*    FPC        Current prediction coefs */
-/*    L2BUF, L2SUM1, L2SUM2    State of slope filter */
-/*       The only "significant" change I've made is to change L2SUM2 out 
-*/
-/*       of the list of local variables that need to be saved, since it */
-/*       didn't need to be. */
-/*       L2SUM1 need not be, but avoiding saving it would require a small 
-*/
-/*       change to the body of the code.  See comments below for an */
-/*       example of how the code could be changed to avoid saving L2SUM1. 
-*/
-/*       FPC and LASTI are saved from one invocation to the next, but */
-/*       they are not given initial values.  This is acceptable, because 
-*/
-/*       FPC will be assigned a value the first time that this function */
-/*       is called after D is initialized to 1, since the formula to */
-/*       change D will not change it to 0 in one step, and the IF (D */
-/*       .NE. 0) statement will execute its THEN part, initializing FPC. 
-*/
-
-/*       LASTI's value will not be used until HYST is .TRUE., and */
-/*       whenever HYST is changed from its initial value of .FALSE., */
-/*       LASTI is assigned a value. */
-/*       In a C version of this coder, it would be nice if all of these */
-/*       saved things, in this and all other subroutines, could be stored 
-*/
-/*       in a single struct lpc10_coder_state_t, initialized with a call 
-*/
-/*       to a function like lpc10_init(&lpc10_coder_state).  In this way, 
-*/
-/*       a program that used these functions could conveniently alternate 
-*/
-/*       coding more than one distinct audio stream. */
-
-    n = &(st->n);
-    d__ = &(st->d__);
-    fpc = &(st->fpc);
-    l2buf = &(st->l2buf[0]);
-    l2sum1 = &(st->l2sum1);
-    l2ptr1 = &(st->l2ptr1);
-    l2ptr2 = &(st->l2ptr2);
-    lasti = &(st->lasti);
-    hyst = &(st->hyst);
-
-    /* Parameter adjustments */
-    if (osbuf) {
-	--osbuf;
-	}
-    if (pebuf) {
-	pebuf_offset = *sbufl;
-	pebuf -= pebuf_offset;
-	}
-
-    /* Function Body */
-
-/*       The following line subtracted a hard-coded "180" from LASTI, */
-/*       instead of using a variable like LFRAME or a constant like */
-/*       MAXFRM.  I changed it to LFRAME, for "generality". */
-    if (*hyst) {
-	*lasti -= *lframe;
-    }
-    i__1 = *sbufh;
-    for (i__ = *sbufh - *lframe + 1; i__ <= i__1; ++i__) {
-/*   Compute FPC; Use old FPC on divide by zero; Clamp FPC to +/- 1. 
-*/
-	*n = (pebuf[i__] * pebuf[i__ - 1] + (*n) * 63.f) / 64.f;
-/* Computing 2nd power */
-	r__1 = pebuf[i__ - 1];
-	*d__ = (r__1 * r__1 + (*d__) * 63.f) / 64.f;
-	if ((*d__) != 0.f) {
-	    if (abs(*n) > (*d__)) {
-		*fpc = (real)r_sign(&c_b2, n);
-	    } else {
-		*fpc = (*n) / (*d__);
-	    }
-	}
-/*   Filter FPC */
-/*       In order to allow L2SUM1 not to be saved from one invocation 
-of */
-/*       this subroutine to the next, one could change the sequence of
- */
-/*       assignments below, up to the IF statement, to the following. 
- In */
-/*       addition, the initial value of L2PTR2 should be changed to */
-/*       L2WID/2 instead of L2WID/2+1. */
-
-/*       L2SUM1 = L2BUF(L2PTR2) */
-/*       L2PTR2 = MOD(L2PTR2,L2WID)+1 */
-/*       L2SUM1 = L2SUM1 - L2BUF(L2PTR2) + FPC */
-/*       L2BUF(L2PTR2) = L2SUM1 */
-
-/* *       The following lines didn't change from the original: */
-/*       L2SUM2 = L2BUF(L2PTR1) */
-/*       L2BUF(L2PTR1) = FPC */
-/*       L2PTR1 = MOD(L2PTR1,L2WID)+1 */
-
-	l2sum2 = l2buf[*l2ptr1 - 1];
-	*l2sum1 = *l2sum1 - l2buf[*l2ptr2 - 1] + *fpc;
-	l2buf[*l2ptr2 - 1] = *l2sum1;
-	l2buf[*l2ptr1 - 1] = *fpc;
-	*l2ptr1 = *l2ptr1 % 16 + 1;
-	*l2ptr2 = *l2ptr2 % 16 + 1;
-	if ((r__1 = *l2sum1 - l2sum2, abs(r__1)) > 1.7f) {
-	    if (! (*hyst)) {
-/*   Ignore if buffer full */
-		if (*osptr <= *oslen) {
-		    osbuf[*osptr] = i__ - 9;
-		    ++(*osptr);
-		}
-		*hyst = TRUE_;
-	    }
-	    *lasti = i__;
-/*       After one onset detection, at least OSHYST sample times m
-ust go */
-/*       by before another is allowed to occur. */
-	} else if ((*hyst) && i__ - *lasti >= 10) {
-	    *hyst = FALSE_;
-	}
-    }
-    return 0;
-} /* onset_ */
+/*
+
+$Log: onset.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:37:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:31:18  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int onset_(real *pebuf, integer *osbuf, integer *osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *lframe, struct lpc10_encoder_state *st);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Table of constant values */
+
+static real c_b2 = 1.f;
+
+/* ****************************************************************** */
+
+/* 	ONSET Version 49 */
+
+/* $Log: onset.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:37:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:31:18  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/03/15  16:41:01  jaf */
+/* Just rearranged INITONSET assignment orders to be consistent with */
+/* order of DATA statements in ONSET. */
+
+/* Revision 1.4  1996/03/15  15:48:27  jaf */
+/* Changed some comments, and only reordered the DATA statements (their */
+/* meaning wasn't changed). */
+
+/* Revision 1.3  1996/03/14  23:53:06  jaf */
+/* Added an entry INITONSET that reinitializes the local state variables */
+/* of subroutine ONSET. */
+
+/* Rearranged quite a few comments, adding more explaining which */
+/* arguments were inputs, and how the modified ones can be changed. */
+
+/* Revision 1.2  1996/03/12  23:53:00  jaf */
+/* Lots of comments added about the local state of this subroutine that */
+/* must be saved from one invocation to the next. */
+
+/* One constant 180 replaced with LFRAME, which should be "more general", */
+/* even though it would probably require many more changes than this to */
+/* get this coder to work for other frame sizes. */
+
+/* Revision 1.1  1996/02/07 14:48:09  jaf */
+/* Initial revision */
+
+
+/* ****************************************************************** */
+
+/* 	Floating point version */
+
+
+/*   Detection of onsets in (or slightly preceding) the futuremost frame */
+/*   of speech. */
+
+
+/* Input: */
+/*  PEBUF(SBUFL:SBUFH)  - Preemphasized speech */
+/*                        Indices SBUFH-LFRAME through SBUFH are read. */
+/*  OSLEN  - Maximum number of onsets that can be stored in OSBUF. */
+/*  SBUFL, SBUFH        - Range of PEBUF */
+/*  LFRAME              - length of a frame, in samples */
+/* Input/Output: */
+/*  OSBUF(OSLEN) - Buffer which holds sorted indexes of onsets */
+/*                 Indices A through B are modified, where A */
+/*                 is the original value of OSPTR, and B is the final */
+/*                 value of OSPTR-1.  B is at most OSLEN. */
+/*  OSPTR        - Free pointer into OSBUF */
+/*                 Initial value should be .LE. OSLEN+1. */
+/*                 If so, final value grows by one for each new onset */
+/*                 found, and final value will be .LE. OSLEN+1. */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this subroutine, or */
+/* reinitialize its state for any other reason, call the ENTRY INITONSET. */
+
+/* Subroutine */ int onset_(real *pebuf, integer *osbuf, integer *
+	osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *
+	lframe, struct lpc10_encoder_state *st)
+{
+    /* Initialized data */
+
+    real *n;
+    real *d__;
+    real *l2buf;
+    real *l2sum1;
+    integer *l2ptr1;
+    integer *l2ptr2;
+    logical *hyst;
+
+    /* System generated locals */
+    integer pebuf_offset, i__1;
+    real r__1;
+
+    /* Builtin functions */
+    double r_sign(real *, real *);
+
+    /* Local variables */
+    integer i__;
+    integer *lasti;
+    real l2sum2;
+    real *fpc;
+
+/*       Arguments */
+/* $Log: onset.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:37:55  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:31:18  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Parameters/constants */
+/*   Parameters for onset detection algorithm: */
+/*    L2		Threshold for filtered slope of FPC (function of L2WID!) */
+/*    L2LAG	Lag due to both filters which compute filtered slope of FPC */
+/*    L2WID	Width of the filter which computes the slope of FPC */
+/*    OSHYST	The number of samples of slope(FPC) which must be below */
+/* 	        the threshold before a new onset may be declared. */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*   Variables */
+/*    N, D       Numerator and denominator of prediction filters */
+/*    FPC        Current prediction coefs */
+/*    L2BUF, L2SUM1, L2SUM2    State of slope filter */
+/*       The only "significant" change I've made is to change L2SUM2 out 
+*/
+/*       of the list of local variables that need to be saved, since it */
+/*       didn't need to be. */
+/*       L2SUM1 need not be, but avoiding saving it would require a small 
+*/
+/*       change to the body of the code.  See comments below for an */
+/*       example of how the code could be changed to avoid saving L2SUM1. 
+*/
+/*       FPC and LASTI are saved from one invocation to the next, but */
+/*       they are not given initial values.  This is acceptable, because 
+*/
+/*       FPC will be assigned a value the first time that this function */
+/*       is called after D is initialized to 1, since the formula to */
+/*       change D will not change it to 0 in one step, and the IF (D */
+/*       .NE. 0) statement will execute its THEN part, initializing FPC. 
+*/
+
+/*       LASTI's value will not be used until HYST is .TRUE., and */
+/*       whenever HYST is changed from its initial value of .FALSE., */
+/*       LASTI is assigned a value. */
+/*       In a C version of this coder, it would be nice if all of these */
+/*       saved things, in this and all other subroutines, could be stored 
+*/
+/*       in a single struct lpc10_coder_state_t, initialized with a call 
+*/
+/*       to a function like lpc10_init(&lpc10_coder_state).  In this way, 
+*/
+/*       a program that used these functions could conveniently alternate 
+*/
+/*       coding more than one distinct audio stream. */
+
+    n = &(st->n);
+    d__ = &(st->d__);
+    fpc = &(st->fpc);
+    l2buf = &(st->l2buf[0]);
+    l2sum1 = &(st->l2sum1);
+    l2ptr1 = &(st->l2ptr1);
+    l2ptr2 = &(st->l2ptr2);
+    lasti = &(st->lasti);
+    hyst = &(st->hyst);
+
+    /* Parameter adjustments */
+    if (osbuf) {
+	--osbuf;
+	}
+    if (pebuf) {
+	pebuf_offset = *sbufl;
+	pebuf -= pebuf_offset;
+	}
+
+    /* Function Body */
+
+/*       The following line subtracted a hard-coded "180" from LASTI, */
+/*       instead of using a variable like LFRAME or a constant like */
+/*       MAXFRM.  I changed it to LFRAME, for "generality". */
+    if (*hyst) {
+	*lasti -= *lframe;
+    }
+    i__1 = *sbufh;
+    for (i__ = *sbufh - *lframe + 1; i__ <= i__1; ++i__) {
+/*   Compute FPC; Use old FPC on divide by zero; Clamp FPC to +/- 1. 
+*/
+	*n = (pebuf[i__] * pebuf[i__ - 1] + (*n) * 63.f) / 64.f;
+/* Computing 2nd power */
+	r__1 = pebuf[i__ - 1];
+	*d__ = (r__1 * r__1 + (*d__) * 63.f) / 64.f;
+	if ((*d__) != 0.f) {
+	    if (abs(*n) > (*d__)) {
+		*fpc = (real)r_sign(&c_b2, n);
+	    } else {
+		*fpc = (*n) / (*d__);
+	    }
+	}
+/*   Filter FPC */
+/*       In order to allow L2SUM1 not to be saved from one invocation 
+of */
+/*       this subroutine to the next, one could change the sequence of
+ */
+/*       assignments below, up to the IF statement, to the following. 
+ In */
+/*       addition, the initial value of L2PTR2 should be changed to */
+/*       L2WID/2 instead of L2WID/2+1. */
+
+/*       L2SUM1 = L2BUF(L2PTR2) */
+/*       L2PTR2 = MOD(L2PTR2,L2WID)+1 */
+/*       L2SUM1 = L2SUM1 - L2BUF(L2PTR2) + FPC */
+/*       L2BUF(L2PTR2) = L2SUM1 */
+
+/* *       The following lines didn't change from the original: */
+/*       L2SUM2 = L2BUF(L2PTR1) */
+/*       L2BUF(L2PTR1) = FPC */
+/*       L2PTR1 = MOD(L2PTR1,L2WID)+1 */
+
+	l2sum2 = l2buf[*l2ptr1 - 1];
+	*l2sum1 = *l2sum1 - l2buf[*l2ptr2 - 1] + *fpc;
+	l2buf[*l2ptr2 - 1] = *l2sum1;
+	l2buf[*l2ptr1 - 1] = *fpc;
+	*l2ptr1 = *l2ptr1 % 16 + 1;
+	*l2ptr2 = *l2ptr2 % 16 + 1;
+	if ((r__1 = *l2sum1 - l2sum2, abs(r__1)) > 1.7f) {
+	    if (! (*hyst)) {
+/*   Ignore if buffer full */
+		if (*osptr <= *oslen) {
+		    osbuf[*osptr] = i__ - 9;
+		    ++(*osptr);
+		}
+		*hyst = TRUE_;
+	    }
+	    *lasti = i__;
+/*       After one onset detection, at least OSHYST sample times m
+ust go */
+/*       by before another is allowed to occur. */
+	} else if ((*hyst) && i__ - *lasti >= 10) {
+	    *hyst = FALSE_;
+	}
+    }
+    return 0;
+} /* onset_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/pitsyn.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/pitsyn.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/pitsyn.c	Fri Sep 21 14:49:14 2007
@@ -1,567 +1,567 @@
-/*
-
-$Log: pitsyn.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:40:12  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:31:12  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio, struct lpc10_decoder_state *st);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ***************************************************************** */
-
-/* 	PITSYN Version 53 */
-
-/* $Log: pitsyn.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:40:12  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:31:12  jaf
- * Initial revision
- *
- */
-/* Revision 1.2  1996/03/25  18:49:07  jaf */
-/* Added commments about which indices of array arguments are read or */
-/* written. */
-
-/* Rearranged local variable declarations to indicate which need to be */
-/* saved from one invocation to the next.  Added entry INITPITSYN to */
-/* reinitialize local state variables, if desired. */
-
-/* Added lots of comments about proving that the maximum number of pitch */
-/* periods (NOUT) that can be returned is 16.  The call to STOP that */
-/* could happen if NOUT got too large was removed as a result. */
-
-/* Also proved that the total number of samples returned from N calls, */
-/* each with identical values of LFRAME, will always be in the range */
-/* N*LFRAME-MAXPIT+1 to N*LFRAME. */
-
-/* Revision 1.1  1996/02/07 14:48:18  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/*   Synthesize a single pitch epoch */
-
-/* Input: */
-/*  ORDER  - Synthesis order (number of RC's) */
-/*  VOICE  - Half frame voicing decisions */
-/*           Indices 1 through 2 read. */
-/*  LFRAME - Length of speech buffer */
-/* Input/Output: */
-/*  PITCH  - Pitch */
-/*           This value should be in the range MINPIT (20) to MAXPIT */
-/*           (156), inclusive. */
-/*           PITCH can be modified under some conditions. */
-/*  RMS    - Energy  (can be modified) */
-/*           RMS is changed to 1 if the value passed in is less than 1. */
-/*  RC     - Reflection coefficients */
-/*           Indices 1 through ORDER can be temporarily overwritten with */
-/*           RCO, and then replaced with original values, under some */
-/*           conditions. */
-/* Output: */
-/*  IVUV   - Pitch epoch voicing decisions */
-/*           Indices (I) of IVUV, IPITI, and RMSI are written, */
-/*           and indices (J,I) of RCI are written, */
-/*           where I ranges from 1 to NOUT, and J ranges from 1 to ORDER. */
-/*  IPITI  - Pitch epoch length */
-/*  RMSI   - Pitch epoch energy */
-/*  RCI    - Pitch epoch RC's */
-/*  NOUT   - Number of pitch periods in this frame */
-/*           This is at least 0, at least 1 if MAXPIT .LT. LFRAME (this */
-/*           is currently true on every call), and can never be more than */
-/*           (LFRAME+MAXPIT-1)/PITCH, which is currently 16 with */
-/*           LFRAME=180, MAXPIT=156, and PITCH .GE. 20, as SYNTHS */
-/*           guarantees when it calls this subroutine. */
-/*  RATIO  - Previous to present energy ratio */
-/*           Always assigned a value. */
-
-/* Subroutine */ int pitsyn_(integer *order, integer *voice, 
-	integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, 
-	integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio,
-			       struct lpc10_decoder_state *st)
-{
-    /* Initialized data */
-
-    real *rmso;
-    logical *first;
-
-    /* System generated locals */
-    integer rci_dim1, rci_offset, i__1, i__2;
-    real r__1;
-
-    /* Builtin functions */
-    double log(doublereal), exp(doublereal);
-
-    /* Local variables */
-    real alrn, alro, yarc[10], prop;
-    integer i__, j, vflag, jused, lsamp;
-    integer *jsamp;
-    real slope;
-    integer *ipito;
-    real uvpit;
-    integer ip, nl, ivoice;
-    integer *ivoico;
-    integer istart;
-    real *rco;
-    real xxy;
-
-/*       Arguments */
-/* $Log: pitsyn.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:40:12  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:31:12  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Local variables that need not be saved */
-/*       LSAMP is initialized in the IF (FIRST) THEN clause, but it is */
-/*       not used the first time through, and it is given a value before 
-*/
-/*       use whenever FIRST is .FALSE., so it appears unnecessary to */
-/*       assign it a value when FIRST is .TRUE. */
-/*       Local state */
-/* FIRST  - .TRUE. only on first call to PITSYN. */
-/* IVOICO - Previous VOICE(2) value. */
-/* IPITO  - Previous PITCH value. */
-/* RMSO   - Previous RMS value. */
-/* RCO    - Previous RC values. */
-
-/* JSAMP  - If this routine is called N times with identical values of */
-/*          LFRAME, then the total length of all pitch periods returned */
-/*          is always N*LFRAME-JSAMP, and JSAMP is always in the range 0 
-*/
-/*          to MAXPIT-1 (see below for why this is so).  Thus JSAMP is */
-/*          the number of samples "left over" from the previous call to */
-/*          PITSYN, that haven't been "used" in a pitch period returned */
-/*          from this subroutine.  Every time this subroutine is called, 
-*/
-/*          it returns pitch periods with a total length of at most */
-/*          LFRAME+JSAMP. */
-
-/* IVOICO, IPITO, RCO, and JSAMP need not be assigned an initial value */
-/* with a DATA statement, because they are always initialized on the */
-/* first call to PITSYN. */
-
-/* FIRST and RMSO should be initialized with DATA statements, because */
-/* even on the first call, they are used before being initialized. */
-    /* Parameter adjustments */
-    if (rc) {
-	--rc;
-	}
-    if (rci) {
-	rci_dim1 = *order;
-	rci_offset = rci_dim1 + 1;
-	rci -= rci_offset;
-	}
-    if (voice) {
-	--voice;
-	}
-    if (ivuv) {
-	--ivuv;
-	}
-    if (ipiti) {
-	--ipiti;
-	}
-    if (rmsi) {
-	--rmsi;
-	}
-
-    /* Function Body */
-    ivoico = &(st->ivoico);
-    ipito = &(st->ipito);
-    rmso = &(st->rmso);
-    rco = &(st->rco[0]);
-    jsamp = &(st->jsamp);
-    first = &(st->first_pitsyn);
-
-    if (*rms < 1.f) {
-	*rms = 1.f;
-    }
-    if (*rmso < 1.f) {
-	*rmso = 1.f;
-    }
-    uvpit = 0.f;
-    *ratio = *rms / (*rmso + 8.f);
-    if (*first) {
-	lsamp = 0;
-	ivoice = voice[2];
-	if (ivoice == 0) {
-	    *pitch = *lframe / 4;
-	}
-	*nout = *lframe / *pitch;
-	*jsamp = *lframe - *nout * *pitch;
-
-/*          SYNTHS only calls this subroutine with PITCH in the range 
-20 */
-/*          to 156.  LFRAME = MAXFRM = 180, so NOUT is somewhere in th
-e */
-/*          range 1 to 9. */
-
-/*          JSAMP is "LFRAME mod PITCH", so it is in the range 0 to */
-/*          (PITCH-1), or 0 to MAXPIT-1=155, after the first call. */
-
-	i__1 = *nout;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    i__2 = *order;
-	    for (j = 1; j <= i__2; ++j) {
-		rci[j + i__ * rci_dim1] = rc[j];
-	    }
-	    ivuv[i__] = ivoice;
-	    ipiti[i__] = *pitch;
-	    rmsi[i__] = *rms;
-	}
-	*first = FALSE_;
-    } else {
-	vflag = 0;
-	lsamp = *lframe + *jsamp;
-	slope = (*pitch - *ipito) / (real) lsamp;
-	*nout = 0;
-	jused = 0;
-	istart = 1;
-	if (voice[1] == *ivoico && voice[2] == voice[1]) {
-	    if (voice[2] == 0) {
-/* SSUV - -   0  ,  0  ,  0 */
-		*pitch = *lframe / 4;
-		*ipito = *pitch;
-		if (*ratio > 8.f) {
-		    *rmso = *rms;
-		}
-	    }
-/* SSVC - -   1  ,  1  ,  1 */
-	    slope = (*pitch - *ipito) / (real) lsamp;
-	    ivoice = voice[2];
-	} else {
-	    if (*ivoico != 1) {
-		if (*ivoico == voice[1]) {
-/* UV2VC2 - -  0  ,  0  ,  1 */
-		    nl = lsamp - *lframe / 4;
-		} else {
-/* UV2VC1 - -  0  ,  1  ,  1 */
-		    nl = lsamp - *lframe * 3 / 4;
-		}
-		ipiti[1] = nl / 2;
-		ipiti[2] = nl - ipiti[1];
-		ivuv[1] = 0;
-		ivuv[2] = 0;
-		rmsi[1] = *rmso;
-		rmsi[2] = *rmso;
-		i__1 = *order;
-		for (i__ = 1; i__ <= i__1; ++i__) {
-		    rci[i__ + rci_dim1] = rco[i__ - 1];
-		    rci[i__ + (rci_dim1 << 1)] = rco[i__ - 1];
-		    rco[i__ - 1] = rc[i__];
-		}
-		slope = 0.f;
-		*nout = 2;
-		*ipito = *pitch;
-		jused = nl;
-		istart = nl + 1;
-		ivoice = 1;
-	    } else {
-		if (*ivoico != voice[1]) {
-/* VC2UV1 - -   1  ,  0  ,  0 */
-		    lsamp = *lframe / 4 + *jsamp;
-		} else {
-/* VC2UV2 - -   1  ,  1  ,  0 */
-		    lsamp = *lframe * 3 / 4 + *jsamp;
-		}
-		i__1 = *order;
-		for (i__ = 1; i__ <= i__1; ++i__) {
-		    yarc[i__ - 1] = rc[i__];
-		    rc[i__] = rco[i__ - 1];
-		}
-		ivoice = 1;
-		slope = 0.f;
-		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 th
-e */
-/* 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 tha
-t */
-/* 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 1
-1? */
-
-/* Note that all of the 180 values in the table are really 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 ISTA
-RT */
-/* to LSAMP. */
-
-	while(TRUE_) {
-
-/*             JUSED is the total length of all pitch periods curr
-ently */
-/*             in the output arrays, in samples. */
-
-/*             An invariant of the DO I = ISTART,LSAMP loop below,
- under */
-/*             the condition that IP is always in the range 1 thro
-ugh */
-/*             MAXPIT, is: */
-
-/*             (I - MAXPIT) .LE. JUSED .LE. (I-1) */
-
-/*             Note that the final value of I is LSAMP+1, so that 
-after */
-/*             the DO loop is complete, we know: */
-
-/*             (LSAMP - MAXPIT + 1) .LE. JUSED .LE. LSAMP */
-
-	    i__1 = lsamp;
-	    for (i__ = istart; i__ <= i__1; ++i__) {
-		r__1 = *ipito + slope * i__;
-		ip = (integer)(r__1 + .5f);
-		if (uvpit != 0.f) {
-		    ip = (integer)uvpit;
-		}
-		if (ip <= i__ - jused) {
-		    ++(*nout);
-
-/*                   The following check is no longer nece
-ssary, now that */
-/*                   we can prove that NOUT will never go 
-over 16. */
-
-/* 		    IF (NOUT .GT. 16) STOP 'PITSYN: too many epochs' 
-*/
-
-		    ipiti[*nout] = ip;
-		    *pitch = ip;
-		    ivuv[*nout] = ivoice;
-		    jused += ip;
-		    prop = (jused - ip / 2) / (real) lsamp;
-		    i__2 = *order;
-		    for (j = 1; j <= i__2; ++j) {
-			alro = (real)log((rco[j - 1] + 1) / (1 - rco[j - 1]));
-			alrn = (real)log((rc[j] + 1) / (1 - rc[j]));
-			xxy = alro + prop * (alrn - alro);
-			xxy = (real)exp(xxy);
-			rci[j + *nout * rci_dim1] = (xxy - 1) / (xxy + 1);
-		    }
-		    rmsi[*nout] = (real)(log(*rmso) + prop * (log(*rms) - log(*rmso)));
-		    rmsi[*nout] = (real)exp(rmsi[*nout]);
-		}
-	    }
-	    if (vflag != 1) {
-		goto L100;
-	    }
-
-/*             I want to prove what range UVPIT must lie in after 
-the */
-/*             assignments to it below.  To do this, I must determ
-ine */
-/*             what range (LSAMP-ISTART) must lie in, after the */
-/*             assignments to ISTART and LSAMP below. */
-
-/*             Let oldLSAMP be the value of LSAMP at this point in
- the */
-/*             execution.  This is 135+JSAMP in state 110, or 45+J
-SAMP in */
-/*             states 100 or 101. */
-
-/*             Given the loop invariant on JUSED above, we know th
-at: */
-
-/*             (oldLSAMP - MAXPIT + 1) .LE. JUSED .LE. oldLSAMP */
-
-/*             ISTART is one more than this. */
-
-/*             Let newLSAMP be the value assigned to LSAMP below. 
- This */
-/*             is 180+JSAMP.  Thus (newLSAMP-oldLSAMP) is either 4
-5 or */
-/*             135, depending on the state. */
-
-/*             Thus, the range of newLSAMP-ISTART is: */
-
-/*             (newLSAMP-(oldLSAMP+1)) .LE. newLSAMP-ISTART */
-/*             .LE. (newLSAMP-(oldLSAMP - MAXPIT + 2)) */
-
-/*             or: */
-
-/*             46 .LE. newLSAMP-ISTART .LE. 133+MAXPIT .EQ. 289 */
-
-/*             Therefore, UVPIT is in the range 23 to 144 after th
-e first */
-/*             assignment to UVPIT below, and after the conditiona
-l */
-/*             assignment, it is in the range 23 to 90. */
-
-/*             The important thing is that it is in the range 20 t
-o 156, */
-/*             so that in the loop above, IP is always in this ran
-ge. */
-
-	    vflag = 0;
-	    istart = jused + 1;
-	    lsamp = *lframe + *jsamp;
-	    slope = 0.f;
-	    ivoice = 0;
-	    uvpit = (real) ((lsamp - istart) / 2);
-	    if (uvpit > 90.f) {
-		uvpit /= 2;
-	    }
-	    *rmso = *rms;
-	    i__1 = *order;
-	    for (i__ = 1; i__ <= i__1; ++i__) {
-		rc[i__] = yarc[i__ - 1];
-		rco[i__ - 1] = yarc[i__ - 1];
-	    }
-	}
-L100:
-	*jsamp = lsamp - jused;
-    }
-/*       Given that the maximum pitch period MAXPIT .LT. LFRAME (this is 
-*/
-/*       currently true on every call, since SYNTHS always sets */
-/*       LFRAME=180), NOUT will always be .GE. 1 at this point. */
-    if (*nout != 0) {
-	*ivoico = voice[2];
-	*ipito = *pitch;
-	*rmso = *rms;
-	i__1 = *order;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    rco[i__ - 1] = rc[i__];
-	}
-    }
-    return 0;
-} /* pitsyn_ */
+/*
+
+$Log: pitsyn.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:40:12  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:31:12  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio, struct lpc10_decoder_state *st);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ***************************************************************** */
+
+/* 	PITSYN Version 53 */
+
+/* $Log: pitsyn.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:40:12  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:31:12  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.2  1996/03/25  18:49:07  jaf */
+/* Added commments about which indices of array arguments are read or */
+/* written. */
+
+/* Rearranged local variable declarations to indicate which need to be */
+/* saved from one invocation to the next.  Added entry INITPITSYN to */
+/* reinitialize local state variables, if desired. */
+
+/* Added lots of comments about proving that the maximum number of pitch */
+/* periods (NOUT) that can be returned is 16.  The call to STOP that */
+/* could happen if NOUT got too large was removed as a result. */
+
+/* Also proved that the total number of samples returned from N calls, */
+/* each with identical values of LFRAME, will always be in the range */
+/* N*LFRAME-MAXPIT+1 to N*LFRAME. */
+
+/* Revision 1.1  1996/02/07 14:48:18  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/*   Synthesize a single pitch epoch */
+
+/* Input: */
+/*  ORDER  - Synthesis order (number of RC's) */
+/*  VOICE  - Half frame voicing decisions */
+/*           Indices 1 through 2 read. */
+/*  LFRAME - Length of speech buffer */
+/* Input/Output: */
+/*  PITCH  - Pitch */
+/*           This value should be in the range MINPIT (20) to MAXPIT */
+/*           (156), inclusive. */
+/*           PITCH can be modified under some conditions. */
+/*  RMS    - Energy  (can be modified) */
+/*           RMS is changed to 1 if the value passed in is less than 1. */
+/*  RC     - Reflection coefficients */
+/*           Indices 1 through ORDER can be temporarily overwritten with */
+/*           RCO, and then replaced with original values, under some */
+/*           conditions. */
+/* Output: */
+/*  IVUV   - Pitch epoch voicing decisions */
+/*           Indices (I) of IVUV, IPITI, and RMSI are written, */
+/*           and indices (J,I) of RCI are written, */
+/*           where I ranges from 1 to NOUT, and J ranges from 1 to ORDER. */
+/*  IPITI  - Pitch epoch length */
+/*  RMSI   - Pitch epoch energy */
+/*  RCI    - Pitch epoch RC's */
+/*  NOUT   - Number of pitch periods in this frame */
+/*           This is at least 0, at least 1 if MAXPIT .LT. LFRAME (this */
+/*           is currently true on every call), and can never be more than */
+/*           (LFRAME+MAXPIT-1)/PITCH, which is currently 16 with */
+/*           LFRAME=180, MAXPIT=156, and PITCH .GE. 20, as SYNTHS */
+/*           guarantees when it calls this subroutine. */
+/*  RATIO  - Previous to present energy ratio */
+/*           Always assigned a value. */
+
+/* Subroutine */ int pitsyn_(integer *order, integer *voice, 
+	integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, 
+	integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio,
+			       struct lpc10_decoder_state *st)
+{
+    /* Initialized data */
+
+    real *rmso;
+    logical *first;
+
+    /* System generated locals */
+    integer rci_dim1, rci_offset, i__1, i__2;
+    real r__1;
+
+    /* Builtin functions */
+    double log(doublereal), exp(doublereal);
+
+    /* Local variables */
+    real alrn, alro, yarc[10], prop;
+    integer i__, j, vflag, jused, lsamp;
+    integer *jsamp;
+    real slope;
+    integer *ipito;
+    real uvpit;
+    integer ip, nl, ivoice;
+    integer *ivoico;
+    integer istart;
+    real *rco;
+    real xxy;
+
+/*       Arguments */
+/* $Log: pitsyn.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:40:12  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:31:12  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Local variables that need not be saved */
+/*       LSAMP is initialized in the IF (FIRST) THEN clause, but it is */
+/*       not used the first time through, and it is given a value before 
+*/
+/*       use whenever FIRST is .FALSE., so it appears unnecessary to */
+/*       assign it a value when FIRST is .TRUE. */
+/*       Local state */
+/* FIRST  - .TRUE. only on first call to PITSYN. */
+/* IVOICO - Previous VOICE(2) value. */
+/* IPITO  - Previous PITCH value. */
+/* RMSO   - Previous RMS value. */
+/* RCO    - Previous RC values. */
+
+/* JSAMP  - If this routine is called N times with identical values of */
+/*          LFRAME, then the total length of all pitch periods returned */
+/*          is always N*LFRAME-JSAMP, and JSAMP is always in the range 0 
+*/
+/*          to MAXPIT-1 (see below for why this is so).  Thus JSAMP is */
+/*          the number of samples "left over" from the previous call to */
+/*          PITSYN, that haven't been "used" in a pitch period returned */
+/*          from this subroutine.  Every time this subroutine is called, 
+*/
+/*          it returns pitch periods with a total length of at most */
+/*          LFRAME+JSAMP. */
+
+/* IVOICO, IPITO, RCO, and JSAMP need not be assigned an initial value */
+/* with a DATA statement, because they are always initialized on the */
+/* first call to PITSYN. */
+
+/* FIRST and RMSO should be initialized with DATA statements, because */
+/* even on the first call, they are used before being initialized. */
+    /* Parameter adjustments */
+    if (rc) {
+	--rc;
+	}
+    if (rci) {
+	rci_dim1 = *order;
+	rci_offset = rci_dim1 + 1;
+	rci -= rci_offset;
+	}
+    if (voice) {
+	--voice;
+	}
+    if (ivuv) {
+	--ivuv;
+	}
+    if (ipiti) {
+	--ipiti;
+	}
+    if (rmsi) {
+	--rmsi;
+	}
+
+    /* Function Body */
+    ivoico = &(st->ivoico);
+    ipito = &(st->ipito);
+    rmso = &(st->rmso);
+    rco = &(st->rco[0]);
+    jsamp = &(st->jsamp);
+    first = &(st->first_pitsyn);
+
+    if (*rms < 1.f) {
+	*rms = 1.f;
+    }
+    if (*rmso < 1.f) {
+	*rmso = 1.f;
+    }
+    uvpit = 0.f;
+    *ratio = *rms / (*rmso + 8.f);
+    if (*first) {
+	lsamp = 0;
+	ivoice = voice[2];
+	if (ivoice == 0) {
+	    *pitch = *lframe / 4;
+	}
+	*nout = *lframe / *pitch;
+	*jsamp = *lframe - *nout * *pitch;
+
+/*          SYNTHS only calls this subroutine with PITCH in the range 
+20 */
+/*          to 156.  LFRAME = MAXFRM = 180, so NOUT is somewhere in th
+e */
+/*          range 1 to 9. */
+
+/*          JSAMP is "LFRAME mod PITCH", so it is in the range 0 to */
+/*          (PITCH-1), or 0 to MAXPIT-1=155, after the first call. */
+
+	i__1 = *nout;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    i__2 = *order;
+	    for (j = 1; j <= i__2; ++j) {
+		rci[j + i__ * rci_dim1] = rc[j];
+	    }
+	    ivuv[i__] = ivoice;
+	    ipiti[i__] = *pitch;
+	    rmsi[i__] = *rms;
+	}
+	*first = FALSE_;
+    } else {
+	vflag = 0;
+	lsamp = *lframe + *jsamp;
+	slope = (*pitch - *ipito) / (real) lsamp;
+	*nout = 0;
+	jused = 0;
+	istart = 1;
+	if (voice[1] == *ivoico && voice[2] == voice[1]) {
+	    if (voice[2] == 0) {
+/* SSUV - -   0  ,  0  ,  0 */
+		*pitch = *lframe / 4;
+		*ipito = *pitch;
+		if (*ratio > 8.f) {
+		    *rmso = *rms;
+		}
+	    }
+/* SSVC - -   1  ,  1  ,  1 */
+	    slope = (*pitch - *ipito) / (real) lsamp;
+	    ivoice = voice[2];
+	} else {
+	    if (*ivoico != 1) {
+		if (*ivoico == voice[1]) {
+/* UV2VC2 - -  0  ,  0  ,  1 */
+		    nl = lsamp - *lframe / 4;
+		} else {
+/* UV2VC1 - -  0  ,  1  ,  1 */
+		    nl = lsamp - *lframe * 3 / 4;
+		}
+		ipiti[1] = nl / 2;
+		ipiti[2] = nl - ipiti[1];
+		ivuv[1] = 0;
+		ivuv[2] = 0;
+		rmsi[1] = *rmso;
+		rmsi[2] = *rmso;
+		i__1 = *order;
+		for (i__ = 1; i__ <= i__1; ++i__) {
+		    rci[i__ + rci_dim1] = rco[i__ - 1];
+		    rci[i__ + (rci_dim1 << 1)] = rco[i__ - 1];
+		    rco[i__ - 1] = rc[i__];
+		}
+		slope = 0.f;
+		*nout = 2;
+		*ipito = *pitch;
+		jused = nl;
+		istart = nl + 1;
+		ivoice = 1;
+	    } else {
+		if (*ivoico != voice[1]) {
+/* VC2UV1 - -   1  ,  0  ,  0 */
+		    lsamp = *lframe / 4 + *jsamp;
+		} else {
+/* VC2UV2 - -   1  ,  1  ,  0 */
+		    lsamp = *lframe * 3 / 4 + *jsamp;
+		}
+		i__1 = *order;
+		for (i__ = 1; i__ <= i__1; ++i__) {
+		    yarc[i__ - 1] = rc[i__];
+		    rc[i__] = rco[i__ - 1];
+		}
+		ivoice = 1;
+		slope = 0.f;
+		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 th
+e */
+/* 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 tha
+t */
+/* 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 1
+1? */
+
+/* Note that all of the 180 values in the table are really 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 ISTA
+RT */
+/* to LSAMP. */
+
+	while(TRUE_) {
+
+/*             JUSED is the total length of all pitch periods curr
+ently */
+/*             in the output arrays, in samples. */
+
+/*             An invariant of the DO I = ISTART,LSAMP loop below,
+ under */
+/*             the condition that IP is always in the range 1 thro
+ugh */
+/*             MAXPIT, is: */
+
+/*             (I - MAXPIT) .LE. JUSED .LE. (I-1) */
+
+/*             Note that the final value of I is LSAMP+1, so that 
+after */
+/*             the DO loop is complete, we know: */
+
+/*             (LSAMP - MAXPIT + 1) .LE. JUSED .LE. LSAMP */
+
+	    i__1 = lsamp;
+	    for (i__ = istart; i__ <= i__1; ++i__) {
+		r__1 = *ipito + slope * i__;
+		ip = (integer)(r__1 + .5f);
+		if (uvpit != 0.f) {
+		    ip = (integer)uvpit;
+		}
+		if (ip <= i__ - jused) {
+		    ++(*nout);
+
+/*                   The following check is no longer nece
+ssary, now that */
+/*                   we can prove that NOUT will never go 
+over 16. */
+
+/* 		    IF (NOUT .GT. 16) STOP 'PITSYN: too many epochs' 
+*/
+
+		    ipiti[*nout] = ip;
+		    *pitch = ip;
+		    ivuv[*nout] = ivoice;
+		    jused += ip;
+		    prop = (jused - ip / 2) / (real) lsamp;
+		    i__2 = *order;
+		    for (j = 1; j <= i__2; ++j) {
+			alro = (real)log((rco[j - 1] + 1) / (1 - rco[j - 1]));
+			alrn = (real)log((rc[j] + 1) / (1 - rc[j]));
+			xxy = alro + prop * (alrn - alro);
+			xxy = (real)exp(xxy);
+			rci[j + *nout * rci_dim1] = (xxy - 1) / (xxy + 1);
+		    }
+		    rmsi[*nout] = (real)(log(*rmso) + prop * (log(*rms) - log(*rmso)));
+		    rmsi[*nout] = (real)exp(rmsi[*nout]);
+		}
+	    }
+	    if (vflag != 1) {
+		goto L100;
+	    }
+
+/*             I want to prove what range UVPIT must lie in after 
+the */
+/*             assignments to it below.  To do this, I must determ
+ine */
+/*             what range (LSAMP-ISTART) must lie in, after the */
+/*             assignments to ISTART and LSAMP below. */
+
+/*             Let oldLSAMP be the value of LSAMP at this point in
+ the */
+/*             execution.  This is 135+JSAMP in state 110, or 45+J
+SAMP in */
+/*             states 100 or 101. */
+
+/*             Given the loop invariant on JUSED above, we know th
+at: */
+
+/*             (oldLSAMP - MAXPIT + 1) .LE. JUSED .LE. oldLSAMP */
+
+/*             ISTART is one more than this. */
+
+/*             Let newLSAMP be the value assigned to LSAMP below. 
+ This */
+/*             is 180+JSAMP.  Thus (newLSAMP-oldLSAMP) is either 4
+5 or */
+/*             135, depending on the state. */
+
+/*             Thus, the range of newLSAMP-ISTART is: */
+
+/*             (newLSAMP-(oldLSAMP+1)) .LE. newLSAMP-ISTART */
+/*             .LE. (newLSAMP-(oldLSAMP - MAXPIT + 2)) */
+
+/*             or: */
+
+/*             46 .LE. newLSAMP-ISTART .LE. 133+MAXPIT .EQ. 289 */
+
+/*             Therefore, UVPIT is in the range 23 to 144 after th
+e first */
+/*             assignment to UVPIT below, and after the conditiona
+l */
+/*             assignment, it is in the range 23 to 90. */
+
+/*             The important thing is that it is in the range 20 t
+o 156, */
+/*             so that in the loop above, IP is always in this ran
+ge. */
+
+	    vflag = 0;
+	    istart = jused + 1;
+	    lsamp = *lframe + *jsamp;
+	    slope = 0.f;
+	    ivoice = 0;
+	    uvpit = (real) ((lsamp - istart) / 2);
+	    if (uvpit > 90.f) {
+		uvpit /= 2;
+	    }
+	    *rmso = *rms;
+	    i__1 = *order;
+	    for (i__ = 1; i__ <= i__1; ++i__) {
+		rc[i__] = yarc[i__ - 1];
+		rco[i__ - 1] = yarc[i__ - 1];
+	    }
+	}
+L100:
+	*jsamp = lsamp - jused;
+    }
+/*       Given that the maximum pitch period MAXPIT .LT. LFRAME (this is 
+*/
+/*       currently true on every call, since SYNTHS always sets */
+/*       LFRAME=180), NOUT will always be .GE. 1 at this point. */
+    if (*nout != 0) {
+	*ivoico = voice[2];
+	*ipito = *pitch;
+	*rmso = *rms;
+	i__1 = *order;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    rco[i__ - 1] = rc[i__];
+	}
+    }
+    return 0;
+} /* pitsyn_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/placea.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/placea.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/placea.c	Fri Sep 21 14:49:14 2007
@@ -1,225 +1,225 @@
-/*
-
-$Log: placea.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2001/10/16 21:21:14  yurik
-Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:07  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int placea_(integer *ipitch, integer *voibuf, integer *obound, integer *af, integer *vwin, integer *awin, integer *ewin, integer *lframe, integer *maxwin);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* *********************************************************************** */
-
-/* 	PLACEA Version 48 */
-
-/* $Log: placea.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2001/10/16 21:21:14  yurik
- * Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:07  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/03/19  20:41:55  jaf */
-/* Added some conditions satisfied by the output values in EWIN. */
-
-/* Revision 1.4  1996/03/19  20:24:17  jaf */
-/* Added some conditions satisfied by the output values in AWIN. */
-
-/* Revision 1.3  1996/03/18  21:40:04  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  16:43:09  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:48:31  jaf */
-/* Initial revision */
-
-
-/* *********************************************************************** */
-/* Input: */
-/*  IPITCH */
-/*  VOIBUF */
-/*          Indices (2,AF-2), (1,AF-1), (2,AF-1), (1,AF), and (2,AF) read.*/
-/*           All other indices untouched. */
-/*  OBOUND */
-/*  AF */
-/*  VWIN */
-/*           Indices (1,AF) and (2,AF) read. */
-/*           All other indices untouched. */
-/*  LFRAME */
-/*  MAXWIN */
-/* Input/Output: */
-/*  AWIN */
-/*           Index (1,AF-1) read. */
-/*           Indices (1,AF) and (2,AF) written, and then read. */
-/*           All other indices untouched. */
-/*           In all cases (except possibly one), the final values will */
-/*           satisfy the condition: AWIN(2,AF)-AWIN(1,AF)+1 = MAXWIN. */
-/*           In that other case, */
-/*           AWIN(1,AF)=VWIN(1,AF) and AWIN(2,AF)=VWIN(2,AF). */
-/* Output: */
-/*  EWIN */
-/*           Indices (1,AF) and (2,AF) written. */
-/*           All other indices untouched. */
-/*           In all cases, the final values will satisfy the condition: */
-/*           AWIN(1,AF) .LE. EWIN(1,AF) .LE. EWIN(2,AF) .LE. AWIN(2,AF) */
-/*           In other words, the energy window is a sub-window of */
-/*           the analysis window. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int placea_(integer *ipitch, integer *voibuf, integer *
-	obound, integer *af, integer *vwin, integer *awin, integer *ewin, 
-	integer *lframe, integer *maxwin)
-{
-    /* System generated locals */
-    real r__1;
-
-    /* Builtin functions */
-    integer i_nint(real *);
-
-    /* Local variables */
-    logical allv, winv;
-    integer i__, j, k, l, hrange;
-    logical ephase;
-    integer lrange;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-    /* Parameter adjustments */
-    ewin -= 3;
-    awin -= 3;
-    vwin -= 3;
-    --voibuf;
-
-    /* Function Body */
-    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) + 2] == 1;
-    allv = allv && voibuf[((*af - 1) << 1) + 1] == 1;
-    allv = allv && voibuf[((*af - 1) << 1) + 2] == 1;
-    allv = allv && voibuf[(*af << 1) + 1] == 1;
-    allv = allv && voibuf[(*af << 1) + 2] == 1;
-    winv = voibuf[(*af << 1) + 1] == 1 || voibuf[(*af << 1) + 2] == 1;
-    if (allv || winv && *obound == 0) {
-/* APHASE:  Phase synchronous window placement. */
-/* Get minimum lower index of the window. */
-	i__ = (lrange + *ipitch - 1 - awin[((*af - 1) << 1) + 1]) / *ipitch;
-	i__ *= *ipitch;
-	i__ += awin[((*af - 1) << 1) + 1];
-/* L = the actual length of this frame's analysis window. */
-	l = *maxwin;
-/* Calculate the location where a perfectly centered window would star
-t. */
-	k = (vwin[(*af << 1) + 1] + vwin[(*af << 1) + 2] + 1 - l) / 2;
-/* Choose the actual location to be the pitch multiple closest to this
-. */
-	r__1 = (real) (k - i__) / *ipitch;
-	awin[(*af << 1) + 1] = i__ + i_nint(&r__1) * *ipitch;
-	awin[(*af << 1) + 2] = awin[(*af << 1) + 1] + l - 1;
-/* If there is an onset bounding the right of the voicing window and t
-he */
-/* analysis window overlaps that, then move the analysis window backwa
-rd */
-/* to avoid this onset. */
-	if (*obound >= 2 && awin[(*af << 1) + 2] > vwin[(*af << 1) + 2]) {
-	    awin[(*af << 1) + 1] -= *ipitch;
-	    awin[(*af << 1) + 2] -= *ipitch;
-	}
-/* Similarly for the left of the voicing window. */
-	if ((*obound == 1 || *obound == 3) && awin[(*af << 1) + 1] < vwin[(*
-		af << 1) + 1]) {
-	    awin[(*af << 1) + 1] += *ipitch;
-	    awin[(*af << 1) + 2] += *ipitch;
-	}
-/* If this placement puts the analysis window above HRANGE, then */
-/* move it backward an integer number of pitch periods. */
-	while(awin[(*af << 1) + 2] > hrange) {
-	    awin[(*af << 1) + 1] -= *ipitch;
-	    awin[(*af << 1) + 2] -= *ipitch;
-	}
-/* Similarly if the placement puts the analysis window below LRANGE. 
-*/
-	while(awin[(*af << 1) + 1] < lrange) {
-	    awin[(*af << 1) + 1] += *ipitch;
-	    awin[(*af << 1) + 2] += *ipitch;
-	}
-/* Make Energy window be phase-synchronous. */
-	ephase = TRUE_;
-/* Case 3 */
-    } else {
-	awin[(*af << 1) + 1] = vwin[(*af << 1) + 1];
-	awin[(*af << 1) + 2] = vwin[(*af << 1) + 2];
-	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 clos
-e*/
-/* as possible to onsets. */
-    j = (awin[(*af << 1) + 2] - awin[(*af << 1) + 1] + 1) / *ipitch * *ipitch;
-    if (j == 0 || ! winv) {
-	ewin[(*af << 1) + 1] = vwin[(*af << 1) + 1];
-	ewin[(*af << 1) + 2] = vwin[(*af << 1) + 2];
-    } else if (! ephase && *obound == 2) {
-	ewin[(*af << 1) + 1] = awin[(*af << 1) + 2] - j + 1;
-	ewin[(*af << 1) + 2] = awin[(*af << 1) + 2];
-    } else {
-	ewin[(*af << 1) + 1] = awin[(*af << 1) + 1];
-	ewin[(*af << 1) + 2] = awin[(*af << 1) + 1] + j - 1;
-    }
-    return 0;
-} /* placea_ */
-
+/*
+
+$Log: placea.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2001/10/16 21:21:14  yurik
+Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:07  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int placea_(integer *ipitch, integer *voibuf, integer *obound, integer *af, integer *vwin, integer *awin, integer *ewin, integer *lframe, integer *maxwin);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* *********************************************************************** */
+
+/* 	PLACEA Version 48 */
+
+/* $Log: placea.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2001/10/16 21:21:14  yurik
+ * Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:07  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/03/19  20:41:55  jaf */
+/* Added some conditions satisfied by the output values in EWIN. */
+
+/* Revision 1.4  1996/03/19  20:24:17  jaf */
+/* Added some conditions satisfied by the output values in AWIN. */
+
+/* Revision 1.3  1996/03/18  21:40:04  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  16:43:09  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:48:31  jaf */
+/* Initial revision */
+
+
+/* *********************************************************************** */
+/* Input: */
+/*  IPITCH */
+/*  VOIBUF */
+/*          Indices (2,AF-2), (1,AF-1), (2,AF-1), (1,AF), and (2,AF) read.*/
+/*           All other indices untouched. */
+/*  OBOUND */
+/*  AF */
+/*  VWIN */
+/*           Indices (1,AF) and (2,AF) read. */
+/*           All other indices untouched. */
+/*  LFRAME */
+/*  MAXWIN */
+/* Input/Output: */
+/*  AWIN */
+/*           Index (1,AF-1) read. */
+/*           Indices (1,AF) and (2,AF) written, and then read. */
+/*           All other indices untouched. */
+/*           In all cases (except possibly one), the final values will */
+/*           satisfy the condition: AWIN(2,AF)-AWIN(1,AF)+1 = MAXWIN. */
+/*           In that other case, */
+/*           AWIN(1,AF)=VWIN(1,AF) and AWIN(2,AF)=VWIN(2,AF). */
+/* Output: */
+/*  EWIN */
+/*           Indices (1,AF) and (2,AF) written. */
+/*           All other indices untouched. */
+/*           In all cases, the final values will satisfy the condition: */
+/*           AWIN(1,AF) .LE. EWIN(1,AF) .LE. EWIN(2,AF) .LE. AWIN(2,AF) */
+/*           In other words, the energy window is a sub-window of */
+/*           the analysis window. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int placea_(integer *ipitch, integer *voibuf, integer *
+	obound, integer *af, integer *vwin, integer *awin, integer *ewin, 
+	integer *lframe, integer *maxwin)
+{
+    /* System generated locals */
+    real r__1;
+
+    /* Builtin functions */
+    integer i_nint(real *);
+
+    /* Local variables */
+    logical allv, winv;
+    integer i__, j, k, l, hrange;
+    logical ephase;
+    integer lrange;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+    /* Parameter adjustments */
+    ewin -= 3;
+    awin -= 3;
+    vwin -= 3;
+    --voibuf;
+
+    /* Function Body */
+    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) + 2] == 1;
+    allv = allv && voibuf[((*af - 1) << 1) + 1] == 1;
+    allv = allv && voibuf[((*af - 1) << 1) + 2] == 1;
+    allv = allv && voibuf[(*af << 1) + 1] == 1;
+    allv = allv && voibuf[(*af << 1) + 2] == 1;
+    winv = voibuf[(*af << 1) + 1] == 1 || voibuf[(*af << 1) + 2] == 1;
+    if (allv || winv && *obound == 0) {
+/* APHASE:  Phase synchronous window placement. */
+/* Get minimum lower index of the window. */
+	i__ = (lrange + *ipitch - 1 - awin[((*af - 1) << 1) + 1]) / *ipitch;
+	i__ *= *ipitch;
+	i__ += awin[((*af - 1) << 1) + 1];
+/* L = the actual length of this frame's analysis window. */
+	l = *maxwin;
+/* Calculate the location where a perfectly centered window would star
+t. */
+	k = (vwin[(*af << 1) + 1] + vwin[(*af << 1) + 2] + 1 - l) / 2;
+/* Choose the actual location to be the pitch multiple closest to this
+. */
+	r__1 = (real) (k - i__) / *ipitch;
+	awin[(*af << 1) + 1] = i__ + i_nint(&r__1) * *ipitch;
+	awin[(*af << 1) + 2] = awin[(*af << 1) + 1] + l - 1;
+/* If there is an onset bounding the right of the voicing window and t
+he */
+/* analysis window overlaps that, then move the analysis window backwa
+rd */
+/* to avoid this onset. */
+	if (*obound >= 2 && awin[(*af << 1) + 2] > vwin[(*af << 1) + 2]) {
+	    awin[(*af << 1) + 1] -= *ipitch;
+	    awin[(*af << 1) + 2] -= *ipitch;
+	}
+/* Similarly for the left of the voicing window. */
+	if ((*obound == 1 || *obound == 3) && awin[(*af << 1) + 1] < vwin[(*
+		af << 1) + 1]) {
+	    awin[(*af << 1) + 1] += *ipitch;
+	    awin[(*af << 1) + 2] += *ipitch;
+	}
+/* If this placement puts the analysis window above HRANGE, then */
+/* move it backward an integer number of pitch periods. */
+	while(awin[(*af << 1) + 2] > hrange) {
+	    awin[(*af << 1) + 1] -= *ipitch;
+	    awin[(*af << 1) + 2] -= *ipitch;
+	}
+/* Similarly if the placement puts the analysis window below LRANGE. 
+*/
+	while(awin[(*af << 1) + 1] < lrange) {
+	    awin[(*af << 1) + 1] += *ipitch;
+	    awin[(*af << 1) + 2] += *ipitch;
+	}
+/* Make Energy window be phase-synchronous. */
+	ephase = TRUE_;
+/* Case 3 */
+    } else {
+	awin[(*af << 1) + 1] = vwin[(*af << 1) + 1];
+	awin[(*af << 1) + 2] = vwin[(*af << 1) + 2];
+	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 clos
+e*/
+/* as possible to onsets. */
+    j = (awin[(*af << 1) + 2] - awin[(*af << 1) + 1] + 1) / *ipitch * *ipitch;
+    if (j == 0 || ! winv) {
+	ewin[(*af << 1) + 1] = vwin[(*af << 1) + 1];
+	ewin[(*af << 1) + 2] = vwin[(*af << 1) + 2];
+    } else if (! ephase && *obound == 2) {
+	ewin[(*af << 1) + 1] = awin[(*af << 1) + 2] - j + 1;
+	ewin[(*af << 1) + 2] = awin[(*af << 1) + 2];
+    } else {
+	ewin[(*af << 1) + 1] = awin[(*af << 1) + 1];
+	ewin[(*af << 1) + 2] = awin[(*af << 1) + 1] + j - 1;
+    }
+    return 0;
+} /* placea_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/placev.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/placev.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/placev.c	Fri Sep 21 14:49:14 2007
@@ -1,264 +1,264 @@
-/*
-
-$Log: placev.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2001/10/16 21:21:14  yurik
-Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:31:02  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int placev_(integer *osbuf, integer *osptr, integer *oslen, integer *obound, integer *vwin, integer *af, integer *lframe, integer *minwin, integer *maxwin, integer *dvwinl, integer *dvwinh);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ****************************************************************** */
-
-/* 	PLACEV Version 48 */
-
-/* $Log: placev.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2001/10/16 21:21:14  yurik
- * Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:31:02  jaf
- * Initial revision
- *
- */
-/* Revision 1.6  1996/03/19  20:42:19  jaf */
-/* Added some conditions satisfied by the output values in VWIN. */
-
-/* Revision 1.5  1996/03/19  18:37:56  jaf */
-/* Strengthened the specification of which indices of VWIN are read and */
-/* written. */
-
-/* Revision 1.4  1996/03/15  16:38:33  jaf */
-/* One tiny comment added. */
-
-/* Revision 1.3  1996/03/15  16:36:13  jaf */
-/* Added comments giving In/Out status of arguments. */
-
-/* Revision 1.2  1996/03/12  23:56:01  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:48:39  jaf */
-/* Initial revision */
-
-
-/* ****************************************************************** */
-
-/* Input: */
-/*  OSBUF	Buffer which holds sorted indexes of onsets */
-/*       	I believe that only indices 1 through OSPTR-1 can be read. */
-/*  OSLEN */
-/*  OSPTR	Free pointer into OSBUF */
-/*  AF */
-/*  LFRAME */
-/*  MINWIN */
-/*  MAXWIN */
-/*  DVWINL */
-/*  DVWINH	(This argument is never used.  Should it be?) */
-/* Input/Output: */
-/*  VWIN		Buffer of Voicing Window Positions (Modified) */
-/*       	Index (2,AF-1) is read. */
-/*       	Indices (1,AF) and (2,AF) are written, */
-/*       	and then possibly read. */
-/*       	All other indices are unused. */
-/*              In all cases, the final values will satsify the condition:*/
-/*               VWIN(2,AF)-VWIN(1,AF)+1 .LE. MAXWIN */
-/*               I'm not certain yet, but they may also satisfy: */
-/*               MINWIN .LE. VWIN(2,AF)-VWIN(1,AF)+1 */
-/* Output: */
-/*  OBOUND	This variable is set by this procedure and used */
-/* 		in placing analysis windows (PLACEA).  Bit 1 */
-/* 		indicates whether an onset bounds the left side */
-/* 		of the voicing window, and bit 2 indicates whether */
-/* 		an onset bounds the right side of the voicing window. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int placev_(integer *osbuf, integer *osptr, integer *oslen, 
-	integer *obound, integer *vwin, integer *af, integer *lframe, integer 
-	*minwin, integer *maxwin, integer *dvwinl, integer *dvwinh)
-{
-    /* System generated locals */
-    integer i__1, i__2;
-
-    /* Local variables */
-    logical crit;
-    integer i__, q, osptr1, hrange, lrange;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-/*   Variables */
-/*    LRANGE, HRANGE  Range in which window is placed */
-/*    OSPTR1     OSPTR excluding samples in 3F */
-/*       Local state */
-/*       None */
-/*   Voicing Window Placement */
-
-/*         __________________ __________________ ______________ */
-/*        |                  |                  | */
-/*        |        1F        |        2F        |        3F ... */
-/*        |__________________|__________________|______________ */
-
-/*    Previous | */
-/*      Window | */
-/*  ...________| */
-
-/*             |                                | */
-/*      ------>| This window's placement range  |<------ */
-/*             |                                | */
-
-/*   There are three cases.  Note that 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 constraint
-s,*/
-/*  except that the window may be shortened even further to avoid overlapp
-ing*/
-/*  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 tha
-t*/
-/*   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 */
-    /* Parameter adjustments */
-    --osbuf;
-    vwin -= 3;
-
-    /* Function Body */
-/* Computing MAX */
-    i__1 = vwin[((*af - 1) << 1) + 2] + 1, i__2 = (*af - 2) * *lframe + 1;
-    lrange = max(i__1,i__2);
-    hrange = *af * *lframe;
-/* Compute OSPTR1, so the following code only looks at relevant onsets. */
-    for (osptr1 = *osptr - 1; osptr1 >= 1; --osptr1) {
-	if (osbuf[osptr1] <= hrange) {
-	    goto L90;
-	}
-    }
-L90:
-    ++osptr1;
-/* Check for case 1 first (fast case): */
-    if (osptr1 <= 1 || osbuf[osptr1 - 1] < lrange) {
-/* Computing MAX */
-	i__1 = vwin[((*af - 1) << 1) + 2] + 1;
-	vwin[(*af << 1) + 1] = max(i__1,*dvwinl);
-	vwin[(*af << 1) + 2] = vwin[(*af << 1) + 1] + *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] < lrange) {
-		goto L100;
-	    }
-	}
-L100:
-	++q;
-/* Check for case 2 (placement before onset): */
-/* Check for critical region exception: */
-	i__1 = osptr1 - 1;
-	for (i__ = q + 1; i__ <= i__1; ++i__) {
-	    if (osbuf[i__] - osbuf[q] >= *minwin) {
-		crit = TRUE_;
-		goto L105;
-	    }
-	}
-	crit = FALSE_;
-L105:
-/* Computing MAX */
-	i__1 = (*af - 1) * *lframe, i__2 = lrange + *minwin - 1;
-	if (! crit && osbuf[q] > max(i__1,i__2)) {
-	    vwin[(*af << 1) + 2] = osbuf[q] - 1;
-/* Computing MAX */
-	    i__1 = lrange, i__2 = vwin[(*af << 1) + 2] - *maxwin + 1;
-	    vwin[(*af << 1) + 1] = max(i__1,i__2);
-	    *obound = 2;
-/* Case 3 (placement after onset) */
-	} else {
-	    vwin[(*af << 1) + 1] = osbuf[q];
-L110:
-	    ++q;
-	    if (q >= osptr1) {
-		goto L120;
-	    }
-	    if (osbuf[q] > vwin[(*af << 1) + 1] + *maxwin) {
-		goto L120;
-	    }
-	    if (osbuf[q] < vwin[(*af << 1) + 1] + *minwin) {
-		goto L110;
-	    }
-	    vwin[(*af << 1) + 2] = osbuf[q] - 1;
-	    *obound = 3;
-	    return 0;
-L120:
-/* Computing MIN */
-	    i__1 = vwin[(*af << 1) + 1] + *maxwin - 1;
-	    vwin[(*af << 1) + 2] = min(i__1,hrange);
-	    *obound = 1;
-	}
-    }
-    return 0;
-} /* placev_ */
-
+/*
+
+$Log: placev.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2001/10/16 21:21:14  yurik
+Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:31:02  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int placev_(integer *osbuf, integer *osptr, integer *oslen, integer *obound, integer *vwin, integer *af, integer *lframe, integer *minwin, integer *maxwin, integer *dvwinl, integer *dvwinh);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ****************************************************************** */
+
+/* 	PLACEV Version 48 */
+
+/* $Log: placev.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2001/10/16 21:21:14  yurik
+ * Removed warnings on Windows CE. Submitted by Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:31:02  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.6  1996/03/19  20:42:19  jaf */
+/* Added some conditions satisfied by the output values in VWIN. */
+
+/* Revision 1.5  1996/03/19  18:37:56  jaf */
+/* Strengthened the specification of which indices of VWIN are read and */
+/* written. */
+
+/* Revision 1.4  1996/03/15  16:38:33  jaf */
+/* One tiny comment added. */
+
+/* Revision 1.3  1996/03/15  16:36:13  jaf */
+/* Added comments giving In/Out status of arguments. */
+
+/* Revision 1.2  1996/03/12  23:56:01  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:48:39  jaf */
+/* Initial revision */
+
+
+/* ****************************************************************** */
+
+/* Input: */
+/*  OSBUF	Buffer which holds sorted indexes of onsets */
+/*       	I believe that only indices 1 through OSPTR-1 can be read. */
+/*  OSLEN */
+/*  OSPTR	Free pointer into OSBUF */
+/*  AF */
+/*  LFRAME */
+/*  MINWIN */
+/*  MAXWIN */
+/*  DVWINL */
+/*  DVWINH	(This argument is never used.  Should it be?) */
+/* Input/Output: */
+/*  VWIN		Buffer of Voicing Window Positions (Modified) */
+/*       	Index (2,AF-1) is read. */
+/*       	Indices (1,AF) and (2,AF) are written, */
+/*       	and then possibly read. */
+/*       	All other indices are unused. */
+/*              In all cases, the final values will satsify the condition:*/
+/*               VWIN(2,AF)-VWIN(1,AF)+1 .LE. MAXWIN */
+/*               I'm not certain yet, but they may also satisfy: */
+/*               MINWIN .LE. VWIN(2,AF)-VWIN(1,AF)+1 */
+/* Output: */
+/*  OBOUND	This variable is set by this procedure and used */
+/* 		in placing analysis windows (PLACEA).  Bit 1 */
+/* 		indicates whether an onset bounds the left side */
+/* 		of the voicing window, and bit 2 indicates whether */
+/* 		an onset bounds the right side of the voicing window. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int placev_(integer *osbuf, integer *osptr, integer *oslen, 
+	integer *obound, integer *vwin, integer *af, integer *lframe, integer 
+	*minwin, integer *maxwin, integer *dvwinl, integer *dvwinh)
+{
+    /* System generated locals */
+    integer i__1, i__2;
+
+    /* Local variables */
+    logical crit;
+    integer i__, q, osptr1, hrange, lrange;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+/*   Variables */
+/*    LRANGE, HRANGE  Range in which window is placed */
+/*    OSPTR1     OSPTR excluding samples in 3F */
+/*       Local state */
+/*       None */
+/*   Voicing Window Placement */
+
+/*         __________________ __________________ ______________ */
+/*        |                  |                  | */
+/*        |        1F        |        2F        |        3F ... */
+/*        |__________________|__________________|______________ */
+
+/*    Previous | */
+/*      Window | */
+/*  ...________| */
+
+/*             |                                | */
+/*      ------>| This window's placement range  |<------ */
+/*             |                                | */
+
+/*   There are three cases.  Note that 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 constraint
+s,*/
+/*  except that the window may be shortened even further to avoid overlapp
+ing*/
+/*  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 tha
+t*/
+/*   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 */
+    /* Parameter adjustments */
+    --osbuf;
+    vwin -= 3;
+
+    /* Function Body */
+/* Computing MAX */
+    i__1 = vwin[((*af - 1) << 1) + 2] + 1, i__2 = (*af - 2) * *lframe + 1;
+    lrange = max(i__1,i__2);
+    hrange = *af * *lframe;
+/* Compute OSPTR1, so the following code only looks at relevant onsets. */
+    for (osptr1 = *osptr - 1; osptr1 >= 1; --osptr1) {
+	if (osbuf[osptr1] <= hrange) {
+	    goto L90;
+	}
+    }
+L90:
+    ++osptr1;
+/* Check for case 1 first (fast case): */
+    if (osptr1 <= 1 || osbuf[osptr1 - 1] < lrange) {
+/* Computing MAX */
+	i__1 = vwin[((*af - 1) << 1) + 2] + 1;
+	vwin[(*af << 1) + 1] = max(i__1,*dvwinl);
+	vwin[(*af << 1) + 2] = vwin[(*af << 1) + 1] + *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] < lrange) {
+		goto L100;
+	    }
+	}
+L100:
+	++q;
+/* Check for case 2 (placement before onset): */
+/* Check for critical region exception: */
+	i__1 = osptr1 - 1;
+	for (i__ = q + 1; i__ <= i__1; ++i__) {
+	    if (osbuf[i__] - osbuf[q] >= *minwin) {
+		crit = TRUE_;
+		goto L105;
+	    }
+	}
+	crit = FALSE_;
+L105:
+/* Computing MAX */
+	i__1 = (*af - 1) * *lframe, i__2 = lrange + *minwin - 1;
+	if (! crit && osbuf[q] > max(i__1,i__2)) {
+	    vwin[(*af << 1) + 2] = osbuf[q] - 1;
+/* Computing MAX */
+	    i__1 = lrange, i__2 = vwin[(*af << 1) + 2] - *maxwin + 1;
+	    vwin[(*af << 1) + 1] = max(i__1,i__2);
+	    *obound = 2;
+/* Case 3 (placement after onset) */
+	} else {
+	    vwin[(*af << 1) + 1] = osbuf[q];
+L110:
+	    ++q;
+	    if (q >= osptr1) {
+		goto L120;
+	    }
+	    if (osbuf[q] > vwin[(*af << 1) + 1] + *maxwin) {
+		goto L120;
+	    }
+	    if (osbuf[q] < vwin[(*af << 1) + 1] + *minwin) {
+		goto L110;
+	    }
+	    vwin[(*af << 1) + 2] = osbuf[q] - 1;
+	    *obound = 3;
+	    return 0;
+L120:
+/* Computing MIN */
+	    i__1 = vwin[(*af << 1) + 1] + *maxwin - 1;
+	    vwin[(*af << 1) + 2] = min(i__1,hrange);
+	    *obound = 1;
+	}
+    }
+    return 0;
+} /* placev_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/preemp.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/preemp.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/preemp.c	Fri Sep 21 14:49:14 2007
@@ -1,133 +1,133 @@
-/*
-
-$Log: preemp.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:30:58  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *coef, real *z__);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ******************************************************************* */
-
-/* 	PREEMP Version 55 */
-
-/* $Log: preemp.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:30:58  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/14  23:16:29  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/11  23:23:34  jaf */
-/* Added a bunch of comments to an otherwise simple subroutine. */
-
-/* Revision 1.1  1996/02/07 14:48:48  jaf */
-/* Initial revision */
-
-
-/* ******************************************************************* */
-
-/*   Preemphasize speech with a single-zero filter. */
-/*  (When coef = .9375, preemphasis is as in LPC43.) */
-
-/* Inputs: */
-/*  NSAMP  - Number of samples to filter */
-/*  INBUF  - Input speech buffer */
-/*           Indices 1 through NSAMP are read. */
-/*  COEF   - Preemphasis coefficient */
-/* Input/Output: */
-/*  Z      - Filter state */
-/* Output: */
-/*  PEBUF  - Preemphasized speech buffer (can be equal to INBUF) */
-/*           Indices 1 through NSAMP are modified. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *
-	coef, real *z__)
-{
-    /* System generated locals */
-    integer i__1;
-
-    /* Local variables */
-    real temp;
-    integer i__;
-
-/*       Arguments */
-/*       Local variables */
-
-/*       None of these need to have their values saved from one */
-/*       invocation to the next. */
-
-/*       Logically, this subroutine computes the output sequence */
-/*       pebuf(1:nsamp) defined by: */
-
-/*       pebuf(i) = inbuf(i) - coef * inbuf(i-1) */
-
-/*       where inbuf(0) is defined by the value of z given as input to */
-/*       this subroutine. */
-
-/*       What is this filter's frequency response and phase response? */
-
-/*       Why is this filter applied to the speech? */
-
-/*       Could it be more efficient to apply multiple filters */
-/*       simultaneously, by combining them into one equivalent filter? */
-
-/*       Are there ever cases when "factoring" one high-order filter into 
-*/
-/*       multiple smaller-order filter actually reduces the number of */
-/*       arithmetic operations needed to perform them? */
-/*       When I first read this subroutine, I didn't understand why the */
-/*       variable temp was used.  It seemed that the statements in the do 
-*/
-/*       loop could be replaced with the following: */
-
-/*           pebuf(i) = inbuf(i) - coef * z */
-/*           z = inbuf(i) */
-
-/*       The reason for temp is so that even if pebuf and inbuf are the */
-/*       same arrays in memory (i.e., they are aliased), then this */
-/*       subroutine will still work correctly.  I didn't realize this */
-/*       until seeing the comment after PEBUF above that says "(can be */
-/*       equal to INBUF)". */
-    /* Parameter adjustments */
-    --pebuf;
-    --inbuf;
-
-    /* Function Body */
-    i__1 = *nsamp;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	temp = inbuf[i__] - *coef * *z__;
-	*z__ = inbuf[i__];
-	pebuf[i__] = temp;
-/* L10: */
-    }
-    return 0;
-} /* preemp_ */
-
+/*
+
+$Log: preemp.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:30:58  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *coef, real *z__);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ******************************************************************* */
+
+/* 	PREEMP Version 55 */
+
+/* $Log: preemp.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:30:58  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/14  23:16:29  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/11  23:23:34  jaf */
+/* Added a bunch of comments to an otherwise simple subroutine. */
+
+/* Revision 1.1  1996/02/07 14:48:48  jaf */
+/* Initial revision */
+
+
+/* ******************************************************************* */
+
+/*   Preemphasize speech with a single-zero filter. */
+/*  (When coef = .9375, preemphasis is as in LPC43.) */
+
+/* Inputs: */
+/*  NSAMP  - Number of samples to filter */
+/*  INBUF  - Input speech buffer */
+/*           Indices 1 through NSAMP are read. */
+/*  COEF   - Preemphasis coefficient */
+/* Input/Output: */
+/*  Z      - Filter state */
+/* Output: */
+/*  PEBUF  - Preemphasized speech buffer (can be equal to INBUF) */
+/*           Indices 1 through NSAMP are modified. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *
+	coef, real *z__)
+{
+    /* System generated locals */
+    integer i__1;
+
+    /* Local variables */
+    real temp;
+    integer i__;
+
+/*       Arguments */
+/*       Local variables */
+
+/*       None of these need to have their values saved from one */
+/*       invocation to the next. */
+
+/*       Logically, this subroutine computes the output sequence */
+/*       pebuf(1:nsamp) defined by: */
+
+/*       pebuf(i) = inbuf(i) - coef * inbuf(i-1) */
+
+/*       where inbuf(0) is defined by the value of z given as input to */
+/*       this subroutine. */
+
+/*       What is this filter's frequency response and phase response? */
+
+/*       Why is this filter applied to the speech? */
+
+/*       Could it be more efficient to apply multiple filters */
+/*       simultaneously, by combining them into one equivalent filter? */
+
+/*       Are there ever cases when "factoring" one high-order filter into 
+*/
+/*       multiple smaller-order filter actually reduces the number of */
+/*       arithmetic operations needed to perform them? */
+/*       When I first read this subroutine, I didn't understand why the */
+/*       variable temp was used.  It seemed that the statements in the do 
+*/
+/*       loop could be replaced with the following: */
+
+/*           pebuf(i) = inbuf(i) - coef * z */
+/*           z = inbuf(i) */
+
+/*       The reason for temp is so that even if pebuf and inbuf are the */
+/*       same arrays in memory (i.e., they are aliased), then this */
+/*       subroutine will still work correctly.  I didn't realize this */
+/*       until seeing the comment after PEBUF above that says "(can be */
+/*       equal to INBUF)". */
+    /* Parameter adjustments */
+    --pebuf;
+    --inbuf;
+
+    /* Function Body */
+    i__1 = *nsamp;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	temp = inbuf[i__] - *coef * *z__;
+	*z__ = inbuf[i__];
+	pebuf[i__] = temp;
+/* L10: */
+    }
+    return 0;
+} /* preemp_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/prepro.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/prepro.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/prepro.c	Fri Sep 21 14:49:14 2007
@@ -1,106 +1,106 @@
-/*
-
-$Log: prepro.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:40:51  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:54  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int prepro_(real *speech, integer *length,
-		   struct lpc10_encoder_state *st)
-/*:ref: hp100_ 14 3 6 4 4 */
-/*:ref: inithp100_ 14 0 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Table of constant values */
-
-static integer c__1 = 1;
-
-/* ********************************************************************* */
-
-/* 	PREPRO Version 48 */
-
-/* $Log: prepro.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:40:51  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:54  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/14  23:22:56  jaf */
-/* Added comments about when INITPREPRO should be used. */
-
-/* Revision 1.2  1996/03/14  23:09:27  jaf */
-/* Added an entry named INITPREPRO that initializes the local state of */
-/* this subroutine, and those it calls (if any). */
-
-/* Revision 1.1  1996/02/07  14:48:54  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*    Pre-process input speech: */
-
-/* Inputs: */
-/*  LENGTH - Number of SPEECH samples */
-/* Input/Output: */
-/*  SPEECH(LENGTH) - Speech data. */
-/*                   Indices 1 through LENGTH are read and modified. */
-
-/* This subroutine has no local state maintained from one call to the */
-/* next, but HP100 does.  If you want to switch to using a new audio */
-/* stream for this filter, or reinitialize its state for any other */
-/* reason, call the ENTRY INITPREPRO. */
-
-/* Subroutine */ int prepro_(real *speech, integer *length,
-			     struct lpc10_encoder_state *st)
-{
-    extern /* Subroutine */ int hp100_(real *, integer *, integer *, struct lpc10_encoder_state *);
-
-/*       Arguments */
-/*   High Pass Filter at 100 Hz */
-    /* Parameter adjustments */
-    if (speech) {
-	--speech;
-	}
-
-    /* Function Body */
-    hp100_(&speech[1], &c__1, length, st);
-    return 0;
-} /* prepro_ */
+/*
+
+$Log: prepro.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:40:51  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:54  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int prepro_(real *speech, integer *length,
+		   struct lpc10_encoder_state *st)
+/*:ref: hp100_ 14 3 6 4 4 */
+/*:ref: inithp100_ 14 0 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Table of constant values */
+
+static integer c__1 = 1;
+
+/* ********************************************************************* */
+
+/* 	PREPRO Version 48 */
+
+/* $Log: prepro.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:40:51  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:54  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/14  23:22:56  jaf */
+/* Added comments about when INITPREPRO should be used. */
+
+/* Revision 1.2  1996/03/14  23:09:27  jaf */
+/* Added an entry named INITPREPRO that initializes the local state of */
+/* this subroutine, and those it calls (if any). */
+
+/* Revision 1.1  1996/02/07  14:48:54  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*    Pre-process input speech: */
+
+/* Inputs: */
+/*  LENGTH - Number of SPEECH samples */
+/* Input/Output: */
+/*  SPEECH(LENGTH) - Speech data. */
+/*                   Indices 1 through LENGTH are read and modified. */
+
+/* This subroutine has no local state maintained from one call to the */
+/* next, but HP100 does.  If you want to switch to using a new audio */
+/* stream for this filter, or reinitialize its state for any other */
+/* reason, call the ENTRY INITPREPRO. */
+
+/* Subroutine */ int prepro_(real *speech, integer *length,
+			     struct lpc10_encoder_state *st)
+{
+    extern /* Subroutine */ int hp100_(real *, integer *, integer *, struct lpc10_encoder_state *);
+
+/*       Arguments */
+/*   High Pass Filter at 100 Hz */
+    /* Parameter adjustments */
+    if (speech) {
+	--speech;
+	}
+
+    /* Function Body */
+    hp100_(&speech[1], &c__1, length, st);
+    return 0;
+} /* prepro_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/random.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/random.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/random.c	Fri Sep 21 14:49:14 2007
@@ -1,114 +1,114 @@
-/*
-
-$Log: random.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:41:32  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:49  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern integer random_(struct lpc10_decoder_state *st);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************** */
-
-/* 	RANDOM Version 49 */
-
-/* $Log: random.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:41:32  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:49  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/20  16:13:54  jaf */
-/* Rearranged comments a little bit, and added comments explaining that */
-/* even though there is local state here, there is no need to create an */
-/* ENTRY for reinitializing it. */
-
-/* Revision 1.2  1996/03/14  22:25:29  jaf */
-/* Just rearranged the comments and local variable declarations a bit. */
-
-/* Revision 1.1  1996/02/07 14:49:01  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*  Pseudo random number generator based on Knuth, Vol 2, p. 27. */
-
-/* Function Return: */
-/*  RANDOM - Integer variable, uniformly distributed over -32768 to 32767 */
-
-/* This subroutine maintains local state from one call to the next. */
-/* In the context of the LPC10 coder, there is no reason to reinitialize */
-/* this local state when switching between audio streams, because its */
-/* results are only used to generate noise for unvoiced frames. */
-
-integer random_(struct lpc10_decoder_state *st)
-{
-    /* Initialized data */
-
-    integer *j;
-    integer *k;
-    shortint *y;
-
-    /* System generated locals */
-    integer ret_val;
-
-/* 	Parameters/constants */
-/*       Local state */
-/*   The following is a 16 bit 2's complement addition, */
-/*   with overflow checking disabled */
-
-    j = &(st->j);
-    k = &(st->k);
-    y = &(st->y[0]);
-
-    y[*k - 1] += y[*j - 1];
-    ret_val = y[*k - 1];
-    --(*k);
-    if (*k <= 0) {
-	*k = 5;
-    }
-    --(*j);
-    if (*j <= 0) {
-	*j = 5;
-    }
-    return ret_val;
-} /* random_ */
-
+/*
+
+$Log: random.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:41:32  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:49  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern integer random_(struct lpc10_decoder_state *st);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************** */
+
+/* 	RANDOM Version 49 */
+
+/* $Log: random.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:41:32  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:49  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/20  16:13:54  jaf */
+/* Rearranged comments a little bit, and added comments explaining that */
+/* even though there is local state here, there is no need to create an */
+/* ENTRY for reinitializing it. */
+
+/* Revision 1.2  1996/03/14  22:25:29  jaf */
+/* Just rearranged the comments and local variable declarations a bit. */
+
+/* Revision 1.1  1996/02/07 14:49:01  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*  Pseudo random number generator based on Knuth, Vol 2, p. 27. */
+
+/* Function Return: */
+/*  RANDOM - Integer variable, uniformly distributed over -32768 to 32767 */
+
+/* This subroutine maintains local state from one call to the next. */
+/* In the context of the LPC10 coder, there is no reason to reinitialize */
+/* this local state when switching between audio streams, because its */
+/* results are only used to generate noise for unvoiced frames. */
+
+integer random_(struct lpc10_decoder_state *st)
+{
+    /* Initialized data */
+
+    integer *j;
+    integer *k;
+    shortint *y;
+
+    /* System generated locals */
+    integer ret_val;
+
+/* 	Parameters/constants */
+/*       Local state */
+/*   The following is a 16 bit 2's complement addition, */
+/*   with overflow checking disabled */
+
+    j = &(st->j);
+    k = &(st->k);
+    y = &(st->y[0]);
+
+    y[*k - 1] += y[*j - 1];
+    ret_val = y[*k - 1];
+    --(*k);
+    if (*k <= 0) {
+	*k = 5;
+    }
+    --(*j);
+    if (*j <= 0) {
+	*j = 5;
+    }
+    return ret_val;
+} /* random_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/rcchk.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/rcchk.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/rcchk.c	Fri Sep 21 14:49:14 2007
@@ -1,108 +1,108 @@
-/*
-
-$Log: rcchk.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:30:41  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int rcchk_(integer *order, real *rc1f, real *rc2f);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************* */
-
-/* 	RCCHK Version 45G */
-
-/* $Log: rcchk.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:30:41  jaf
- * Initial revision
- *
- */
-/* Revision 1.4  1996/03/27  18:13:47  jaf */
-/* Commented out a call to subroutine ERROR. */
-
-/* Revision 1.3  1996/03/18  15:48:53  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  16:55:22  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:49:08  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*  Check RC's, repeat previous frame's RC's if unstable */
-
-/* Input: */
-/*  ORDER - Number of RC's */
-/*  RC1F  - Previous frame's RC's */
-/*          Indices 1 through ORDER may be read. */
-/* Input/Output: */
-/*  RC2F  - Present frame's RC's */
-/*          Indices 1 through ORDER may be read, and written. */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int rcchk_(integer *order, real *rc1f, real *rc2f)
-{
-    /* System generated locals */
-    integer i__1;
-    real r__1;
-
-    /* Local variables */
-    integer i__;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-    /* Parameter adjustments */
-    --rc2f;
-    --rc1f;
-
-    /* Function Body */
-    i__1 = *order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	if ((r__1 = rc2f[i__], abs(r__1)) > .99f) {
-	    goto L10;
-	}
-    }
-    return 0;
-/*       Note: In version embedded in other software, all calls to ERROR 
-*/
-/*       should probably be removed. */
-L10:
-
-/*       This call to ERROR is only needed for debugging purposes. */
-
-/*       CALL ERROR('RCCHK',2,I) */
-    i__1 = *order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-	rc2f[i__] = rc1f[i__];
-    }
-    return 0;
-} /* rcchk_ */
-
+/*
+
+$Log: rcchk.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:30:41  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int rcchk_(integer *order, real *rc1f, real *rc2f);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************* */
+
+/* 	RCCHK Version 45G */
+
+/* $Log: rcchk.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:30:41  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.4  1996/03/27  18:13:47  jaf */
+/* Commented out a call to subroutine ERROR. */
+
+/* Revision 1.3  1996/03/18  15:48:53  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  16:55:22  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:49:08  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*  Check RC's, repeat previous frame's RC's if unstable */
+
+/* Input: */
+/*  ORDER - Number of RC's */
+/*  RC1F  - Previous frame's RC's */
+/*          Indices 1 through ORDER may be read. */
+/* Input/Output: */
+/*  RC2F  - Present frame's RC's */
+/*          Indices 1 through ORDER may be read, and written. */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int rcchk_(integer *order, real *rc1f, real *rc2f)
+{
+    /* System generated locals */
+    integer i__1;
+    real r__1;
+
+    /* Local variables */
+    integer i__;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+    /* Parameter adjustments */
+    --rc2f;
+    --rc1f;
+
+    /* Function Body */
+    i__1 = *order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	if ((r__1 = rc2f[i__], abs(r__1)) > .99f) {
+	    goto L10;
+	}
+    }
+    return 0;
+/*       Note: In version embedded in other software, all calls to ERROR 
+*/
+/*       should probably be removed. */
+L10:
+
+/*       This call to ERROR is only needed for debugging purposes. */
+
+/*       CALL ERROR('RCCHK',2,I) */
+    i__1 = *order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+	rc2f[i__] = rc1f[i__];
+    }
+    return 0;
+} /* rcchk_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/synths.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/synths.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/synths.c	Fri Sep 21 14:49:14 2007
@@ -1,395 +1,395 @@
-/*
-
-$Log: synths.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:42:59  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:33  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int synths_(integer *voice, integer *pitch, real *rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st);
-/* comlen contrl_ 12 */
-/*:ref: pitsyn_ 14 12 4 4 4 6 6 4 4 4 6 6 4 6 */
-/*:ref: irc2pc_ 14 5 6 6 4 6 6 */
-/*:ref: bsynz_ 14 7 6 4 4 6 6 6 6 */
-/*:ref: deemp_ 14 2 6 4 */
-/*:ref: initpitsyn_ 14 0 */
-/*:ref: initbsynz_ 14 0 */
-/*:ref: initdeemp_ 14 0 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/* Table of constant values */
-
-static real c_b2 = .7f;
-
-/* ***************************************************************** */
-
-/* 	SYNTHS Version 54 */
-
-/* $Log: synths.c,v $
-/* Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:42:59  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:33  jaf
- * Initial revision
- *
- */
-/* Revision 1.5  1996/03/26  19:31:58  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.4  1996/03/25  19:41:01  jaf */
-/* Changed so that MAXFRM samples are always returned in the output array */
-/* SPEECH. */
-
-/* This required delaying the returned samples by MAXFRM sample times, */
-/* and remembering any "left over" samples returned by PITSYN from one */
-/* call of SYNTHS to the next. */
-
-/* Changed size of SPEECH from 2*MAXFRM to MAXFRM.  Removed local */
-/* variable SOUT.  Added local state variables BUF and BUFLEN. */
-
-/* Revision 1.3  1996/03/25  19:20:10  jaf */
-/* Added comments about the range of possible return values for argument */
-/* K, and increased the size of the arrays filled in by PITSYN from 11 to */
-/* 16, as has been already done inside of PITSYN. */
-
-/* Revision 1.2  1996/03/22  00:18:18  jaf */
-/* Added comments explaining meanings of input and output parameters, and */
-/* indicating which array indices can be read or written. */
-
-/* Added entry INITSYNTHS, which does nothing except call the */
-/* corresponding initialization entries for subroutines PITSYN, BSYNZ, */
-/* and DEEMP. */
-
-/* Revision 1.1  1996/02/07 14:49:44  jaf */
-/* Initial revision */
-
-
-/* ***************************************************************** */
-
-/* The note below is from the distributed version of the LPC10 coder. */
-/* The version of the code below has been modified so that SYNTHS always */
-/* has a constant frame length output of MAXFRM. */
-
-/* Also, BSYNZ and DEEMP need not be modified to work on variable */
-/* positions within an array.  It is only necessary to pass the first */
-/* index desired as the array argument.  What actually gets passed is the */
-/* address of that array position, which the subroutine treats as the */
-/* first index of the array. */
-
-/* This technique is used in subroutine ANALYS when calling PREEMP, so it */
-/* appears that multiple people wrote different parts of this LPC10 code, */
-/* and that they didn't necessarily have equivalent knowledge of Fortran */
-/* (not surprising). */
-
-/*  NOTE: There is excessive buffering here, BSYNZ and DEEMP should be */
-/*        changed to operate on variable positions within SOUT.  Also, */
-/*        the output length parameter is bogus, and PITSYN should be */
-/*        rewritten to allow a constant frame length output. */
-
-/* Input: */
-/*  VOICE  - Half frame voicing decisions */
-/*           Indices 1 through 2 read. */
-/* Input/Output: */
-/*  PITCH  - Pitch */
-/*           PITCH is restricted to range 20 to 156, inclusive, */
-/*           before calling subroutine PITSYN, and then PITSYN */
-/*           can modify it further under some conditions. */
-/*  RMS    - Energy */
-/*           Only use is for debugging, and passed to PITSYN. */
-/*           See comments there for how it can be modified. */
-/*  RC     - Reflection coefficients */
-/*           Indices 1 through ORDER restricted to range -.99 to .99, */
-/*           before calling subroutine PITSYN, and then PITSYN */
-/*           can modify it further under some conditions. */
-/* Output: */
-/*  SPEECH - Synthesized speech samples. */
-/*           Indices 1 through the final value of K are written. */
-/*  K      - Number of samples placed into array SPEECH. */
-/*           This is always MAXFRM. */
-
-/* Subroutine */ int synths_(integer *voice, integer *pitch, real *
-	rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st)
-{
-    /* Initialized data */
-
-    real *buf;
-    integer *buflen;
-
-    /* System generated locals */
-    integer i__1;
-    real r__1, r__2;
-
-    /* Local variables */
-    real rmsi[16];
-    integer nout, ivuv[16], i__, j;
-    extern /* Subroutine */ int deemp_(real *, integer *, struct lpc10_decoder_state *);
-    real ratio;
-    integer ipiti[16];
-    extern /* Subroutine */ bsynz_(real *, integer *, 
-	    integer *, real *, real *, real *, real *, struct lpc10_decoder_state *), irc2pc_(real *, real *
-	    , integer *, real *, real *);
-    real g2pass;
-    real pc[10];
-    extern /* Subroutine */ int pitsyn_(integer *, integer *, integer *, real 
-	    *, real *, integer *, integer *, integer *, real *, real *, 
-	    integer *, real *, struct lpc10_decoder_state *);
-    real rci[160]	/* was [10][16] */;
-
-/* $Log: synths.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:42:59  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:33  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:03:47  jaf */
-/* Removed definitions for any constants that were no longer used. */
-
-/* Revision 1.2  1996/03/26  19:34:33  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:43:51  jaf */
-/* Initial revision */
-
-/*   LPC Configuration parameters: */
-/* Frame size, Prediction order, Pitch period */
-/*       Arguments */
-/* $Log: synths.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:42:59  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_decoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_decoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:33  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/*       Parameters/constants */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       BUF is a buffer of speech samples that would have been returned 
-*/
-/*       by the older version of SYNTHS, but the newer version doesn't, */
-/*       so that the newer version can always return MAXFRM samples on */
-/*       every call.  This has the effect of delaying the return of */
-/*       samples for one additional frame time. */
-
-/*       Indices 1 through BUFLEN contain samples that are left over from 
-*/
-/*       the last call to SYNTHS.  Given the way that PITSYN works, */
-/*       BUFLEN should always be in the range MAXFRM-MAXPIT+1 through */
-/*       MAXFRM, inclusive, after a call to SYNTHS is complete. */
-
-/*       On the first call to SYNTHS (or the first call after */
-/*       reinitializing with the entry INITSYNTHS), BUFLEN is MAXFRM, and 
-*/
-/*       a frame of silence is always returned. */
-    /* Parameter adjustments */
-    if (voice) {
-	--voice;
-	}
-    if (rc) {
-	--rc;
-	}
-    if (speech) {
-	--speech;
-	}
-
-    /* Function Body */
-    buf = &(st->buf[0]);
-    buflen = &(st->buflen);
-
-/* Computing MAX */
-    i__1 = min(*pitch,156);
-    *pitch = max(i__1,20);
-    i__1 = contrl_1.order;
-    for (i__ = 1; i__ <= i__1; ++i__) {
-/* Computing MAX */
-/* Computing MIN */
-	r__2 = rc[i__];
-	r__1 = min(r__2,.99f);
-	rc[i__] = max(r__1,-.99f);
-    }
-    pitsyn_(&contrl_1.order, &voice[1], pitch, rms, &rc[1], &contrl_1.lframe, 
-	    ivuv, ipiti, rmsi, rci, &nout, &ratio, st);
-    if (nout > 0) {
-	i__1 = nout;
-	for (j = 1; j <= i__1; ++j) {
-
-/*             Add synthesized speech for pitch period J to the en
-d of */
-/*             BUF. */
-
-	    irc2pc_(&rci[j * 10 - 10], pc, &contrl_1.order, &c_b2, &g2pass);
-	    bsynz_(pc, &ipiti[j - 1], &ivuv[j - 1], &buf[*buflen], &rmsi[j - 1]
-		    , &ratio, &g2pass, st);
-	    deemp_(&buf[*buflen], &ipiti[j - 1], st);
-	    *buflen += ipiti[j - 1];
-	}
-
-/*          Copy first MAXFRM samples from BUF to output array SPEECH 
-*/
-/*          (scaling them), and then remove them from the beginning of
- */
-/*          BUF. */
-
-	for (i__ = 1; i__ <= 180; ++i__) {
-	    speech[i__] = buf[i__ - 1] / 4096.f;
-	}
-	*k = 180;
-	*buflen += -180;
-	i__1 = *buflen;
-	for (i__ = 1; i__ <= i__1; ++i__) {
-	    buf[i__ - 1] = buf[i__ + 179];
-	}
-    }
-    return 0;
-} /* synths_ */
+/*
+
+$Log: synths.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:42:59  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:33  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int synths_(integer *voice, integer *pitch, real *rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st);
+/* comlen contrl_ 12 */
+/*:ref: pitsyn_ 14 12 4 4 4 6 6 4 4 4 6 6 4 6 */
+/*:ref: irc2pc_ 14 5 6 6 4 6 6 */
+/*:ref: bsynz_ 14 7 6 4 4 6 6 6 6 */
+/*:ref: deemp_ 14 2 6 4 */
+/*:ref: initpitsyn_ 14 0 */
+/*:ref: initbsynz_ 14 0 */
+/*:ref: initdeemp_ 14 0 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/* Table of constant values */
+
+static real c_b2 = .7f;
+
+/* ***************************************************************** */
+
+/* 	SYNTHS Version 54 */
+
+/* $Log: synths.c,v $
+/* Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:42:59  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:33  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.5  1996/03/26  19:31:58  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.4  1996/03/25  19:41:01  jaf */
+/* Changed so that MAXFRM samples are always returned in the output array */
+/* SPEECH. */
+
+/* This required delaying the returned samples by MAXFRM sample times, */
+/* and remembering any "left over" samples returned by PITSYN from one */
+/* call of SYNTHS to the next. */
+
+/* Changed size of SPEECH from 2*MAXFRM to MAXFRM.  Removed local */
+/* variable SOUT.  Added local state variables BUF and BUFLEN. */
+
+/* Revision 1.3  1996/03/25  19:20:10  jaf */
+/* Added comments about the range of possible return values for argument */
+/* K, and increased the size of the arrays filled in by PITSYN from 11 to */
+/* 16, as has been already done inside of PITSYN. */
+
+/* Revision 1.2  1996/03/22  00:18:18  jaf */
+/* Added comments explaining meanings of input and output parameters, and */
+/* indicating which array indices can be read or written. */
+
+/* Added entry INITSYNTHS, which does nothing except call the */
+/* corresponding initialization entries for subroutines PITSYN, BSYNZ, */
+/* and DEEMP. */
+
+/* Revision 1.1  1996/02/07 14:49:44  jaf */
+/* Initial revision */
+
+
+/* ***************************************************************** */
+
+/* The note below is from the distributed version of the LPC10 coder. */
+/* The version of the code below has been modified so that SYNTHS always */
+/* has a constant frame length output of MAXFRM. */
+
+/* Also, BSYNZ and DEEMP need not be modified to work on variable */
+/* positions within an array.  It is only necessary to pass the first */
+/* index desired as the array argument.  What actually gets passed is the */
+/* address of that array position, which the subroutine treats as the */
+/* first index of the array. */
+
+/* This technique is used in subroutine ANALYS when calling PREEMP, so it */
+/* appears that multiple people wrote different parts of this LPC10 code, */
+/* and that they didn't necessarily have equivalent knowledge of Fortran */
+/* (not surprising). */
+
+/*  NOTE: There is excessive buffering here, BSYNZ and DEEMP should be */
+/*        changed to operate on variable positions within SOUT.  Also, */
+/*        the output length parameter is bogus, and PITSYN should be */
+/*        rewritten to allow a constant frame length output. */
+
+/* Input: */
+/*  VOICE  - Half frame voicing decisions */
+/*           Indices 1 through 2 read. */
+/* Input/Output: */
+/*  PITCH  - Pitch */
+/*           PITCH is restricted to range 20 to 156, inclusive, */
+/*           before calling subroutine PITSYN, and then PITSYN */
+/*           can modify it further under some conditions. */
+/*  RMS    - Energy */
+/*           Only use is for debugging, and passed to PITSYN. */
+/*           See comments there for how it can be modified. */
+/*  RC     - Reflection coefficients */
+/*           Indices 1 through ORDER restricted to range -.99 to .99, */
+/*           before calling subroutine PITSYN, and then PITSYN */
+/*           can modify it further under some conditions. */
+/* Output: */
+/*  SPEECH - Synthesized speech samples. */
+/*           Indices 1 through the final value of K are written. */
+/*  K      - Number of samples placed into array SPEECH. */
+/*           This is always MAXFRM. */
+
+/* Subroutine */ int synths_(integer *voice, integer *pitch, real *
+	rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st)
+{
+    /* Initialized data */
+
+    real *buf;
+    integer *buflen;
+
+    /* System generated locals */
+    integer i__1;
+    real r__1, r__2;
+
+    /* Local variables */
+    real rmsi[16];
+    integer nout, ivuv[16], i__, j;
+    extern /* Subroutine */ int deemp_(real *, integer *, struct lpc10_decoder_state *);
+    real ratio;
+    integer ipiti[16];
+    extern /* Subroutine */ bsynz_(real *, integer *, 
+	    integer *, real *, real *, real *, real *, struct lpc10_decoder_state *), irc2pc_(real *, real *
+	    , integer *, real *, real *);
+    real g2pass;
+    real pc[10];
+    extern /* Subroutine */ int pitsyn_(integer *, integer *, integer *, real 
+	    *, real *, integer *, integer *, integer *, real *, real *, 
+	    integer *, real *, struct lpc10_decoder_state *);
+    real rci[160]	/* was [10][16] */;
+
+/* $Log: synths.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:42:59  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:33  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:03:47  jaf */
+/* Removed definitions for any constants that were no longer used. */
+
+/* Revision 1.2  1996/03/26  19:34:33  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:43:51  jaf */
+/* Initial revision */
+
+/*   LPC Configuration parameters: */
+/* Frame size, Prediction order, Pitch period */
+/*       Arguments */
+/* $Log: synths.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:42:59  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_decoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_decoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:33  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/*       Parameters/constants */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       BUF is a buffer of speech samples that would have been returned 
+*/
+/*       by the older version of SYNTHS, but the newer version doesn't, */
+/*       so that the newer version can always return MAXFRM samples on */
+/*       every call.  This has the effect of delaying the return of */
+/*       samples for one additional frame time. */
+
+/*       Indices 1 through BUFLEN contain samples that are left over from 
+*/
+/*       the last call to SYNTHS.  Given the way that PITSYN works, */
+/*       BUFLEN should always be in the range MAXFRM-MAXPIT+1 through */
+/*       MAXFRM, inclusive, after a call to SYNTHS is complete. */
+
+/*       On the first call to SYNTHS (or the first call after */
+/*       reinitializing with the entry INITSYNTHS), BUFLEN is MAXFRM, and 
+*/
+/*       a frame of silence is always returned. */
+    /* Parameter adjustments */
+    if (voice) {
+	--voice;
+	}
+    if (rc) {
+	--rc;
+	}
+    if (speech) {
+	--speech;
+	}
+
+    /* Function Body */
+    buf = &(st->buf[0]);
+    buflen = &(st->buflen);
+
+/* Computing MAX */
+    i__1 = min(*pitch,156);
+    *pitch = max(i__1,20);
+    i__1 = contrl_1.order;
+    for (i__ = 1; i__ <= i__1; ++i__) {
+/* Computing MAX */
+/* Computing MIN */
+	r__2 = rc[i__];
+	r__1 = min(r__2,.99f);
+	rc[i__] = max(r__1,-.99f);
+    }
+    pitsyn_(&contrl_1.order, &voice[1], pitch, rms, &rc[1], &contrl_1.lframe, 
+	    ivuv, ipiti, rmsi, rci, &nout, &ratio, st);
+    if (nout > 0) {
+	i__1 = nout;
+	for (j = 1; j <= i__1; ++j) {
+
+/*             Add synthesized speech for pitch period J to the en
+d of */
+/*             BUF. */
+
+	    irc2pc_(&rci[j * 10 - 10], pc, &contrl_1.order, &c_b2, &g2pass);
+	    bsynz_(pc, &ipiti[j - 1], &ivuv[j - 1], &buf[*buflen], &rmsi[j - 1]
+		    , &ratio, &g2pass, st);
+	    deemp_(&buf[*buflen], &ipiti[j - 1], st);
+	    *buflen += ipiti[j - 1];
+	}
+
+/*          Copy first MAXFRM samples from BUF to output array SPEECH 
+*/
+/*          (scaling them), and then remove them from the beginning of
+ */
+/*          BUF. */
+
+	for (i__ = 1; i__ <= 180; ++i__) {
+	    speech[i__] = buf[i__ - 1] / 4096.f;
+	}
+	*k = 180;
+	*buflen += -180;
+	i__1 = *buflen;
+	for (i__ = 1; i__ <= i__1; ++i__) {
+	    buf[i__ - 1] = buf[i__ + 179];
+	}
+    }
+    return 0;
+} /* synths_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/tbdm.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/tbdm.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/tbdm.c	Fri Sep 21 14:49:14 2007
@@ -1,183 +1,183 @@
-/*
-
-$Log: tbdm.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:30:26  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *mintau);
-/*:ref: difmag_ 14 8 6 4 4 4 4 6 4 4 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* ********************************************************************** */
-
-/* 	TBDM Version 49 */
-
-/* $Log: tbdm.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:30:26  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/18  22:14:00  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  14:48:37  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:49:54  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*TURBO DIFMAG: Compute High Resolution Average Magnitude Difference Function
-*/
-
-/* Note: There are several constants in here that appear to depend on a */
-/* particular TAU table.  That's not a problem for the LPC10 coder, but */
-/* watch out if you change the contents of TAU in the subroutine ANALYS. */
-
-/* Input: */
-/*  SPEECH - Low pass filtered speech */
-/*           Indices 1 through MAX+LPITA-1 are read, where: */
-/*           MAX = (TAU(LTAU)-TAU(1))/2+1 */
-/*           (If TAU(1) .LT. 39, then larger indices could be read */
-/*           by the last call to DIFMAG below.) */
-/*  LPITA  - Length of speech buffer */
-/*  TAU    - Table of lags, sorted in increasing order. */
-/*           Indices 1 through LTAU read. */
-/*  LTAU   - Number of lag values to compute */
-/* Output: */
-/*  AMDF   - Average Magnitude Difference for each lag in TAU */
-/*          Indices 1 through LTAU written, and several might then be read.*/
-/*  MINPTR - Index of minimum AMDF value */
-/*  MAXPTR - Index of maximum AMDF value within +/- 1/2 octave of min */
-/*  MINTAU - Lag corresponding to minimum AMDF value */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int tbdm_(real *speech, integer *lpita, integer *tau, 
-	integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *
-	mintau)
-{
-    /* System generated locals */
-    integer i__1, i__2, i__3, i__4;
-
-    /* Local variables */
-    real amdf2[6];
-    integer minp2, ltau2, maxp2, i__;
-    extern /* Subroutine */ int difmag_(real *, integer *, integer *, integer 
-	    *, integer *, real *, integer *, integer *);
-    integer minamd, ptr, tau2[6];
-
-/* 	Arguments */
-/* 	REAL SPEECH(LPITA+TAU(LTAU)), AMDF(LTAU) */
-/*   Stupid TOAST doesn't understand expressions */
-/*       Local variables that need not be saved */
-/*       Local state */
-/*       None */
-/*   Compute full AMDF using log spaced lags, find coarse minimum */
-    /* Parameter adjustments */
-    --speech;
-    --amdf;
-    --tau;
-
-    /* Function Body */
-    difmag_(&speech[1], lpita, &tau[1], ltau, &tau[*ltau], &amdf[1], minptr, 
-	    maxptr);
-    *mintau = tau[*minptr];
-    minamd = (integer)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;
-/* Computing MAX */
-    i__1 = *mintau - 3;
-/* Computing MIN */
-    i__3 = *mintau + 3, i__4 = tau[*ltau] - 1;
-    i__2 = min(i__3,i__4);
-    for (i__ = max(i__1,41); i__ <= i__2; ++i__) {
-	while(tau[ptr] < i__) {
-	    ++ptr;
-	}
-	if (tau[ptr] != i__) {
-	    ++ltau2;
-	    tau2[ltau2 - 1] = 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) {
-	difmag_(&speech[1], lpita, tau2, &ltau2, &tau[*ltau], amdf2, &minp2, &
-		maxp2);
-	if (amdf2[minp2 - 1] < (real) minamd) {
-	    *mintau = tau2[minp2 - 1];
-	    minamd = (integer)amdf2[minp2 - 1];
-	}
-    }
-/*   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__;
-	}
-	difmag_(&speech[1], lpita, tau2, &ltau2, &tau[*ltau], amdf2, &minp2, &
-		maxp2);
-	if (amdf2[minp2 - 1] < (real) minamd) {
-	    *mintau = tau2[minp2 - 1];
-	    minamd = (integer)amdf2[minp2 - 1];
-	    *minptr += -20;
-	}
-    }
-/*   Force minimum of the AMDF array to the high resolution minimum */
-    amdf[*minptr] = (real) minamd;
-/*   Find maximum of AMDF within 1/2 octave of minimum */
-/* Computing MAX */
-    i__2 = *minptr - 5;
-    *maxptr = max(i__2,1);
-/* Computing MIN */
-    i__1 = *minptr + 5;
-    i__2 = min(i__1,*ltau);
-    for (i__ = *maxptr + 1; i__ <= i__2; ++i__) {
-	if (amdf[i__] > amdf[*maxptr]) {
-	    *maxptr = i__;
-	}
-    }
-    return 0;
-} /* tbdm_ */
-
+/*
+
+$Log: tbdm.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:30:26  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *mintau);
+/*:ref: difmag_ 14 8 6 4 4 4 4 6 4 4 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* ********************************************************************** */
+
+/* 	TBDM Version 49 */
+
+/* $Log: tbdm.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:30:26  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/18  22:14:00  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  14:48:37  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:49:54  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*TURBO DIFMAG: Compute High Resolution Average Magnitude Difference Function
+*/
+
+/* Note: There are several constants in here that appear to depend on a */
+/* particular TAU table.  That's not a problem for the LPC10 coder, but */
+/* watch out if you change the contents of TAU in the subroutine ANALYS. */
+
+/* Input: */
+/*  SPEECH - Low pass filtered speech */
+/*           Indices 1 through MAX+LPITA-1 are read, where: */
+/*           MAX = (TAU(LTAU)-TAU(1))/2+1 */
+/*           (If TAU(1) .LT. 39, then larger indices could be read */
+/*           by the last call to DIFMAG below.) */
+/*  LPITA  - Length of speech buffer */
+/*  TAU    - Table of lags, sorted in increasing order. */
+/*           Indices 1 through LTAU read. */
+/*  LTAU   - Number of lag values to compute */
+/* Output: */
+/*  AMDF   - Average Magnitude Difference for each lag in TAU */
+/*          Indices 1 through LTAU written, and several might then be read.*/
+/*  MINPTR - Index of minimum AMDF value */
+/*  MAXPTR - Index of maximum AMDF value within +/- 1/2 octave of min */
+/*  MINTAU - Lag corresponding to minimum AMDF value */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int tbdm_(real *speech, integer *lpita, integer *tau, 
+	integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *
+	mintau)
+{
+    /* System generated locals */
+    integer i__1, i__2, i__3, i__4;
+
+    /* Local variables */
+    real amdf2[6];
+    integer minp2, ltau2, maxp2, i__;
+    extern /* Subroutine */ int difmag_(real *, integer *, integer *, integer 
+	    *, integer *, real *, integer *, integer *);
+    integer minamd, ptr, tau2[6];
+
+/* 	Arguments */
+/* 	REAL SPEECH(LPITA+TAU(LTAU)), AMDF(LTAU) */
+/*   Stupid TOAST doesn't understand expressions */
+/*       Local variables that need not be saved */
+/*       Local state */
+/*       None */
+/*   Compute full AMDF using log spaced lags, find coarse minimum */
+    /* Parameter adjustments */
+    --speech;
+    --amdf;
+    --tau;
+
+    /* Function Body */
+    difmag_(&speech[1], lpita, &tau[1], ltau, &tau[*ltau], &amdf[1], minptr, 
+	    maxptr);
+    *mintau = tau[*minptr];
+    minamd = (integer)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;
+/* Computing MAX */
+    i__1 = *mintau - 3;
+/* Computing MIN */
+    i__3 = *mintau + 3, i__4 = tau[*ltau] - 1;
+    i__2 = min(i__3,i__4);
+    for (i__ = max(i__1,41); i__ <= i__2; ++i__) {
+	while(tau[ptr] < i__) {
+	    ++ptr;
+	}
+	if (tau[ptr] != i__) {
+	    ++ltau2;
+	    tau2[ltau2 - 1] = 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) {
+	difmag_(&speech[1], lpita, tau2, &ltau2, &tau[*ltau], amdf2, &minp2, &
+		maxp2);
+	if (amdf2[minp2 - 1] < (real) minamd) {
+	    *mintau = tau2[minp2 - 1];
+	    minamd = (integer)amdf2[minp2 - 1];
+	}
+    }
+/*   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__;
+	}
+	difmag_(&speech[1], lpita, tau2, &ltau2, &tau[*ltau], amdf2, &minp2, &
+		maxp2);
+	if (amdf2[minp2 - 1] < (real) minamd) {
+	    *mintau = tau2[minp2 - 1];
+	    minamd = (integer)amdf2[minp2 - 1];
+	    *minptr += -20;
+	}
+    }
+/*   Force minimum of the AMDF array to the high resolution minimum */
+    amdf[*minptr] = (real) minamd;
+/*   Find maximum of AMDF within 1/2 octave of minimum */
+/* Computing MAX */
+    i__2 = *minptr - 5;
+    *maxptr = max(i__2,1);
+/* Computing MIN */
+    i__1 = *minptr + 5;
+    i__2 = min(i__1,*ltau);
+    for (i__ = *maxptr + 1; i__ <= i__2; ++i__) {
+	if (amdf[i__] > amdf[*maxptr]) {
+	    *maxptr = i__;
+	}
+    }
+    return 0;
+} /* tbdm_ */
+

Modified: freeswitch/trunk/libs/codec/lpc10/src/voicin.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/voicin.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/voicin.c	Fri Sep 21 14:49:14 2007
@@ -1,770 +1,770 @@
-/*
-
-$Log: voicin.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.2  1996/08/20  20:45:00  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:14  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int voicin_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *minamd, real *maxamd, integer *mintau, real *ivrc, integer *obound, integer *voibuf, integer *af, struct lpc10_encoder_state *st);
-/* comlen contrl_ 12 */
-/*:ref: vparms_ 14 14 4 6 6 4 4 6 4 4 4 4 6 6 6 6 */
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Common Block Declarations */
-
-extern struct {
-    integer order, lframe;
-    logical corrp;
-} contrl_;
-
-#define contrl_1 contrl_
-
-/****************************************************************************/
-
-/* 	VOICIN Version 52 */
-
-/* $Log: voicin.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:45:00  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:14  jaf
- * Initial revision
- *
- */
-/* Revision 1.10  1996/03/29  17:59:14  jaf */
-/* Avoided using VALUE(9), although it shouldn't affect the function of */
-/* the code at all, because it was always multiplied by VDC(9,SNRL), */
-/* which is 0 for all values of SNRL.  Still, if VALUE(9) had an initial */
-/* value of IEEE NaN, it might cause trouble (I don't know how IEEE */
-/* defines Nan * 0.  It should either be NaN or 0.) */
-
-/* Revision 1.9  1996/03/29  17:54:46  jaf */
-/* Added a few comments about the accesses made to argument array VOIBUF */
-/* and the local saved array VOICE. */
-
-/* Revision 1.8  1996/03/27  18:19:54  jaf */
-/* Added an assignment to VSTATE that does not affect the function of the */
-/* program at all.  The only reason I put it in was so that the tracing */
-/* statements at the end, when enabled, will print a consistent value for */
-/* VSTATE when HALF .EQ. 1, rather than a garbage value that could change */
-/* from one call to the next. */
-
-/* Revision 1.7  1996/03/26  20:00:06  jaf */
-/* Removed the inclusion of the file "vcomm.fh", and put its contents */
-/* into this file.  It was included nowhere else but here. */
-
-/* Revision 1.6  1996/03/26  19:38:09  jaf */
-/* Commented out trace statements. */
-
-/* Revision 1.5  1996/03/19  20:43:45  jaf */
-/* Added comments about which indices of OBOUND and VOIBUF can be */
-/* accessed, and whether they are read or written.  VOIBUF is fairly */
-/* messy. */
-
-/* Revision 1.4  1996/03/19  15:00:58  jaf */
-/* Moved the DATA statements for the *VDC* variables later, as it is */
-/* apparently illegal to have DATA statements before local variable */
-/* declarations. */
-
-/* Revision 1.3  1996/03/19  00:10:49  jaf */
-/* Heavily commented the local variables that are saved from one */
-/* invocation to the next, and how the local variable FIRST is used to */
-/* avoid the need to assign most of them initial values with DATA */
-/* statements. */
-
-/* A few should be initialized, but aren't.  I've guessed initial values */
-/* for two of these, SFBUE and SLBUE, and I've convinced myself that for */
-/* VOICE, the effects of uninitialized values will die out after 2 or 3 */
-/* frame times.  It would still be good to choose initial values for */
-/* these, but I don't know what reasonable values would be (0 comes to */
-/* mind). */
-
-/* Revision 1.2  1996/03/13  16:09:28  jaf */
-/* Comments added explaining which of the local variables of this */
-/* subroutine need to be saved from one invocation to the next, and which */
-/* do not. */
-
-/* WARNING!  Some of them that should are never given initial values in */
-/* this code.  Hopefully, Fortran 77 defines initial values for them, but */
-/* even so, giving them explicit initial values is preferable. */
-
-/* WARNING!  VALUE(9) is used, but never assigned a value.  It should */
-/* probably be eliminated from the code. */
-
-/* Revision 1.1  1996/02/07 14:50:28  jaf */
-/* Initial revision */
-
-
-/****************************************************************************/
-
-/*        Voicing Detection (VOICIN) 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). */
-
-/* Inputs: */
-/*  VWIN      - Voicing window limits */
-/*              The indices read of arrays VWIN, INBUF, LPBUF, and BUFLIM */
-/*              are the same as those read by subroutine VPARMS. */
-/*  INBUF     - Input speech buffer */
-/*  LPBUF     - Low-pass filtered speech buffer */
-/*  BUFLIM    - INBUF and LPBUF limits */
-/*  HALF      - Present analysis half frame number */
-/*  MINAMD    - Minimum value of the AMDF */
-/*  MAXAMD    - Maximum value of the AMDF */
-/*  MINTAU    - Pointer to the lag of the minimum AMDF value */
-/*  IVRC(2)   - Inverse filter's RC's */
-/*              Only index 2 of array IVRC read under normal operation. */
-/*              (Index 1 is also read when debugging is turned on.) */
-/*  OBOUND    - Onset boundary descriptions */
-/*             Indices 1 through 3 read if (HALF .NE. 1), otherwise untouched.
-*/
-/*  AF        - The analysis frame number */
-/* Output: */
-/*  VOIBUF(2,0:AF) - Buffer of voicing decisions */
-/*              Index (HALF,3) written. */
-/*              If (HALF .EQ. 1), skip down to "Read (HALF,3)" below. */
-/*              Indices (1,2), (2,1), (1,2), and (2,2) read. */
-/*              One of the following is then done: */
-/*                 read (1,3) and possibly write (1,2) */
-/*                 read (1,3) and write (1,2) or (2,2) */
-/*                 write (2,1) */
-/*                 write (2,1) or (1,2) */
-/*                 read (1,0) and (1,3) and then write (2,2) or (1,1) */
-/*                 no reads or writes on VOIBUF */
-/*              Finally, read (HALF,3) */
-/* Internal: */
-/*  QS        - Ratio of preemphasized to full-band energies */
-/*  RC1       - First reflection coefficient */
-/* AR_B      - Product of the causal forward and reverse pitch prediction gain
-s*/
-/* AR_F      - Product of the noncausal forward and rev. pitch prediction gain
-s*/
-/*  ZC        - Zero crossing rate */
-/*  DITHER    - Zero crossing threshold level */
-/*  MAXMIN    - AMDF's 1 octave windowed maximum-to-minimum ratio */
-/*  MINPTR    - Location  of minimum AMDF value */
-/*  NVDC      - Number of elements in each VDC vector */
-/*  NVDCL     - Number of VDC vectors */
-/*  VDCL      - SNR values corresponding to the set of VDC's */
-/*  VDC       - 2-D voicing decision coefficient vector */
-/*  VALUE(9)  - Voicing Parameters */
-/*  VOICE(2,3)- History of LDA results */
-/*              On every call when (HALF .EQ. 1), VOICE(*,I+1) is */
-/*              shifted back to VOICE(*,I), for I=1,2. */
-/*              VOICE(HALF,3) is written on every call. */
-/*              Depending on several conditions, one or more of */
-/*              (1,1), (1,2), (2,1), and (2,2) might then be read. */
-/*  LBE       - Ratio of low-band instantaneous to average energies */
-/*  FBE       - Ratio of full-band instantaneous to average energies */
-/*  LBVE      - Low band voiced energy */
-/*  LBUE      - Low band unvoiced energy */
-/*  FBVE      - Full band voiced energy */
-/*  FBUE      - Full band unvoiced energy */
-/*  OFBUE     - Previous full-band unvoiced energy */
-/*  OLBUE     - Previous low-band unvoiced energy */
-/*  REF       - Reference energy for initialization and DITHER threshold */
-/*  SNR       - Estimate of signal-to-noise ratio */
-/*  SNR2      - Estimate of low-band signal-to-noise ratio */
-/*  SNRL      - SNR level number */
-/*  OT        - Onset transition present */
-/*  VSTATE    - Decimal interpretation of binary voicing classifications */
-/*  FIRST     - First call flag */
-
-/* This subroutine maintains local state from one call to the next.  If */
-/* you want to switch to using a new audio stream for this filter, or */
-/* reinitialize its state for any other reason, call the ENTRY */
-/* INITVOICIN. */
-
-/* Subroutine */ int voicin_(integer *vwin, real *inbuf, real *
-	lpbuf, integer *buflim, integer *half, real *minamd, real *maxamd, 
-	integer *mintau, real *ivrc, integer *obound, integer *voibuf, 
-	integer *af, struct lpc10_encoder_state *st)
-{
-    /* Initialized data */
-
-    real *dither;
-    static real vdc[100]	/* was [10][10] */ = { 0.f,1714.f,-110.f,
-	    334.f,-4096.f,-654.f,3752.f,3769.f,0.f,1181.f,0.f,874.f,-97.f,
-	    300.f,-4096.f,-1021.f,2451.f,2527.f,0.f,-500.f,0.f,510.f,-70.f,
-	    250.f,-4096.f,-1270.f,2194.f,2491.f,0.f,-1500.f,0.f,500.f,-10.f,
-	    200.f,-4096.f,-1300.f,2e3f,2e3f,0.f,-2e3f,0.f,500.f,0.f,0.f,
-	    -4096.f,-1300.f,2e3f,2e3f,0.f,-2500.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
-	    0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
-	    0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
-	    0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f };
-    static integer nvdcl = 5;
-    static real vdcl[10] = { 600.f,450.f,300.f,200.f,0.f,0.f,0.f,0.f,0.f,0.f }
-	    ;
-
-    /* System generated locals */
-    integer inbuf_offset, lpbuf_offset, i__1, i__2;
-    real r__1, r__2;
-
-    /* Builtin functions */
-    integer i_nint(real *);
-    double sqrt(doublereal);
-
-    /* Local variables */
-    real ar_b__, ar_f__;
-    integer *lbve, *lbue, *fbve, *fbue;
-    integer snrl, i__;
-    integer *ofbue, *sfbue;
-    real *voice;
-    integer *olbue, *slbue;
-    real value[9];
-    integer zc;
-    logical ot;
-    real qs;
-    real *maxmin;
-    integer vstate;
-    real rc1;
-    extern /* Subroutine */ int vparms_(integer *, real *, real *, integer *, 
-	    integer *, real *, integer *, integer *, integer *, integer *, 
-	    real *, real *, real *, real *);
-    integer fbe, lbe;
-    real *snr;
-    real snr2;
-
-/* 	Global Variables: */
-/*       Arguments */
-/* $Log: voicin.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.2  1996/08/20  20:45:00  jaf
- * Removed all static local variables that were SAVE'd in the Fortran
- * code, and put them in struct lpc10_encoder_state that is passed as an
- * argument.
- *
- * Removed init function, since all initialization is now done in
- * init_lpc10_encoder_state().
- *
- * Revision 1.1  1996/08/19  22:30:14  jaf
- * Initial revision
- *
- */
-/* Revision 1.3  1996/03/29  22:05:55  jaf */
-/* Commented out the common block variables that are not needed by the */
-/* embedded version. */
-
-/* Revision 1.2  1996/03/26  19:34:50  jaf */
-/* Added comments indicating which constants are not needed in an */
-/* application that uses the LPC-10 coder. */
-
-/* Revision 1.1  1996/02/07  14:44:09  jaf */
-/* Initial revision */
-
-/*   LPC Processing control variables: */
-
-/* *** Read-only: initialized in setup */
-
-/*  Files for Speech, Parameter, and Bitstream Input & Output, */
-/*    and message and debug outputs. */
-
-/* Here are the only files which use these variables: */
-
-/* lpcsim.f setup.f trans.f error.f vqsetup.f */
-
-/* Many files which use fdebug are not listed, since it is only used in */
-/* those other files conditionally, to print trace statements. */
-/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/*  LPC order, Frame size, Quantization rate, Bits per frame, */
-/*    Error correction */
-/* Subroutine SETUP is the only place where order is assigned a value, */
-/* and that value is 10.  It could increase efficiency 1% or so to */
-/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
-*/
-/* a variable in a COMMON block, since it is used in many places in the */
-/* core of the coding and decoding routines.  Actually, I take that back. 
-*/
-/* At least when compiling with f2c, the upper bound of DO loops is */
-/* stored in a local variable before the DO loop begins, and then that is 
-*/
-/* compared against on each iteration. */
-/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
-/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
-/* is used in only a few places, and never in the core coding and */
-/* decoding routines, so it could be eliminated entirely. */
-/* nbits is similar to quant, and is given a value of 54 in SETUP. */
-/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
-/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
-/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
-*/
-/* a constant or a variable, since it is only examined once per frame. */
-/* Leaving it as a variable that is set to .TRUE.  seems like a good */
-/* idea, since it does enable some error-correction capability for */
-/* unvoiced frames, with no change in the coding rate, and no noticeable 
-*/
-/* quality difference in the decoded speech. */
-/* 	integer quant, nbits */
-/* *** Read/write: variables for debugging, not needed for LPC algorithm 
-*/
-
-/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
-*/
-/*    Debug listing detail level, Line count on listing page */
-
-/* nframe is not needed for an embedded LPC10 at all. */
-/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
-/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
-/* an application, I would recommend removing the call to ERROR in RCCHK, 
-*/
-/* and remove ERROR and nunsfm completely. */
-/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
-*/
-/* sread.f.  When LPC10 is embedded into an application, one might want */
-/* to cause it to be incremented in a routine that takes the output of */
-/* SYNTHS and sends it to an audio device.  It could be optionally */
-/* displayed, for those that might want to know what it is. */
-/* maxosp is never initialized to 0 in SETUP, although it probably should 
-*/
-/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
-/* would be of much interest to an application in which LPC10 is */
-/* embedded. */
-/* listl and lincnt are not needed for an embedded LPC10 at all. */
-/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
-/* 	common /contrl/ quant, nbits */
-/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
-/* 	Parameters/constants */
-/*       Voicing coefficient and Linear Discriminant Analysis variables: 
-*/
-/*       Max number of VDC's and VDC levels */
-/*       The following are not Fortran PARAMETER's, but they are */
-/*       initialized with DATA statements, and never modified. */
-/*       Actual number of VDC's and levels */
-/*       Local variables that need not be saved */
-/*       Note: */
-
-/*       VALUE(1) through VALUE(8) are assigned values, but VALUE(9) */
-/*       never is.  Yet VALUE(9) is read in the loop that begins "DO I = 
-*/
-/*       1, 9" below.  I believe that this doesn't cause any problems in 
-*/
-/*       this subroutine, because all VDC(9,*) array elements are 0, and 
-*/
-/*       this is what is multiplied by VALUE(9) in all cases.  Still, it 
-*/
-/*       would save a multiplication to change the loop to "DO I = 1, 8". 
-*/
-/*       Local state */
-/*       WARNING! */
-
-/*       VOICE, SFBUE, and SLBUE should be saved from one invocation to */
-/*       the next, but they are never given an initial value. */
-
-/*       Does Fortran 77 specify some default initial value, like 0, or */
-/*       is it undefined?  If it is undefined, then this code should be */
-/*       corrected to specify an initial value. */
-
-/*       For VOICE, note that it is "shifted" in the statement that */
-/*       begins "IF (HALF .EQ. 1) THEN" below.  Also, uninitialized */
-/*       values in the VOICE array can only affect entries in the VOIBUF 
-*/
-/*       array that are for the same frame, or for an older frame.  Thus 
-*/
-/*       the effects of uninitialized values in VOICE cannot linger on */
-/*       for more than 2 or 3 frame times. */
-
-/*       For SFBUE and SLBUE, the effects of uninitialized values can */
-/*       linger on for many frame times, because their previous values */
-/*       are exponentially decayed.  Thus it is more important to choose 
-*/
-/*       initial values for these variables.  I would guess that a */
-/*       reasonable initial value for SFBUE is REF/16, the same as used */
-/*       for FBUE and OFBUE.  Similarly, SLBUE can be initialized to */
-/*       REF/32, the same as for LBUE and OLBUE. */
-
-/*       These guessed initial values should be validated by re-running */
-/*       the modified program on some audio samples. */
-
-/*   Declare and initialize filters: */
-
-    dither = (&st->dither);
-    snr = (&st->snr);
-    maxmin = (&st->maxmin);
-    voice = (&st->voice[0]);
-    lbve = (&st->lbve);
-    lbue = (&st->lbue);
-    fbve = (&st->fbve);
-    fbue = (&st->fbue);
-    ofbue = (&st->ofbue);
-    olbue = (&st->olbue);
-    sfbue = (&st->sfbue);
-    slbue = (&st->slbue);
-
-    /* Parameter adjustments */
-    if (vwin) {
-	--vwin;
-	}
-    if (buflim) {
-	--buflim;
-	}
-    if (inbuf) {
-	inbuf_offset = buflim[1];
-	inbuf -= inbuf_offset;
-	}
-    if (lpbuf) {
-	lpbuf_offset = buflim[3];
-	lpbuf -= lpbuf_offset;
-	}
-    if (ivrc) {
-	--ivrc;
-	}
-    if (obound) {
-	--obound;
-	}
-    if (voibuf) {
-	--voibuf;
-	}
-
-    /* Function Body */
-
-/*       The following variables are saved from one invocation to the */
-/*       next, but are not initialized with DATA statements.  This is */
-/*       acceptable, because FIRST is initialized ot .TRUE., and the */
-/*       first time that this subroutine is then called, they are all */
-/*       given initial values. */
-
-/*       SNR */
-/*       LBVE, LBUE, FBVE, FBUE, OFBUE, OLBUE */
-
-/*       MAXMIN is initialized on the first call, assuming that HALF */
-/*       .EQ. 1 on first call.  This is how ANALYS calls this subroutine. 
-*/
-
-/*   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 voicin
-g*/
-/*  parameter order above.  Each row (VDC vector) is optimized for a speci
-fic*/
-/*   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 functio
-n*/
-/*   (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 == 1) {
-	voice[0] = voice[2];
-	voice[1] = voice[3];
-	voice[2] = voice[4];
-	voice[3] = voice[5];
-	*maxmin = *maxamd / max(*minamd,1.f);
-    }
-/*   Calculate voicing parameters twice per frame: */
-    vparms_(&vwin[1], &inbuf[inbuf_offset], &lpbuf[lpbuf_offset], &buflim[1], 
-	    half, 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. */
-    r__1 = (*snr + *fbve / (real) max(*fbue,1)) * 63 / 64.f;
-    *snr = (real) i_nint(&r__1);
-    snr2 = *snr * *fbue / max(*lbue,1);
-/*   Quantize SNR to SNRL according to VDCL thresholds. */
-    snrl = 1;
-    i__1 = nvdcl - 1;
-    for (snrl = 1; snrl <= i__1; ++snrl) {
-	if (snr2 > vdcl[snrl - 1]) {
-	    goto L69;
-	}
-    }
-/*   	(Note:  SNRL = NVDCL here) */
-L69:
-/*   Linear discriminant voicing parameters: */
-    value[0] = *maxmin;
-    value[1] = (real) lbe / max(*lbve,1);
-    value[2] = (real) zc;
-    value[3] = rc1;
-    value[4] = qs;
-    value[5] = ivrc[2];
-    value[6] = ar_b__;
-    value[7] = ar_f__;
-/*   Evaluation of linear discriminant function: */
-    voice[*half + 3] = vdc[snrl * 10 - 1];
-    for (i__ = 1; i__ <= 8; ++i__) {
-	voice[*half + 3] += vdc[i__ + snrl * 10 - 11] * value[i__ - 1];
-    }
-/*   Classify as voiced if discriminant > 0, otherwise unvoiced */
-/*   Voicing decision for current half-frame:  1 = Voiced; 0 = Unvoiced */
-    if (voice[*half + 3] > 0.f) {
-	voibuf[*half + 6] = 1;
-    } else {
-	voibuf[*half + 6] = 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 == 1) {
-	goto L99;
-    }
-/*   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[1] & 2) != 0 || obound[2] == 1) && (obound[3] & 1) == 0;
-/*   Multi-way dispatch on voicing decision history: */
-    vstate = (voibuf[3] << 3) + (voibuf[4] << 2) + (voibuf[5] << 1) + voibuf[
-	    6];
-    switch (vstate + 1) {
-	case 1:  goto L99;
-	case 2:  goto L1;
-	case 3:  goto L2;
-	case 4:  goto L99;
-	case 5:  goto L4;
-	case 6:  goto L5;
-	case 7:  goto L6;
-	case 8:  goto L7;
-	case 9:  goto L8;
-	case 10:  goto L99;
-	case 11:  goto L10;
-	case 12:  goto L11;
-	case 13:  goto L99;
-	case 14:  goto L13;
-	case 15:  goto L14;
-	case 16:  goto L99;
-    }
-L1:
-    if (ot && voibuf[7] == 1) {
-	voibuf[5] = 1;
-    }
-    goto L99;
-L2:
-    if (voibuf[7] == 0 || voice[2] < -voice[3]) {
-	voibuf[5] = 0;
-    } else {
-	voibuf[6] = 1;
-    }
-    goto L99;
-L4:
-    voibuf[4] = 0;
-    goto L99;
-L5:
-    if (voice[1] < -voice[2]) {
-	voibuf[4] = 0;
-    } else {
-	voibuf[5] = 1;
-    }
-    goto L99;
-/*   VOIBUF(2,0) must be 0 */
-L6:
-    if (voibuf[1] == 1 || voibuf[7] == 1 || voice[3] > voice[0]) {
-	voibuf[6] = 1;
-    } else {
-	voibuf[3] = 1;
-    }
-    goto L99;
-L7:
-    if (ot) {
-	voibuf[4] = 0;
-    }
-    goto L99;
-L8:
-    if (ot) {
-	voibuf[4] = 1;
-    }
-    goto L99;
-L10:
-    if (voice[2] < -voice[1]) {
-	voibuf[5] = 0;
-    } else {
-	voibuf[4] = 1;
-    }
-    goto L99;
-L11:
-    voibuf[4] = 1;
-    goto L99;
-L13:
-    if (voibuf[7] == 0 && voice[3] < -voice[2]) {
-	voibuf[6] = 0;
-    } else {
-	voibuf[5] = 1;
-    }
-    goto L99;
-L14:
-    if (ot && voibuf[7] == 0) {
-	voibuf[5] = 0;
-    }
-/* 	GOTO 99 */
-L99:
-/*   Now update parameters: */
-/*   ---------------------- */
-
-/*  During unvoiced half-frames, update the low band and full band unvoice
-d*/
-/*   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 (voibuf[*half + 6] == 0) {
-/* Computing MIN */
-	i__1 = fbe, i__2 = *ofbue * 3;
-	r__1 = (*sfbue * 63 + (min(i__1,i__2) << 3)) / 64.f;
-	*sfbue = i_nint(&r__1);
-	*fbue = *sfbue / 8;
-	*ofbue = fbe;
-/* Computing MIN */
-	i__1 = lbe, i__2 = *olbue * 3;
-	r__1 = (*slbue * 63 + (min(i__1,i__2) << 3)) / 64.f;
-	*slbue = i_nint(&r__1);
-	*lbue = *slbue / 8;
-	*olbue = lbe;
-    } else {
-	r__1 = (*lbve * 63 + lbe) / 64.f;
-	*lbve = i_nint(&r__1);
-	r__1 = (*fbve * 63 + fbe) / 64.f;
-	*fbve = i_nint(&r__1);
-    }
-/*   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 */
-    r__2 = (real)(sqrt((real) (*lbue * *lbve)) * 64 / 3000);
-    r__1 = max(r__2,1.f);
-    *dither = min(r__1,20.f);
-/*   Voicing decisions are returned in VOIBUF. */
-    return 0;
-} /* voicin_ */
+/*
+
+$Log: voicin.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.2  1996/08/20  20:45:00  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:14  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int voicin_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *minamd, real *maxamd, integer *mintau, real *ivrc, integer *obound, integer *voibuf, integer *af, struct lpc10_encoder_state *st);
+/* comlen contrl_ 12 */
+/*:ref: vparms_ 14 14 4 6 6 4 4 6 4 4 4 4 6 6 6 6 */
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Common Block Declarations */
+
+extern struct {
+    integer order, lframe;
+    logical corrp;
+} contrl_;
+
+#define contrl_1 contrl_
+
+/****************************************************************************/
+
+/* 	VOICIN Version 52 */
+
+/* $Log: voicin.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:45:00  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:14  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.10  1996/03/29  17:59:14  jaf */
+/* Avoided using VALUE(9), although it shouldn't affect the function of */
+/* the code at all, because it was always multiplied by VDC(9,SNRL), */
+/* which is 0 for all values of SNRL.  Still, if VALUE(9) had an initial */
+/* value of IEEE NaN, it might cause trouble (I don't know how IEEE */
+/* defines Nan * 0.  It should either be NaN or 0.) */
+
+/* Revision 1.9  1996/03/29  17:54:46  jaf */
+/* Added a few comments about the accesses made to argument array VOIBUF */
+/* and the local saved array VOICE. */
+
+/* Revision 1.8  1996/03/27  18:19:54  jaf */
+/* Added an assignment to VSTATE that does not affect the function of the */
+/* program at all.  The only reason I put it in was so that the tracing */
+/* statements at the end, when enabled, will print a consistent value for */
+/* VSTATE when HALF .EQ. 1, rather than a garbage value that could change */
+/* from one call to the next. */
+
+/* Revision 1.7  1996/03/26  20:00:06  jaf */
+/* Removed the inclusion of the file "vcomm.fh", and put its contents */
+/* into this file.  It was included nowhere else but here. */
+
+/* Revision 1.6  1996/03/26  19:38:09  jaf */
+/* Commented out trace statements. */
+
+/* Revision 1.5  1996/03/19  20:43:45  jaf */
+/* Added comments about which indices of OBOUND and VOIBUF can be */
+/* accessed, and whether they are read or written.  VOIBUF is fairly */
+/* messy. */
+
+/* Revision 1.4  1996/03/19  15:00:58  jaf */
+/* Moved the DATA statements for the *VDC* variables later, as it is */
+/* apparently illegal to have DATA statements before local variable */
+/* declarations. */
+
+/* Revision 1.3  1996/03/19  00:10:49  jaf */
+/* Heavily commented the local variables that are saved from one */
+/* invocation to the next, and how the local variable FIRST is used to */
+/* avoid the need to assign most of them initial values with DATA */
+/* statements. */
+
+/* A few should be initialized, but aren't.  I've guessed initial values */
+/* for two of these, SFBUE and SLBUE, and I've convinced myself that for */
+/* VOICE, the effects of uninitialized values will die out after 2 or 3 */
+/* frame times.  It would still be good to choose initial values for */
+/* these, but I don't know what reasonable values would be (0 comes to */
+/* mind). */
+
+/* Revision 1.2  1996/03/13  16:09:28  jaf */
+/* Comments added explaining which of the local variables of this */
+/* subroutine need to be saved from one invocation to the next, and which */
+/* do not. */
+
+/* WARNING!  Some of them that should are never given initial values in */
+/* this code.  Hopefully, Fortran 77 defines initial values for them, but */
+/* even so, giving them explicit initial values is preferable. */
+
+/* WARNING!  VALUE(9) is used, but never assigned a value.  It should */
+/* probably be eliminated from the code. */
+
+/* Revision 1.1  1996/02/07 14:50:28  jaf */
+/* Initial revision */
+
+
+/****************************************************************************/
+
+/*        Voicing Detection (VOICIN) 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). */
+
+/* Inputs: */
+/*  VWIN      - Voicing window limits */
+/*              The indices read of arrays VWIN, INBUF, LPBUF, and BUFLIM */
+/*              are the same as those read by subroutine VPARMS. */
+/*  INBUF     - Input speech buffer */
+/*  LPBUF     - Low-pass filtered speech buffer */
+/*  BUFLIM    - INBUF and LPBUF limits */
+/*  HALF      - Present analysis half frame number */
+/*  MINAMD    - Minimum value of the AMDF */
+/*  MAXAMD    - Maximum value of the AMDF */
+/*  MINTAU    - Pointer to the lag of the minimum AMDF value */
+/*  IVRC(2)   - Inverse filter's RC's */
+/*              Only index 2 of array IVRC read under normal operation. */
+/*              (Index 1 is also read when debugging is turned on.) */
+/*  OBOUND    - Onset boundary descriptions */
+/*             Indices 1 through 3 read if (HALF .NE. 1), otherwise untouched.
+*/
+/*  AF        - The analysis frame number */
+/* Output: */
+/*  VOIBUF(2,0:AF) - Buffer of voicing decisions */
+/*              Index (HALF,3) written. */
+/*              If (HALF .EQ. 1), skip down to "Read (HALF,3)" below. */
+/*              Indices (1,2), (2,1), (1,2), and (2,2) read. */
+/*              One of the following is then done: */
+/*                 read (1,3) and possibly write (1,2) */
+/*                 read (1,3) and write (1,2) or (2,2) */
+/*                 write (2,1) */
+/*                 write (2,1) or (1,2) */
+/*                 read (1,0) and (1,3) and then write (2,2) or (1,1) */
+/*                 no reads or writes on VOIBUF */
+/*              Finally, read (HALF,3) */
+/* Internal: */
+/*  QS        - Ratio of preemphasized to full-band energies */
+/*  RC1       - First reflection coefficient */
+/* AR_B      - Product of the causal forward and reverse pitch prediction gain
+s*/
+/* AR_F      - Product of the noncausal forward and rev. pitch prediction gain
+s*/
+/*  ZC        - Zero crossing rate */
+/*  DITHER    - Zero crossing threshold level */
+/*  MAXMIN    - AMDF's 1 octave windowed maximum-to-minimum ratio */
+/*  MINPTR    - Location  of minimum AMDF value */
+/*  NVDC      - Number of elements in each VDC vector */
+/*  NVDCL     - Number of VDC vectors */
+/*  VDCL      - SNR values corresponding to the set of VDC's */
+/*  VDC       - 2-D voicing decision coefficient vector */
+/*  VALUE(9)  - Voicing Parameters */
+/*  VOICE(2,3)- History of LDA results */
+/*              On every call when (HALF .EQ. 1), VOICE(*,I+1) is */
+/*              shifted back to VOICE(*,I), for I=1,2. */
+/*              VOICE(HALF,3) is written on every call. */
+/*              Depending on several conditions, one or more of */
+/*              (1,1), (1,2), (2,1), and (2,2) might then be read. */
+/*  LBE       - Ratio of low-band instantaneous to average energies */
+/*  FBE       - Ratio of full-band instantaneous to average energies */
+/*  LBVE      - Low band voiced energy */
+/*  LBUE      - Low band unvoiced energy */
+/*  FBVE      - Full band voiced energy */
+/*  FBUE      - Full band unvoiced energy */
+/*  OFBUE     - Previous full-band unvoiced energy */
+/*  OLBUE     - Previous low-band unvoiced energy */
+/*  REF       - Reference energy for initialization and DITHER threshold */
+/*  SNR       - Estimate of signal-to-noise ratio */
+/*  SNR2      - Estimate of low-band signal-to-noise ratio */
+/*  SNRL      - SNR level number */
+/*  OT        - Onset transition present */
+/*  VSTATE    - Decimal interpretation of binary voicing classifications */
+/*  FIRST     - First call flag */
+
+/* This subroutine maintains local state from one call to the next.  If */
+/* you want to switch to using a new audio stream for this filter, or */
+/* reinitialize its state for any other reason, call the ENTRY */
+/* INITVOICIN. */
+
+/* Subroutine */ int voicin_(integer *vwin, real *inbuf, real *
+	lpbuf, integer *buflim, integer *half, real *minamd, real *maxamd, 
+	integer *mintau, real *ivrc, integer *obound, integer *voibuf, 
+	integer *af, struct lpc10_encoder_state *st)
+{
+    /* Initialized data */
+
+    real *dither;
+    static real vdc[100]	/* was [10][10] */ = { 0.f,1714.f,-110.f,
+	    334.f,-4096.f,-654.f,3752.f,3769.f,0.f,1181.f,0.f,874.f,-97.f,
+	    300.f,-4096.f,-1021.f,2451.f,2527.f,0.f,-500.f,0.f,510.f,-70.f,
+	    250.f,-4096.f,-1270.f,2194.f,2491.f,0.f,-1500.f,0.f,500.f,-10.f,
+	    200.f,-4096.f,-1300.f,2e3f,2e3f,0.f,-2e3f,0.f,500.f,0.f,0.f,
+	    -4096.f,-1300.f,2e3f,2e3f,0.f,-2500.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
+	    0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
+	    0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
+	    0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f };
+    static integer nvdcl = 5;
+    static real vdcl[10] = { 600.f,450.f,300.f,200.f,0.f,0.f,0.f,0.f,0.f,0.f }
+	    ;
+
+    /* System generated locals */
+    integer inbuf_offset, lpbuf_offset, i__1, i__2;
+    real r__1, r__2;
+
+    /* Builtin functions */
+    integer i_nint(real *);
+    double sqrt(doublereal);
+
+    /* Local variables */
+    real ar_b__, ar_f__;
+    integer *lbve, *lbue, *fbve, *fbue;
+    integer snrl, i__;
+    integer *ofbue, *sfbue;
+    real *voice;
+    integer *olbue, *slbue;
+    real value[9];
+    integer zc;
+    logical ot;
+    real qs;
+    real *maxmin;
+    integer vstate;
+    real rc1;
+    extern /* Subroutine */ int vparms_(integer *, real *, real *, integer *, 
+	    integer *, real *, integer *, integer *, integer *, integer *, 
+	    real *, real *, real *, real *);
+    integer fbe, lbe;
+    real *snr;
+    real snr2;
+
+/* 	Global Variables: */
+/*       Arguments */
+/* $Log: voicin.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.2  1996/08/20  20:45:00  jaf
+ * Removed all static local variables that were SAVE'd in the Fortran
+ * code, and put them in struct lpc10_encoder_state that is passed as an
+ * argument.
+ *
+ * Removed init function, since all initialization is now done in
+ * init_lpc10_encoder_state().
+ *
+ * Revision 1.1  1996/08/19  22:30:14  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.3  1996/03/29  22:05:55  jaf */
+/* Commented out the common block variables that are not needed by the */
+/* embedded version. */
+
+/* Revision 1.2  1996/03/26  19:34:50  jaf */
+/* Added comments indicating which constants are not needed in an */
+/* application that uses the LPC-10 coder. */
+
+/* Revision 1.1  1996/02/07  14:44:09  jaf */
+/* Initial revision */
+
+/*   LPC Processing control variables: */
+
+/* *** Read-only: initialized in setup */
+
+/*  Files for Speech, Parameter, and Bitstream Input & Output, */
+/*    and message and debug outputs. */
+
+/* Here are the only files which use these variables: */
+
+/* lpcsim.f setup.f trans.f error.f vqsetup.f */
+
+/* Many files which use fdebug are not listed, since it is only used in */
+/* those other files conditionally, to print trace statements. */
+/* 	integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/*  LPC order, Frame size, Quantization rate, Bits per frame, */
+/*    Error correction */
+/* Subroutine SETUP is the only place where order is assigned a value, */
+/* and that value is 10.  It could increase efficiency 1% or so to */
+/* declare order as a constant (i.e., a Fortran PARAMETER) instead of as 
+*/
+/* a variable in a COMMON block, since it is used in many places in the */
+/* core of the coding and decoding routines.  Actually, I take that back. 
+*/
+/* At least when compiling with f2c, the upper bound of DO loops is */
+/* stored in a local variable before the DO loop begins, and then that is 
+*/
+/* compared against on each iteration. */
+/* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
+/* Similarly for quant, which is given a value of 2400 in SETUP.  quant */
+/* is used in only a few places, and never in the core coding and */
+/* decoding routines, so it could be eliminated entirely. */
+/* nbits is similar to quant, and is given a value of 54 in SETUP. */
+/* corrp is given a value of .TRUE. in SETUP, and is only used in the */
+/* subroutines ENCODE and DECODE.  It doesn't affect the speed of the */
+/* coder significantly whether it is .TRUE. or .FALSE., or whether it is 
+*/
+/* a constant or a variable, since it is only examined once per frame. */
+/* Leaving it as a variable that is set to .TRUE.  seems like a good */
+/* idea, since it does enable some error-correction capability for */
+/* unvoiced frames, with no change in the coding rate, and no noticeable 
+*/
+/* quality difference in the decoded speech. */
+/* 	integer quant, nbits */
+/* *** Read/write: variables for debugging, not needed for LPC algorithm 
+*/
+
+/*  Current frame, Unstable frames, Output clip count, Max onset buffer, 
+*/
+/*    Debug listing detail level, Line count on listing page */
+
+/* nframe is not needed for an embedded LPC10 at all. */
+/* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
+/* ERROR, which is only called from RCCHK.  When LPC10 is embedded into */
+/* an application, I would recommend removing the call to ERROR in RCCHK, 
+*/
+/* and remove ERROR and nunsfm completely. */
+/* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in 
+*/
+/* sread.f.  When LPC10 is embedded into an application, one might want */
+/* to cause it to be incremented in a routine that takes the output of */
+/* SYNTHS and sends it to an audio device.  It could be optionally */
+/* displayed, for those that might want to know what it is. */
+/* maxosp is never initialized to 0 in SETUP, although it probably should 
+*/
+/* be, and it is updated in subroutine ANALYS.  I doubt that its value */
+/* would be of much interest to an application in which LPC10 is */
+/* embedded. */
+/* listl and lincnt are not needed for an embedded LPC10 at all. */
+/* 	integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
+/* 	common /contrl/ quant, nbits */
+/* 	common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
+/* 	Parameters/constants */
+/*       Voicing coefficient and Linear Discriminant Analysis variables: 
+*/
+/*       Max number of VDC's and VDC levels */
+/*       The following are not Fortran PARAMETER's, but they are */
+/*       initialized with DATA statements, and never modified. */
+/*       Actual number of VDC's and levels */
+/*       Local variables that need not be saved */
+/*       Note: */
+
+/*       VALUE(1) through VALUE(8) are assigned values, but VALUE(9) */
+/*       never is.  Yet VALUE(9) is read in the loop that begins "DO I = 
+*/
+/*       1, 9" below.  I believe that this doesn't cause any problems in 
+*/
+/*       this subroutine, because all VDC(9,*) array elements are 0, and 
+*/
+/*       this is what is multiplied by VALUE(9) in all cases.  Still, it 
+*/
+/*       would save a multiplication to change the loop to "DO I = 1, 8". 
+*/
+/*       Local state */
+/*       WARNING! */
+
+/*       VOICE, SFBUE, and SLBUE should be saved from one invocation to */
+/*       the next, but they are never given an initial value. */
+
+/*       Does Fortran 77 specify some default initial value, like 0, or */
+/*       is it undefined?  If it is undefined, then this code should be */
+/*       corrected to specify an initial value. */
+
+/*       For VOICE, note that it is "shifted" in the statement that */
+/*       begins "IF (HALF .EQ. 1) THEN" below.  Also, uninitialized */
+/*       values in the VOICE array can only affect entries in the VOIBUF 
+*/
+/*       array that are for the same frame, or for an older frame.  Thus 
+*/
+/*       the effects of uninitialized values in VOICE cannot linger on */
+/*       for more than 2 or 3 frame times. */
+
+/*       For SFBUE and SLBUE, the effects of uninitialized values can */
+/*       linger on for many frame times, because their previous values */
+/*       are exponentially decayed.  Thus it is more important to choose 
+*/
+/*       initial values for these variables.  I would guess that a */
+/*       reasonable initial value for SFBUE is REF/16, the same as used */
+/*       for FBUE and OFBUE.  Similarly, SLBUE can be initialized to */
+/*       REF/32, the same as for LBUE and OLBUE. */
+
+/*       These guessed initial values should be validated by re-running */
+/*       the modified program on some audio samples. */
+
+/*   Declare and initialize filters: */
+
+    dither = (&st->dither);
+    snr = (&st->snr);
+    maxmin = (&st->maxmin);
+    voice = (&st->voice[0]);
+    lbve = (&st->lbve);
+    lbue = (&st->lbue);
+    fbve = (&st->fbve);
+    fbue = (&st->fbue);
+    ofbue = (&st->ofbue);
+    olbue = (&st->olbue);
+    sfbue = (&st->sfbue);
+    slbue = (&st->slbue);
+
+    /* Parameter adjustments */
+    if (vwin) {
+	--vwin;
+	}
+    if (buflim) {
+	--buflim;
+	}
+    if (inbuf) {
+	inbuf_offset = buflim[1];
+	inbuf -= inbuf_offset;
+	}
+    if (lpbuf) {
+	lpbuf_offset = buflim[3];
+	lpbuf -= lpbuf_offset;
+	}
+    if (ivrc) {
+	--ivrc;
+	}
+    if (obound) {
+	--obound;
+	}
+    if (voibuf) {
+	--voibuf;
+	}
+
+    /* Function Body */
+
+/*       The following variables are saved from one invocation to the */
+/*       next, but are not initialized with DATA statements.  This is */
+/*       acceptable, because FIRST is initialized ot .TRUE., and the */
+/*       first time that this subroutine is then called, they are all */
+/*       given initial values. */
+
+/*       SNR */
+/*       LBVE, LBUE, FBVE, FBUE, OFBUE, OLBUE */
+
+/*       MAXMIN is initialized on the first call, assuming that HALF */
+/*       .EQ. 1 on first call.  This is how ANALYS calls this subroutine. 
+*/
+
+/*   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 voicin
+g*/
+/*  parameter order above.  Each row (VDC vector) is optimized for a speci
+fic*/
+/*   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 functio
+n*/
+/*   (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 == 1) {
+	voice[0] = voice[2];
+	voice[1] = voice[3];
+	voice[2] = voice[4];
+	voice[3] = voice[5];
+	*maxmin = *maxamd / max(*minamd,1.f);
+    }
+/*   Calculate voicing parameters twice per frame: */
+    vparms_(&vwin[1], &inbuf[inbuf_offset], &lpbuf[lpbuf_offset], &buflim[1], 
+	    half, 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. */
+    r__1 = (*snr + *fbve / (real) max(*fbue,1)) * 63 / 64.f;
+    *snr = (real) i_nint(&r__1);
+    snr2 = *snr * *fbue / max(*lbue,1);
+/*   Quantize SNR to SNRL according to VDCL thresholds. */
+    snrl = 1;
+    i__1 = nvdcl - 1;
+    for (snrl = 1; snrl <= i__1; ++snrl) {
+	if (snr2 > vdcl[snrl - 1]) {
+	    goto L69;
+	}
+    }
+/*   	(Note:  SNRL = NVDCL here) */
+L69:
+/*   Linear discriminant voicing parameters: */
+    value[0] = *maxmin;
+    value[1] = (real) lbe / max(*lbve,1);
+    value[2] = (real) zc;
+    value[3] = rc1;
+    value[4] = qs;
+    value[5] = ivrc[2];
+    value[6] = ar_b__;
+    value[7] = ar_f__;
+/*   Evaluation of linear discriminant function: */
+    voice[*half + 3] = vdc[snrl * 10 - 1];
+    for (i__ = 1; i__ <= 8; ++i__) {
+	voice[*half + 3] += vdc[i__ + snrl * 10 - 11] * value[i__ - 1];
+    }
+/*   Classify as voiced if discriminant > 0, otherwise unvoiced */
+/*   Voicing decision for current half-frame:  1 = Voiced; 0 = Unvoiced */
+    if (voice[*half + 3] > 0.f) {
+	voibuf[*half + 6] = 1;
+    } else {
+	voibuf[*half + 6] = 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 == 1) {
+	goto L99;
+    }
+/*   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[1] & 2) != 0 || obound[2] == 1) && (obound[3] & 1) == 0;
+/*   Multi-way dispatch on voicing decision history: */
+    vstate = (voibuf[3] << 3) + (voibuf[4] << 2) + (voibuf[5] << 1) + voibuf[
+	    6];
+    switch (vstate + 1) {
+	case 1:  goto L99;
+	case 2:  goto L1;
+	case 3:  goto L2;
+	case 4:  goto L99;
+	case 5:  goto L4;
+	case 6:  goto L5;
+	case 7:  goto L6;
+	case 8:  goto L7;
+	case 9:  goto L8;
+	case 10:  goto L99;
+	case 11:  goto L10;
+	case 12:  goto L11;
+	case 13:  goto L99;
+	case 14:  goto L13;
+	case 15:  goto L14;
+	case 16:  goto L99;
+    }
+L1:
+    if (ot && voibuf[7] == 1) {
+	voibuf[5] = 1;
+    }
+    goto L99;
+L2:
+    if (voibuf[7] == 0 || voice[2] < -voice[3]) {
+	voibuf[5] = 0;
+    } else {
+	voibuf[6] = 1;
+    }
+    goto L99;
+L4:
+    voibuf[4] = 0;
+    goto L99;
+L5:
+    if (voice[1] < -voice[2]) {
+	voibuf[4] = 0;
+    } else {
+	voibuf[5] = 1;
+    }
+    goto L99;
+/*   VOIBUF(2,0) must be 0 */
+L6:
+    if (voibuf[1] == 1 || voibuf[7] == 1 || voice[3] > voice[0]) {
+	voibuf[6] = 1;
+    } else {
+	voibuf[3] = 1;
+    }
+    goto L99;
+L7:
+    if (ot) {
+	voibuf[4] = 0;
+    }
+    goto L99;
+L8:
+    if (ot) {
+	voibuf[4] = 1;
+    }
+    goto L99;
+L10:
+    if (voice[2] < -voice[1]) {
+	voibuf[5] = 0;
+    } else {
+	voibuf[4] = 1;
+    }
+    goto L99;
+L11:
+    voibuf[4] = 1;
+    goto L99;
+L13:
+    if (voibuf[7] == 0 && voice[3] < -voice[2]) {
+	voibuf[6] = 0;
+    } else {
+	voibuf[5] = 1;
+    }
+    goto L99;
+L14:
+    if (ot && voibuf[7] == 0) {
+	voibuf[5] = 0;
+    }
+/* 	GOTO 99 */
+L99:
+/*   Now update parameters: */
+/*   ---------------------- */
+
+/*  During unvoiced half-frames, update the low band and full band unvoice
+d*/
+/*   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 (voibuf[*half + 6] == 0) {
+/* Computing MIN */
+	i__1 = fbe, i__2 = *ofbue * 3;
+	r__1 = (*sfbue * 63 + (min(i__1,i__2) << 3)) / 64.f;
+	*sfbue = i_nint(&r__1);
+	*fbue = *sfbue / 8;
+	*ofbue = fbe;
+/* Computing MIN */
+	i__1 = lbe, i__2 = *olbue * 3;
+	r__1 = (*slbue * 63 + (min(i__1,i__2) << 3)) / 64.f;
+	*slbue = i_nint(&r__1);
+	*lbue = *slbue / 8;
+	*olbue = lbe;
+    } else {
+	r__1 = (*lbve * 63 + lbe) / 64.f;
+	*lbve = i_nint(&r__1);
+	r__1 = (*fbve * 63 + fbe) / 64.f;
+	*fbve = i_nint(&r__1);
+    }
+/*   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 */
+    r__2 = (real)(sqrt((real) (*lbue * *lbve)) * 64 / 3000);
+    r__1 = max(r__2,1.f);
+    *dither = min(r__1,20.f);
+/*   Voicing decisions are returned in VOIBUF. */
+    return 0;
+} /* voicin_ */

Modified: freeswitch/trunk/libs/codec/lpc10/src/vparms.c
==============================================================================
--- freeswitch/trunk/libs/codec/lpc10/src/vparms.c	(original)
+++ freeswitch/trunk/libs/codec/lpc10/src/vparms.c	Fri Sep 21 14:49:14 2007
@@ -1,250 +1,250 @@
-/*
-
-$Log: vparms.c,v $
-Revision 1.1  2004/05/04 11:16:43  csoutheren
-Initial version
-
-Revision 1.2  2002/02/15 03:57:55  yurik
-Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
-
-Revision 1.1  2000/06/05 04:45:12  robertj
-Added LPC-10 2400bps codec
-
- * Revision 1.1  1996/08/19  22:30:04  jaf
- * Initial revision
- *
-
-*/
-
-#ifdef P_R_O_T_O_T_Y_P_E_S
-extern int vparms_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *dither, integer *mintau, integer *zc, integer *lbe, integer *fbe, real *qs, real *rc1, real *ar_b__, real *ar_f__);
-#endif
-
-/*  -- translated by f2c (version 19951025).
-   You must link the resulting object file with the libraries:
-	-lf2c -lm   (in that order)
-*/
-
-#include "f2c.h"
-
-/* Table of constant values */
-
-static real c_b2 = 1.f;
-
-/* ********************************************************************* */
-
-/* 	VPARMS Version 50 */
-
-/* $Log: vparms.c,v $
- * Revision 1.1  2004/05/04 11:16:43  csoutheren
- * Initial version
- *
- * Revision 1.2  2002/02/15 03:57:55  yurik
- * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
- *
- * Revision 1.1  2000/06/05 04:45:12  robertj
- * Added LPC-10 2400bps codec
- *
- * Revision 1.1  1996/08/19  22:30:04  jaf
- * Initial revision
- *
- */
-/* Revision 1.6  1996/03/29  18:01:16  jaf */
-/* Added some more comments about the range of INBUF and LPBUF that can */
-/* be read.  Note that it is possible for index VWIN(2)+1 to be read from */
-/* INBUF, which might be outside of its defined range, although that will */
-/* require more careful checking. */
-
-/* Revision 1.5  1996/03/19  00:02:02  jaf */
-/* I just noticed that the argument DITHER is modified inside of this */
-/* subroutine.  Comments were added explaining the possible final values. */
-
-/* Revision 1.4  1996/03/18  22:22:59  jaf */
-/* Finishing the job I said I did with the last check-in comments. */
-
-/* Revision 1.3  1996/03/18  22:22:17  jaf */
-/* Just added a few comments about which array indices of the arguments */
-/* are used, and mentioning that this subroutine has no local state. */
-
-/* Revision 1.2  1996/03/13  15:02:58  jaf */
-/* Comments added explaining that none of the local variables of this */
-/* subroutine need to be saved from one invocation to the next. */
-
-/* Revision 1.1  1996/02/07 14:50:42  jaf */
-/* Initial revision */
-
-
-/* ********************************************************************* */
-
-/*  Calculate voicing parameters: */
-
-/* Input: */
-/*  VWIN   - Voicing window limits */
-/*           Indices 1 through 2 read. */
-/*  INBUF  - Input speech buffer */
-/*           Indices START-1 through STOP read, */
-/*          where START and STOP are defined in the code (only written once).
-*/
-/*           Note that STOP can be as large as VWIN(2)+1 ! */
-/*  LPBUF  - Low pass filtered speech */
-/*           Indices START-MINTAU through STOP+MINTAU read, */
-/*          where START and STOP are defined in the code (only written once).
-*/
-/*  BUFLIM - Array bounds for INBUF and LPBUF */
-/*           Indices 1 through 4 read. */
-/*  HALF   - Half frame (1 or 2) */
-/*  MINTAU - Lag corresponding to minimum AMDF value (pitch estimate) */
-/* Input/Output: */
-/*  DITHER - Zero crossing threshold */
-/*           The resulting value might be the negation of the input */
-/*           value.  It might always be the same as the input value, */
-/*           if the DO loop below always executes an even number of times. */
-/* Output: (all of them are written on every call) */
-/*  ZC     - Zero crossing rate */
-/*  LBE    - Low band energy (sum of magnitudes - SM) */
-/*  FBE    - Full band energy (SM) */
-/*  QS     - Ratio of 6 dB/oct preemphasized energy to full band energy */
-/*  RC1    - First reflection coefficient */
-/*  AR_B   - Product of the causal forward and reverse pitch */
-/*           prediction gains */
-/*  AR_F   - Product of the noncausal forward and reverse pitch */
-/*           prediction gains */
-/* Internal: */
-/*  OLDSGN - Previous sign of dithered signal */
-/*  VLEN   - Length of voicing window */
-/*  START  - Lower address of current half of voicing window */
-/*  STOP   - Upper address of current half of voicing window */
-/*  E_0    - Energy of LPF speech (sum of squares - SS) */
-/*  E_B    - Energy of LPF speech backward one pitch period (SS) */
-/*  E_F    - Energy of LPF speech forward one pitch period (SS) */
-/*  R_B    - Autocovariance of LPF speech backward one pitch period */
-/*  R_F    - Autocovariance of LPF speech forward one pitch period */
-/*  LP_RMS - Energy of LPF speech (sum of magnitudes - SM) */
-/*  AP_RMS - Energy of all-pass speech (SM) */
-/*  E_PRE  - Energy of 6dB preemphasized speech (SM) */
-/*  E0AP   - Energy of all-pass speech (SS) */
-
-/* This subroutine has no local state. */
-
-/* Subroutine */ int vparms_(integer *vwin, real *inbuf, real *lpbuf, integer 
-	*buflim, integer *half, real *dither, integer *mintau, integer *zc, 
-	integer *lbe, integer *fbe, real *qs, real *rc1, real *ar_b__, real *
-	ar_f__)
-{
-    /* System generated locals */
-    integer inbuf_offset, lpbuf_offset, i__1;
-    real r__1, r__2;
-
-    /* Builtin functions */
-    double r_sign(real *, real *);
-    integer i_nint(real *);
-
-    /* Local variables */
-    integer vlen, stop, i__;
-    real e_pre__;
-    integer start;
-    real ap_rms__, e_0__, oldsgn, lp_rms__, e_b__, e_f__, r_b__, r_f__, e0ap;
-
-/*       Arguments */
-/*       Local variables that need not be saved */
-/*   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. */
-    /* Parameter adjustments */
-    --vwin;
-    --buflim;
-    lpbuf_offset = buflim[3];
-    lpbuf -= lpbuf_offset;
-    inbuf_offset = buflim[1];
-    inbuf -= inbuf_offset;
-
-    /* Function Body */
-    lp_rms__ = 0.f;
-    ap_rms__ = 0.f;
-    e_pre__ = 0.f;
-    e0ap = 0.f;
-    *rc1 = 0.f;
-    e_0__ = 0.f;
-    e_b__ = 0.f;
-    e_f__ = 0.f;
-    r_f__ = 0.f;
-    r_b__ = 0.f;
-    *zc = 0;
-    vlen = vwin[2] - vwin[1] + 1;
-    start = vwin[1] + (*half - 1) * 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 */
-
-/* Note that if VLEN is even and HALF is 2, then STOP will be */
-/* VWIN(1)+VLEN = VWIN(2)+1.  That could be bad, if that index of INBUF */
-/* is undefined. */
-
-    r__1 = inbuf[start - 1] - *dither;
-    oldsgn = (real)r_sign(&c_b2, &r__1);
-    i__1 = stop;
-    for (i__ = start; i__ <= i__1; ++i__) {
-	lp_rms__ += (r__1 = lpbuf[i__], abs(r__1));
-	ap_rms__ += (r__1 = inbuf[i__], abs(r__1));
-	e_pre__ += (r__1 = inbuf[i__] - inbuf[i__ - 1], abs(r__1));
-/* Computing 2nd power */
-	r__1 = inbuf[i__];
-	e0ap += r__1 * r__1;
-	*rc1 += inbuf[i__] * inbuf[i__ - 1];
-/* Computing 2nd power */
-	r__1 = lpbuf[i__];
-	e_0__ += r__1 * r__1;
-/* Computing 2nd power */
-	r__1 = lpbuf[i__ - *mintau];
-	e_b__ += r__1 * r__1;
-/* Computing 2nd power */
-	r__1 = lpbuf[i__ + *mintau];
-	e_f__ += r__1 * r__1;
-	r_f__ += lpbuf[i__] * lpbuf[i__ + *mintau];
-	r_b__ += lpbuf[i__] * lpbuf[i__ - *mintau];
-	r__1 = inbuf[i__] + *dither;
-	if (r_sign(&c_b2, &r__1) != oldsgn) {
-	    ++(*zc);
-	    oldsgn = -oldsgn;
-	}
-	*dither = -(*dither);
-    }
-/*   Normalized short-term autocovariance coefficient at unit sample delay
- */
-    *rc1 /= max(e0ap,1.f);
-/*  Ratio of the energy of the first difference signal (6 dB/oct preemphas
-is)*/
-/*   to the energy of the full band signal */
-/* Computing MAX */
-    r__1 = ap_rms__ * 2.f;
-    *qs = e_pre__ / max(r__1,1.f);
-/*   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.f) * (r_b__ / max(e_0__,1.f));
-/*  aR_f is the same as aR_b, but looking forward in time (non causal case
-).*/
-    *ar_f__ = r_f__ / max(e_f__,1.f) * (r_f__ / max(e_0__,1.f));
-/*   Normalize ZC, LBE, and FBE to old fixed window length of 180. */
-/*   (The fraction 90/VLEN has a range of .58 to 1) */
-    r__2 = (real) (*zc << 1);
-    r__1 = r__2 * (90.f / vlen);
-    *zc = i_nint(&r__1);
-/* Computing MIN */
-    r__1 = lp_rms__ / 4 * (90.f / vlen);
-    i__1 = i_nint(&r__1);
-    *lbe = min(i__1,32767);
-/* Computing MIN */
-    r__1 = ap_rms__ / 4 * (90.f / vlen);
-    i__1 = i_nint(&r__1);
-    *fbe = min(i__1,32767);
-    return 0;
-} /* vparms_ */
-
+/*
+
+$Log: vparms.c,v $
+Revision 1.1  2004/05/04 11:16:43  csoutheren
+Initial version
+
+Revision 1.2  2002/02/15 03:57:55  yurik
+Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+
+Revision 1.1  2000/06/05 04:45:12  robertj
+Added LPC-10 2400bps codec
+
+ * Revision 1.1  1996/08/19  22:30:04  jaf
+ * Initial revision
+ *
+
+*/
+
+#ifdef P_R_O_T_O_T_Y_P_E_S
+extern int vparms_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *dither, integer *mintau, integer *zc, integer *lbe, integer *fbe, real *qs, real *rc1, real *ar_b__, real *ar_f__);
+#endif
+
+/*  -- translated by f2c (version 19951025).
+   You must link the resulting object file with the libraries:
+	-lf2c -lm   (in that order)
+*/
+
+#include "f2c.h"
+
+/* Table of constant values */
+
+static real c_b2 = 1.f;
+
+/* ********************************************************************* */
+
+/* 	VPARMS Version 50 */
+
+/* $Log: vparms.c,v $
+ * Revision 1.1  2004/05/04 11:16:43  csoutheren
+ * Initial version
+ *
+ * Revision 1.2  2002/02/15 03:57:55  yurik
+ * Warnings removed during compilation, patch courtesy of Jehan Bing, jehan at bravobrava.com
+ *
+ * Revision 1.1  2000/06/05 04:45:12  robertj
+ * Added LPC-10 2400bps codec
+ *
+ * Revision 1.1  1996/08/19  22:30:04  jaf
+ * Initial revision
+ *
+ */
+/* Revision 1.6  1996/03/29  18:01:16  jaf */
+/* Added some more comments about the range of INBUF and LPBUF that can */
+/* be read.  Note that it is possible for index VWIN(2)+1 to be read from */
+/* INBUF, which might be outside of its defined range, although that will */
+/* require more careful checking. */
+
+/* Revision 1.5  1996/03/19  00:02:02  jaf */
+/* I just noticed that the argument DITHER is modified inside of this */
+/* subroutine.  Comments were added explaining the possible final values. */
+
+/* Revision 1.4  1996/03/18  22:22:59  jaf */
+/* Finishing the job I said I did with the last check-in comments. */
+
+/* Revision 1.3  1996/03/18  22:22:17  jaf */
+/* Just added a few comments about which array indices of the arguments */
+/* are used, and mentioning that this subroutine has no local state. */
+
+/* Revision 1.2  1996/03/13  15:02:58  jaf */
+/* Comments added explaining that none of the local variables of this */
+/* subroutine need to be saved from one invocation to the next. */
+
+/* Revision 1.1  1996/02/07 14:50:42  jaf */
+/* Initial revision */
+
+
+/* ********************************************************************* */
+
+/*  Calculate voicing parameters: */
+
+/* Input: */
+/*  VWIN   - Voicing window limits */
+/*           Indices 1 through 2 read. */
+/*  INBUF  - Input speech buffer */
+/*           Indices START-1 through STOP read, */
+/*          where START and STOP are defined in the code (only written once).
+*/
+/*           Note that STOP can be as large as VWIN(2)+1 ! */
+/*  LPBUF  - Low pass filtered speech */
+/*           Indices START-MINTAU through STOP+MINTAU read, */
+/*          where START and STOP are defined in the code (only written once).
+*/
+/*  BUFLIM - Array bounds for INBUF and LPBUF */
+/*           Indices 1 through 4 read. */
+/*  HALF   - Half frame (1 or 2) */
+/*  MINTAU - Lag corresponding to minimum AMDF value (pitch estimate) */
+/* Input/Output: */
+/*  DITHER - Zero crossing threshold */
+/*           The resulting value might be the negation of the input */
+/*           value.  It might always be the same as the input value, */
+/*           if the DO loop below always executes an even number of times. */
+/* Output: (all of them are written on every call) */
+/*  ZC     - Zero crossing rate */
+/*  LBE    - Low band energy (sum of magnitudes - SM) */
+/*  FBE    - Full band energy (SM) */
+/*  QS     - Ratio of 6 dB/oct preemphasized energy to full band energy */
+/*  RC1    - First reflection coefficient */
+/*  AR_B   - Product of the causal forward and reverse pitch */
+/*           prediction gains */
+/*  AR_F   - Product of the noncausal forward and reverse pitch */
+/*           prediction gains */
+/* Internal: */
+/*  OLDSGN - Previous sign of dithered signal */
+/*  VLEN   - Length of voicing window */
+/*  START  - Lower address of current half of voicing window */
+/*  STOP   - Upper address of current half of voicing window */
+/*  E_0    - Energy of LPF speech (sum of squares - SS) */
+/*  E_B    - Energy of LPF speech backward one pitch period (SS) */
+/*  E_F    - Energy of LPF speech forward one pitch period (SS) */
+/*  R_B    - Autocovariance of LPF speech backward one pitch period */
+/*  R_F    - Autocovariance of LPF speech forward one pitch period */
+/*  LP_RMS - Energy of LPF speech (sum of magnitudes - SM) */
+/*  AP_RMS - Energy of all-pass speech (SM) */
+/*  E_PRE  - Energy of 6dB preemphasized speech (SM) */
+/*  E0AP   - Energy of all-pass speech (SS) */
+
+/* This subroutine has no local state. */
+
+/* Subroutine */ int vparms_(integer *vwin, real *inbuf, real *lpbuf, integer 
+	*buflim, integer *half, real *dither, integer *mintau, integer *zc, 
+	integer *lbe, integer *fbe, real *qs, real *rc1, real *ar_b__, real *
+	ar_f__)
+{
+    /* System generated locals */
+    integer inbuf_offset, lpbuf_offset, i__1;
+    real r__1, r__2;
+
+    /* Builtin functions */
+    double r_sign(real *, real *);
+    integer i_nint(real *);
+
+    /* Local variables */
+    integer vlen, stop, i__;
+    real e_pre__;
+    integer start;
+    real ap_rms__, e_0__, oldsgn, lp_rms__, e_b__, e_f__, r_b__, r_f__, e0ap;
+
+/*       Arguments */
+/*       Local variables that need not be saved */
+/*   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. */
+    /* Parameter adjustments */
+    --vwin;
+    --buflim;
+    lpbuf_offset = buflim[3];
+    lpbuf -= lpbuf_offset;
+    inbuf_offset = buflim[1];
+    inbuf -= inbuf_offset;
+
+    /* Function Body */
+    lp_rms__ = 0.f;
+    ap_rms__ = 0.f;
+    e_pre__ = 0.f;
+    e0ap = 0.f;
+    *rc1 = 0.f;
+    e_0__ = 0.f;
+    e_b__ = 0.f;
+    e_f__ = 0.f;
+    r_f__ = 0.f;
+    r_b__ = 0.f;
+    *zc = 0;
+    vlen = vwin[2] - vwin[1] + 1;
+    start = vwin[1] + (*half - 1) * 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 */
+
+/* Note that if VLEN is even and HALF is 2, then STOP will be */
+/* VWIN(1)+VLEN = VWIN(2)+1.  That could be bad, if that index of INBUF */
+/* is undefined. */
+
+    r__1 = inbuf[start - 1] - *dither;
+    oldsgn = (real)r_sign(&c_b2, &r__1);
+    i__1 = stop;
+    for (i__ = start; i__ <= i__1; ++i__) {
+	lp_rms__ += (r__1 = lpbuf[i__], abs(r__1));
+	ap_rms__ += (r__1 = inbuf[i__], abs(r__1));
+	e_pre__ += (r__1 = inbuf[i__] - inbuf[i__ - 1], abs(r__1));
+/* Computing 2nd power */
+	r__1 = inbuf[i__];
+	e0ap += r__1 * r__1;
+	*rc1 += inbuf[i__] * inbuf[i__ - 1];
+/* Computing 2nd power */
+	r__1 = lpbuf[i__];
+	e_0__ += r__1 * r__1;
+/* Computing 2nd power */
+	r__1 = lpbuf[i__ - *mintau];
+	e_b__ += r__1 * r__1;
+/* Computing 2nd power */
+	r__1 = lpbuf[i__ + *mintau];
+	e_f__ += r__1 * r__1;
+	r_f__ += lpbuf[i__] * lpbuf[i__ + *mintau];
+	r_b__ += lpbuf[i__] * lpbuf[i__ - *mintau];
+	r__1 = inbuf[i__] + *dither;
+	if (r_sign(&c_b2, &r__1) != oldsgn) {
+	    ++(*zc);
+	    oldsgn = -oldsgn;
+	}
+	*dither = -(*dither);
+    }
+/*   Normalized short-term autocovariance coefficient at unit sample delay
+ */
+    *rc1 /= max(e0ap,1.f);
+/*  Ratio of the energy of the first difference signal (6 dB/oct preemphas
+is)*/
+/*   to the energy of the full band signal */
+/* Computing MAX */
+    r__1 = ap_rms__ * 2.f;
+    *qs = e_pre__ / max(r__1,1.f);
+/*   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.f) * (r_b__ / max(e_0__,1.f));
+/*  aR_f is the same as aR_b, but looking forward in time (non causal case
+).*/
+    *ar_f__ = r_f__ / max(e_f__,1.f) * (r_f__ / max(e_0__,1.f));
+/*   Normalize ZC, LBE, and FBE to old fixed window length of 180. */
+/*   (The fraction 90/VLEN has a range of .58 to 1) */
+    r__2 = (real) (*zc << 1);
+    r__1 = r__2 * (90.f / vlen);
+    *zc = i_nint(&r__1);
+/* Computing MIN */
+    r__1 = lp_rms__ / 4 * (90.f / vlen);
+    i__1 = i_nint(&r__1);
+    *lbe = min(i__1,32767);
+/* Computing MIN */
+    r__1 = ap_rms__ / 4 * (90.f / vlen);
+    i__1 = i_nint(&r__1);
+    *fbe = min(i__1,32767);
+    return 0;
+} /* vparms_ */
+

Modified: freeswitch/trunk/libs/curl/lib/curllib.vcproj
==============================================================================
--- freeswitch/trunk/libs/curl/lib/curllib.vcproj	(original)
+++ freeswitch/trunk/libs/curl/lib/curllib.vcproj	Fri Sep 21 14:49:14 2007
@@ -222,14 +222,25 @@
 <File RelativePath="setup_once.h"></File>
 <File RelativePath="socks.h"></File>
 <File RelativePath="config-win32.h"></File>
-

-		</Filter>

-		<Filter

-			Name="Resource Files"

-			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"

-			>

-		</Filter>

-	</Files>

-	<Globals>

-	</Globals>

-</VisualStudioProject>

+
+
+		</Filter>
+
+		<Filter
+
+			Name="Resource Files"
+
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+
+			>
+
+		</Filter>
+
+	</Files>
+
+	<Globals>
+
+	</Globals>
+
+</VisualStudioProject>
+

Modified: freeswitch/trunk/libs/curl/src/macos/src/curl_GUSIConfig.cpp
==============================================================================
--- freeswitch/trunk/libs/curl/src/macos/src/curl_GUSIConfig.cpp	(original)
+++ freeswitch/trunk/libs/curl/src/macos/src/curl_GUSIConfig.cpp	Fri Sep 21 14:49:14 2007
@@ -1 +1,79 @@
-/**************** BEGIN GUSI CONFIGURATION ****************************
 *
 * GUSI Configuration section generated by GUSI Configurator
 * last modified: Mon Oct 29 15:41:51 2001
 *
 * This section will be overwritten by the next run of Configurator.
 */

#define GUSI_SOURCE
#include <GUSIConfig.h>
#include <sys/cdefs.h>

/* Declarations of Socket Factories */

__BEGIN_DECLS
void GUSIwithInetSockets();
void GUSIwithLocalSockets();
void GUSIwithMTInetSockets();
void GUSIwithMTTcpSockets();
void GUSIwithMTUdpSockets();
void GUSIwithOTInetSockets();
void GUSIwithOTTcpSockets();
void GUSIwithOTUdpSockets();
void GUSIwithPPCSockets();
void GUSISetupFactories();
__END_DECLS

/* Configure Socket Factories */

void GUSISetupFactories()
{
#ifdef GUSISetupFactories_BeginHook
	GUSISetupFactories_BeginHook
#endif
	GUSIwithInetSockets();
#ifdef GUSISetupFactories_EndHook
	GUSISetupFactories_EndHook
#endif
}

/* Declarations of File Devices */

__BEGIN_DECLS
void GUSIwithNullSockets();
void GUSISetupDevices();
__END_DECLS

/* Configure File Devices */

void GUSISetupDevices()
{
#ifdef GUSISetupDevices_BeginHook
	GUSISetupDevices_BeginHook
#endif
	GUSIwithNullSockets();
#ifdef GUSISetupDevices_EndHook
	GUSISetupDevices_EndHook
#endif
}

#ifndef __cplusplus
#error GUSISetupConfig() needs to be written in C++
#endif

GUSIConfiguration::FileSuffix	sSuffices[] = {
	"", '????', '????'
};

extern "C" void GUSISetupConfig()
{
	GUSIConfiguration * config =
		GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource);

	config->ConfigureDefaultTypeCreator('TEXT', 'CWIE');
	config->ConfigureSuffices(
		sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices);
}

/**************** END GUSI CONFIGURATION *************************/
\ No newline at end of file
+/**************** BEGIN GUSI CONFIGURATION ****************************
+ *
+ * GUSI Configuration section generated by GUSI Configurator
+ * last modified: Mon Oct 29 15:41:51 2001
+ *
+ * This section will be overwritten by the next run of Configurator.
+ */
+
+#define GUSI_SOURCE
+#include <GUSIConfig.h>
+#include <sys/cdefs.h>
+
+/* Declarations of Socket Factories */
+
+__BEGIN_DECLS
+void GUSIwithInetSockets();
+void GUSIwithLocalSockets();
+void GUSIwithMTInetSockets();
+void GUSIwithMTTcpSockets();
+void GUSIwithMTUdpSockets();
+void GUSIwithOTInetSockets();
+void GUSIwithOTTcpSockets();
+void GUSIwithOTUdpSockets();
+void GUSIwithPPCSockets();
+void GUSISetupFactories();
+__END_DECLS
+
+/* Configure Socket Factories */
+
+void GUSISetupFactories()
+{
+#ifdef GUSISetupFactories_BeginHook
+	GUSISetupFactories_BeginHook
+#endif
+	GUSIwithInetSockets();
+#ifdef GUSISetupFactories_EndHook
+	GUSISetupFactories_EndHook
+#endif
+}
+
+/* Declarations of File Devices */
+
+__BEGIN_DECLS
+void GUSIwithNullSockets();
+void GUSISetupDevices();
+__END_DECLS
+
+/* Configure File Devices */
+
+void GUSISetupDevices()
+{
+#ifdef GUSISetupDevices_BeginHook
+	GUSISetupDevices_BeginHook
+#endif
+	GUSIwithNullSockets();
+#ifdef GUSISetupDevices_EndHook
+	GUSISetupDevices_EndHook
+#endif
+}
+
+#ifndef __cplusplus
+#error GUSISetupConfig() needs to be written in C++
+#endif
+
+GUSIConfiguration::FileSuffix	sSuffices[] = {
+	"", '????', '????'
+};
+
+extern "C" void GUSISetupConfig()
+{
+	GUSIConfiguration * config =
+		GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource);
+
+	config->ConfigureDefaultTypeCreator('TEXT', 'CWIE');
+	config->ConfigureSuffices(
+		sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices);
+}
+
+/**************** END GUSI CONFIGURATION *************************/

Modified: freeswitch/trunk/libs/curl/src/macos/src/macos_main.cpp
==============================================================================
--- freeswitch/trunk/libs/curl/src/macos/src/macos_main.cpp	(original)
+++ freeswitch/trunk/libs/curl/src/macos/src/macos_main.cpp	Fri Sep 21 14:49:14 2007
@@ -1 +1,44 @@
-/* =========================================================================
	Copyright (C) 2001 Eric Lavigne

	Permission is granted to anyone to use this software for any purpose on any
	computer system, and to redistribute it freely, subject to the following 
	restrictions:
	- The author is not responsible for the consequences of use of this 
	software, no matter how awful, even if they arise from defects in it.
	- The origin of this software must not be misrepresented, either by 
	explicit claim or by omission.
	- You are allowed to distributed modified copies of the software, in source 
	and binary form, provided they are marked plainly as altered versions, and
	are not misrepresented as being the original software.
   ========================================================================= */

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <Memory.h>
#include <GUSICommandLine.h>
#include <stdlib.h>

/* ========================================================================= */

DECLARE_MAIN(curl)

REGISTER_MAIN_START
REGISTER_MAIN(curl)
REGISTER_MAIN_END

/* ========================================================================= */

int main()
{
	::MaxApplZone();
	for (int i = 1; i <= 10; i++)
		::MoreMasters();

	(void) exec_commands();
	
	return 0;
}


\ No newline at end of file
+/* =========================================================================
+	Copyright (C) 2001 Eric Lavigne
+
+	Permission is granted to anyone to use this software for any purpose on any
+	computer system, and to redistribute it freely, subject to the following 
+	restrictions:
+	- The author is not responsible for the consequences of use of this 
+	software, no matter how awful, even if they arise from defects in it.
+	- The origin of this software must not be misrepresented, either by 
+	explicit claim or by omission.
+	- You are allowed to distributed modified copies of the software, in source 
+	and binary form, provided they are marked plainly as altered versions, and
+	are not misrepresented as being the original software.
+   ========================================================================= */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <Memory.h>
+#include <GUSICommandLine.h>
+#include <stdlib.h>
+
+/* ========================================================================= */
+
+DECLARE_MAIN(curl)
+
+REGISTER_MAIN_START
+REGISTER_MAIN(curl)
+REGISTER_MAIN_END
+
+/* ========================================================================= */
+
+int main()
+{
+	::MaxApplZone();
+	for (int i = 1; i <= 10; i++)
+		::MoreMasters();
+
+	(void) exec_commands();
+	
+	return 0;
+}
+
+

Modified: freeswitch/trunk/libs/iax/src/iax-client.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax-client.h	(original)
+++ freeswitch/trunk/libs/iax/src/iax-client.h	Fri Sep 21 14:49:14 2007
@@ -230,8 +230,8 @@
 extern void iax_pref_codec_del(struct iax_session *session, unsigned int format);
 extern int iax_pref_codec_get(struct iax_session *session, unsigned int *array, int len);
 
-/* Fine tune jitterbuffer */
-extern void iax_set_jb_target_extra( long value );
+/* Fine tune jitterbuffer */
+extern void iax_set_jb_target_extra( long value );
 
 extern char *iax_get_peer_ip(struct iax_session *session);
 extern char *iax_event_get_apparent_ip(struct iax_event *event);

Modified: freeswitch/trunk/libs/iax/src/iax.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax.h	(original)
+++ freeswitch/trunk/libs/iax/src/iax.h	Fri Sep 21 14:49:14 2007
@@ -8,7 +8,7 @@
  * Mark Spencer <markster at linux-support.net>
  *
  * This program is free software, distributed under the terms of
- * the GNU Lesser (Library) General Public License
+ * the GNU Lesser (Library) General Public License
  */
  
 #ifndef _IAX_H

Modified: freeswitch/trunk/libs/iax/src/iax2-parser.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax2-parser.h	(original)
+++ freeswitch/trunk/libs/iax/src/iax2-parser.h	Fri Sep 21 14:49:14 2007
@@ -8,7 +8,7 @@
  * Mark Spencer <markster at digium.com>
  *
  * This program is free software, distributed under the terms of
- * the GNU Lesser (Library) General Public License
+ * the GNU Lesser (Library) General Public License
  */
  
 #ifndef _IAX2_PARSER_H

Modified: freeswitch/trunk/libs/iax/src/iax2.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax2.h	(original)
+++ freeswitch/trunk/libs/iax/src/iax2.h	Fri Sep 21 14:49:14 2007
@@ -8,7 +8,7 @@
  * Mark Spencer <markster at linux-support.net>
  *
  * This program is free software, distributed under the terms of
- * the GNU Lesser (Library) General Public License
+ * the GNU Lesser (Library) General Public License
  */
  
 #ifndef _IAX2_H

Modified: freeswitch/trunk/libs/iax/src/jitterbuf.c
==============================================================================
--- freeswitch/trunk/libs/iax/src/jitterbuf.c	(original)
+++ freeswitch/trunk/libs/iax/src/jitterbuf.c	Fri Sep 21 14:49:14 2007
@@ -1,834 +1,834 @@
-/*
- * jitterbuf: an application-independent jitterbuffer
- *
- * Copyrights:
- * Copyright (C) 2004-2005, Horizon Wimba, Inc.
- *
- * Contributors:
- * Steve Kann <stevek at stevek.com>
- *
- * This program is free software, distributed under the terms of
- * the GNU Lesser (Library) General Public License
- *
- * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
- */
-
-#include "iax2.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include "jitterbuf.h"
-
-/* define these here, just for ancient compiler systems */
-#define JB_LONGMAX 2147483647L
-#define JB_LONGMIN (-JB_LONGMAX - 1L)
-
-/* MS VC can't do __VA_ARGS__ */
-#if (defined(WIN32)  ||  defined(_WIN32_WCE))  &&  defined(_MSC_VER)
-#define jb_warn if (warnf) warnf
-#define jb_err if (errf) errf
-#define jb_dbg if (dbgf) dbgf
-
-#ifdef DEEP_DEBUG
-  #define jb_dbg2 if (dbgf) dbgf
-#else
-  #define jb_dbg2 if (0) dbgf
-#endif
-
-#else
-
-#define jb_warn(...) (warnf ? warnf(__VA_ARGS__) : (void)0)
-#define jb_err(...) (errf ? errf(__VA_ARGS__) : (void)0)
-#define jb_dbg(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
-
-#ifdef DEEP_DEBUG
-#define jb_dbg2(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
-#else
-#define jb_dbg2(...) ((void)0)
-#endif
-
-#endif
-
-static jb_output_function_t warnf, errf, dbgf;
-
-void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg)
-{
-	errf = err;
-	warnf = warn;
-	dbgf = dbg;
-}
-
-static void increment_losspct(jitterbuf *jb)
-{
-	jb->info.losspct = (100000 + 499 * jb->info.losspct)/500;
-}
-
-static void decrement_losspct(jitterbuf *jb)
-{
-	jb->info.losspct = (499 * jb->info.losspct)/500;
-}
-
-void jb_reset(jitterbuf *jb)
-{
-	/* only save settings */
-	jb_conf s = jb->info.conf;
-	memset(jb, 0, sizeof(*jb));
-	jb->info.conf = s;
-
-	/* initialize length, using the configured value */
-	jb->info.current = jb->info.target = jb->info.conf.target_extra;
-	jb->info.silence_begin_ts = -1;
-}
-
-jitterbuf * jb_new()
-{
-	jitterbuf *jb;
-
-	if (!(jb = (jitterbuf *)malloc(sizeof(*jb))))
-		return NULL;
-
-	jb->info.conf.target_extra = JB_TARGET_EXTRA;
-
-	jb_reset(jb);
-
-	jb_dbg2("jb_new() = %x\n", jb);
-	return jb;
-}
-
-void jb_destroy(jitterbuf *jb)
-{
-	jb_frame *frame;
-	jb_dbg2("jb_destroy(%x)\n", jb);
-
-	/* free all the frames on the "free list" */
-	frame = jb->free;
-	while (frame != NULL) {
-		jb_frame *next = frame->next;
-		free(frame);
-		frame = next;
-	}
-
-	/* free ourselves! */
-	free(jb);
-}
-
-
-
-#if 0
-static int longcmp(const void *a, const void *b)
-{
-	return *(long *)a - *(long *)b;
-}
-#endif
-
-/* simple history manipulation */
-/* maybe later we can make the history buckets variable size, or something? */
-/* drop parameter determines whether we will drop outliers to minimize
- * delay */
-static int history_put(jitterbuf *jb, time_in_ms_t ts, time_in_ms_t now, long ms)
-{
-	time_in_ms_t delay = now - (ts - jb->info.resync_offset);
-	time_in_ms_t threshold = 2 * jb->info.jitter + jb->info.conf.resync_threshold;
-	time_in_ms_t kicked;
-
-	/* don't add special/negative times to history */
-	if (ts <= 0)
-		return 0;
-
-	/* check for drastic change in delay */
-	if (jb->info.conf.resync_threshold != -1) {
-		if (iax_abs(delay - jb->info.last_delay) > threshold) {
-			jb->info.cnt_delay_discont++;
-			if (jb->info.cnt_delay_discont > 3) {
-				/* resync the jitterbuffer */
-				jb->info.cnt_delay_discont = 0;
-				jb->hist_ptr = 0;
-				jb->hist_maxbuf_valid = 0;
-
-				jb_warn("Resyncing the jb. last_delay %ld, this delay %ld, threshold %ld, new offset %ld\n", jb->info.last_delay, delay, threshold, ts - now);
-				jb->info.resync_offset = ts - now;
-				jb->info.last_delay = delay = 0; /* after resync, frame is right on time */
-			} else {
-				return -1;
-			}
-		} else {
-			jb->info.last_delay = delay;
-			jb->info.cnt_delay_discont = 0;
-		}
-	}
-
-	kicked = jb->history[jb->hist_ptr % JB_HISTORY_SZ];
-
-	jb->history[(jb->hist_ptr++) % JB_HISTORY_SZ] = delay;
-
-	/* optimization; the max/min buffers don't need to be recalculated,
-	 * if this packet's entry doesn't change them. This happens if this
-	 * packet is not involved, _and_ any packet that got kicked out of
-	 * the history is also not involved. We do a number of comparisons,
-	 * but it's probably still worthwhile, because it will usually
-	 * succeed, and should be a lot faster than going through all 500
-	 * packets in history */
-	if (!jb->hist_maxbuf_valid)
-		return 0;
-
-	/* don't do this until we've filled history
-	 * (reduces some edge cases below) */
-	if (jb->hist_ptr < JB_HISTORY_SZ)
-		goto invalidate;
-
-	/* if the new delay would go into min */
-	if (delay < jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])
-		goto invalidate;
-
-	/* or max.. */
-	if (delay > jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])
-		goto invalidate;
-
-	/* or the kicked delay would be in min */
-	if (kicked <= jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])
-		goto invalidate;
-
-	if (kicked >= jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])
-		goto invalidate;
-
-	/* if we got here, we don't need to invalidate, 'cause this delay didn't
-	 * affect things */
-	return 0;
-	/* end optimization */
-
-
-invalidate:
-	jb->hist_maxbuf_valid = 0;
-	return 0;
-}
-
-static void history_calc_maxbuf(jitterbuf *jb)
-{
-	int i,j;
-
-	if (jb->hist_ptr == 0)
-		return;
-
-
-	/* initialize maxbuf/minbuf to the latest value */
-	for (i=0;i<JB_HISTORY_MAXBUF_SZ;i++) {
-		/*
-		 * jb->hist_maxbuf[i] = jb->history[(jb->hist_ptr-1) % JB_HISTORY_SZ];
-		 * jb->hist_minbuf[i] = jb->history[(jb->hist_ptr-1) % JB_HISTORY_SZ];
-		 */
-		jb->hist_maxbuf[i] = JB_LONGMIN;
-		jb->hist_minbuf[i] = JB_LONGMAX;
-	}
-
-	/* use insertion sort to populate maxbuf */
-	/* we want it to be the top "n" values, in order */
-
-	/* start at the beginning, or JB_HISTORY_SZ frames ago */
-	i = (jb->hist_ptr > JB_HISTORY_SZ) ? (jb->hist_ptr - JB_HISTORY_SZ) : 0;
-
-	for (;i<jb->hist_ptr;i++) {
-	time_in_ms_t toins = jb->history[i % JB_HISTORY_SZ];
-
-		/* if the maxbuf should get this */
-		if (toins > jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])  {
-
-			/* insertion-sort it into the maxbuf */
-			for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
-				/* found where it fits */
-				if (toins > jb->hist_maxbuf[j]) {
-					/* move over */
-					memmove(jb->hist_maxbuf + j + 1, jb->hist_maxbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_maxbuf[0]));
-					/* insert */
-					jb->hist_maxbuf[j] = toins;
-
-					break;
-				}
-			}
-		}
-
-		/* if the minbuf should get this */
-		if (toins < jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])  {
-
-			/* insertion-sort it into the maxbuf */
-			for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
-				/* found where it fits */
-				if (toins < jb->hist_minbuf[j]) {
-					/* move over */
-					memmove(jb->hist_minbuf + j + 1, jb->hist_minbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_minbuf[0]));
-					/* insert */
-					jb->hist_minbuf[j] = toins;
-
-					break;
-				}
-			}
-		}
-
-		if (0) {
-			int k;
-			fprintf(stderr, "toins = %ld\n", toins);
-			fprintf(stderr, "maxbuf =");
-			for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
-				fprintf(stderr, "%ld ", jb->hist_maxbuf[k]);
-			fprintf(stderr, "\nminbuf =");
-			for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
-				fprintf(stderr, "%ld ", jb->hist_minbuf[k]);
-			fprintf(stderr, "\n");
-		}
-	}
-
-	jb->hist_maxbuf_valid = 1;
-}
-
-static void history_get(jitterbuf *jb)
-{
-    time_in_ms_t max, min, jitter;
-	int index;
-	int count;
-
-	if (!jb->hist_maxbuf_valid)
-		history_calc_maxbuf(jb);
-
-	/* count is how many items in history we're examining */
-	count = (jb->hist_ptr < JB_HISTORY_SZ) ? jb->hist_ptr : JB_HISTORY_SZ;
-
-	/* index is the "n"ths highest/lowest that we'll look for */
-	index = count * JB_HISTORY_DROPPCT / 100;
-
-	/* sanity checks for index */
-	if (index > (JB_HISTORY_MAXBUF_SZ - 1))
-		index = JB_HISTORY_MAXBUF_SZ - 1;
-
-
-	if (index < 0) {
-		jb->info.min = 0;
-		jb->info.jitter = 0;
-		return;
-	}
-
-	max = jb->hist_maxbuf[index];
-	min = jb->hist_minbuf[index];
-
-	jitter = max - min;
-
-	/* these debug stmts compare the difference between looking at the absolute jitter, and the
-	 * values we get by throwing away the outliers */
-	/*
-	fprintf(stderr, "[%d] min=%d, max=%d, jitter=%d\n", index, min, max, jitter);
-	fprintf(stderr, "[%d] min=%d, max=%d, jitter=%d\n", 0, jb->hist_minbuf[0], jb->hist_maxbuf[0], jb->hist_maxbuf[0]-jb->hist_minbuf[0]);
-	*/
-
-	jb->info.min = min;
-	jb->info.jitter = jitter;
-}
-
-/* returns 1 if frame was inserted into head of queue, 0 otherwise */
-static int queue_put(jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, time_in_ms_t ts)
-{
-	jb_frame *frame;
-	jb_frame *p;
-	int head = 0;
-	time_in_ms_t resync_ts = ts - jb->info.resync_offset;
-
-	if ((frame = jb->free)) {
-		jb->free = frame->next;
-	} else if (!(frame = (jb_frame *)malloc(sizeof(*frame)))) {
-		jb_err("cannot allocate frame\n");
-		return 0;
-	}
-
-	jb->info.frames_cur++;
-
-	frame->data = data;
-	frame->ts = resync_ts;
-	frame->ms = ms;
-	frame->type = type;
-
-	/*
-	 * frames are a circular list, jb-frames points to to the lowest ts,
-	 * jb->frames->prev points to the highest ts
-	 */
-
-	if (!jb->frames) {  /* queue is empty */
-		jb->frames = frame;
-		frame->next = frame;
-		frame->prev = frame;
-		head = 1;
-	} else if (resync_ts < jb->frames->ts) {
-		frame->next = jb->frames;
-		frame->prev = jb->frames->prev;
-
-		frame->next->prev = frame;
-		frame->prev->next = frame;
-
-		/* frame is out of order */
-		jb->info.frames_ooo++;
-
-		jb->frames = frame;
-		head = 1;
-	} else {
-		p = jb->frames;
-
-		/* frame is out of order */
-		if (resync_ts < p->prev->ts) jb->info.frames_ooo++;
-
-		while (resync_ts < p->prev->ts && p->prev != jb->frames)
-			p = p->prev;
-
-		frame->next = p;
-		frame->prev = p->prev;
-
-		frame->next->prev = frame;
-		frame->prev->next = frame;
-	}
-	return head;
-}
-
-static time_in_ms_t queue_next(jitterbuf *jb) 
-{
-	if (jb->frames)
-		return jb->frames->ts;
-	else
-		return -1;
-}
-
-static time_in_ms_t queue_last(jitterbuf *jb) 
-{
-	if (jb->frames)
-		return jb->frames->prev->ts;
-	else
-		return -1;
-}
-
-static jb_frame *_queue_get(jitterbuf *jb, time_in_ms_t ts, int all) 
-{
-	jb_frame *frame;
-	frame = jb->frames;
-
-	if (!frame)
-		return NULL;
-
-	/*jb_warn("queue_get: ASK %ld FIRST %ld\n", ts, frame->ts); */
-
-	if (all || ts >= frame->ts) {
-		/* remove this frame */
-		frame->prev->next = frame->next;
-		frame->next->prev = frame->prev;
-
-		if (frame->next == frame)
-			jb->frames = NULL;
-		else
-			jb->frames = frame->next;
-
-
-		/* insert onto "free" single-linked list */
-		frame->next = jb->free;
-		jb->free = frame;
-
-		jb->info.frames_cur--;
-
-		/* we return the frame pointer, even though it's on free list,
-		 * but caller must copy data */
-		return frame;
-	}
-
-	return NULL;
-}
-
-static jb_frame *queue_get(jitterbuf *jb, time_in_ms_t ts) 
-{
-	return _queue_get(jb,ts,0);
-}
-
-static jb_frame *queue_getall(jitterbuf *jb)
-{
-	return _queue_get(jb,0,1);
-}
-
-#if 0
-/* some diagnostics */
-static void jb_dbginfo(jitterbuf *jb)
-{
-	if (dbgf == NULL)
-		return;
-
-	jb_dbg("\njb info: fin=%ld fout=%ld flate=%ld flost=%ld fdrop=%ld fcur=%ld\n",
-		jb->info.frames_in, jb->info.frames_out, jb->info.frames_late, jb->info.frames_lost, jb->info.frames_dropped, jb->info.frames_cur);
-
-	jb_dbg("jitter=%ld current=%ld target=%ld min=%ld sil=%d len=%d len/fcur=%ld\n",
-		jb->info.jitter, jb->info.current, jb->info.target, jb->info.min, jb->info.silence_begin_ts, jb->info.current - jb->info.min,
-		jb->info.frames_cur ? (jb->info.current - jb->info.min)/jb->info.frames_cur : -8);
-	if (jb->info.frames_in > 0)
-		jb_dbg("jb info: Loss PCT = %ld%%, Late PCT = %ld%%\n",
-		jb->info.frames_lost * 100/(jb->info.frames_in + jb->info.frames_lost),
-		jb->info.frames_late * 100/jb->info.frames_in);
-	jb_dbg("jb info: queue %d -> %d.  last_ts %d (queue len: %d) last_ms %d\n",
-		queue_next(jb),
-		queue_last(jb),
-		jb->info.next_voice_ts,
-		queue_last(jb) - queue_next(jb),
-		jb->info.last_voice_ms);
-}
-#endif
-
-#ifdef DEEP_DEBUG
-static void jb_chkqueue(jitterbuf *jb)
-{
-	int i=0;
-	jb_frame *p = jb->frames;
-
-	if (!p) {
-		return;
-	}
-
-	do {
-		if (p->next == NULL)  {
-			jb_err("Queue is BROKEN at item [%d]", i);
-		}
-		i++;
-		p=p->next;
-	} while (p->next != jb->frames);
-}
-
-static void jb_dbgqueue(jitterbuf *jb)
-{
-	int i=0;
-	jb_frame *p = jb->frames;
-
-	jb_dbg("queue: ");
-
-	if (!p) {
-		jb_dbg("EMPTY\n");
-		return;
-	}
-
-	do {
-		jb_dbg("[%d]=%ld ", i++, p->ts);
-		p=p->next;
-	} while (p->next != jb->frames);
-
-	jb_dbg("\n");
-}
-#endif
-
-enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, time_in_ms_t ts, time_in_ms_t now)
-{
-	jb_dbg2("jb_put(%x,%x,%ld,%ld,%ld)\n", jb, data, ms, ts, now);
-
-	jb->info.frames_in++;
-
-	if (type == JB_TYPE_VOICE) {
-		/* presently, I'm only adding VOICE frames to history and drift
-		 * calculations; mostly because with the IAX integrations, I'm
-		 * sending retransmitted control frames with their awkward
-		 * timestamps through
-		 */
-		if (history_put(jb,ts,now,ms))
-			return JB_DROP;
-	}
-
-	/* if put into head of queue, caller needs to reschedule */
-	if (queue_put(jb,data,type,ms,ts)) {
-		return JB_SCHED;
-	}
-
-	return JB_OK;
-}
-
-
-static enum jb_return_code _jb_get(jitterbuf *jb, jb_frame *frameout, time_in_ms_t now, long interpl)
-{
-	jb_frame *frame;
-	time_in_ms_t diff;
-
-	/*if ((now - jb_next(jb)) > 2 * jb->info.last_voice_ms) jb_warn("SCHED: %ld", (now - jb_next(jb))); */
-	/* get jitter info */
-	history_get(jb);
-
-
-	/* target */
-	jb->info.target = jb->info.jitter + jb->info.min + jb->info.conf.target_extra;
-
-	/* if a hard clamp was requested, use it */
-	if ((jb->info.conf.max_jitterbuf) && ((jb->info.target - jb->info.min) > jb->info.conf.max_jitterbuf)) {
-		jb_dbg("clamping target from %d to %d\n", (jb->info.target - jb->info.min), jb->info.conf.max_jitterbuf);
-		jb->info.target = jb->info.min + jb->info.conf.max_jitterbuf;
-	}
-
-	diff = jb->info.target - jb->info.current;
-
-	/* jb_warn("diff = %d lms=%d last = %d now = %d\n", diff,  */
-	/*	jb->info.last_voice_ms, jb->info.last_adjustment, now); */
-
-	/* let's work on non-silent case first */
-	if (!jb->info.silence_begin_ts) {
-		/* we want to grow */
-		if ((diff > 0) &&
-			/* we haven't grown in the delay length */
-			(((jb->info.last_adjustment + JB_ADJUST_DELAY) < now) ||
-			/* we need to grow more than the "length" we have left */
-			(diff > queue_last(jb) - queue_next(jb)) ) ) {
-			/* grow by interp frame length */
-			jb->info.current += interpl;
-			jb->info.next_voice_ts += interpl;
-			jb->info.last_voice_ms = interpl;
-			jb->info.last_adjustment = now;
-			jb->info.cnt_contig_interp++;
-			/* assume silence instead of continuing to interpolate */
-			if (jb->info.conf.max_contig_interp && jb->info.cnt_contig_interp >= jb->info.conf.max_contig_interp) {
-				jb->info.silence_begin_ts = jb->info.next_voice_ts - jb->info.current;
-			}
-			jb_dbg("G");
-			return JB_INTERP;
-		}
-
-		frame = queue_get(jb, jb->info.next_voice_ts - jb->info.current);
-
-		/* not a voice frame; just return it. */
-		if (frame && frame->type != JB_TYPE_VOICE) {
-			/* track start of silence */
-			if (frame->type == JB_TYPE_SILENCE) {
-				jb->info.silence_begin_ts = frame->ts;
-				jb->info.cnt_contig_interp = 0;
-			}
-
-			*frameout = *frame;
-			jb->info.frames_out++;
-			jb_dbg("o");
-			return JB_OK;
-		}
-
-		/* voice frame is later than expected */
-		if (frame && frame->ts + jb->info.current < jb->info.next_voice_ts) {
-			if (frame->ts + jb->info.current > jb->info.next_voice_ts - jb->info.last_voice_ms) {
-				/* either we interpolated past this frame in the last jb_get */
-				/* or the frame is still in order, but came a little too quick */
-				*frameout = *frame;
-				/* reset expectation for next frame */
-				jb->info.next_voice_ts = frame->ts + jb->info.current + frame->ms;
-				jb->info.frames_out++;
-				decrement_losspct(jb);
-				jb->info.cnt_contig_interp = 0;
-				jb_dbg("v");
-				return JB_OK;
-			} else {
-				/* voice frame is late */
-				*frameout = *frame;
-				jb->info.frames_out++;
-				decrement_losspct(jb);
-				jb->info.frames_late++;
-				jb->info.frames_lost--;
-				jb_dbg("l");
-				/*jb_warn("\nlate: wanted=%ld, this=%ld, next=%ld\n", jb->info.next_voice_ts - jb->info.current, frame->ts, queue_next(jb));
-				  jb_warninfo(jb); */
-				return JB_DROP;
-			}
-		}
-
-		/* keep track of frame sizes, to allow for variable sized-frames */
-		if (frame && frame->ms > 0) {
-			jb->info.last_voice_ms = frame->ms;
-		}
-
-		/* we want to shrink; shrink at 1 frame / 500ms */
-		/* unless we don't have a frame, then shrink 1 frame */
-		/* every 80ms (though perhaps we can shrink even faster */
-		/* in this case) */
-		if (diff < -jb->info.conf.target_extra &&
-				((!frame && jb->info.last_adjustment + 80 < now) ||
-				 (jb->info.last_adjustment + 500 < now))) {
-
-			jb->info.last_adjustment = now;
-			jb->info.cnt_contig_interp = 0;
-
-			if (frame) {
-				*frameout = *frame;
-				/* shrink by frame size we're throwing out */
-				jb->info.current -= frame->ms;
-				jb->info.frames_out++;
-				decrement_losspct(jb);
-				jb->info.frames_dropped++;
-				jb_dbg("s");
-				return JB_DROP;
-			} else {
-				/* shrink by last_voice_ms */
-				jb->info.current -= jb->info.last_voice_ms;
-				jb->info.frames_lost++;
-				increment_losspct(jb);
-				jb_dbg("S");
-				return JB_NOFRAME;
-			}
-		}
-
-		/* lost frame */
-		if (!frame) {
-			/* this is a bit of a hack for now, but if we're close to
-			 * target, and we find a missing frame, it makes sense to
-			 * grow, because the frame might just be a bit late;
-			 * otherwise, we presently get into a pattern where we return
-			 * INTERP for the lost frame, then it shows up next, and we
-			 * throw it away because it's late */
-			/* I've recently only been able to replicate this using
-			 * iaxclient talking to app_echo on asterisk.  In this case,
-			 * my outgoing packets go through asterisk's (old)
-			 * jitterbuffer, and then might get an unusual increasing delay
-			 * there if it decides to grow?? */
-			/* Update: that might have been a different bug, that has been fixed..
-			 * But, this still seemed like a good idea, except that it ended up making a single actual
-			 * lost frame get interpolated two or more times, when there was "room" to grow, so it might
-			 * be a bit of a bad idea overall */
-			/*if (diff > -1 * jb->info.last_voice_ms) {
-				jb->info.current += jb->info.last_voice_ms;
-				jb->info.last_adjustment = now;
-				jb_warn("g");
-				return JB_INTERP;
-			} */
-			jb->info.frames_lost++;
-			increment_losspct(jb);
-			jb->info.next_voice_ts += interpl;
-			jb->info.last_voice_ms = interpl;
-			jb->info.cnt_contig_interp++;
-			/* assume silence instead of continuing to interpolate */
-			if (jb->info.conf.max_contig_interp && jb->info.cnt_contig_interp >= jb->info.conf.max_contig_interp) {
-				jb->info.silence_begin_ts = jb->info.next_voice_ts - jb->info.current;
-			}
-			jb_dbg("L");
-			return JB_INTERP;
-		}
-
-		/* normal case; return the frame, increment stuff */
-		*frameout = *frame;
-		jb->info.next_voice_ts += frame->ms;
-		jb->info.frames_out++;
-		jb->info.cnt_contig_interp = 0;
-		decrement_losspct(jb);
-		jb_dbg("v");
-		return JB_OK;
-	} else {
-		/* TODO: after we get the non-silent case down, we'll make the
-		 * silent case -- basically, we'll just grow and shrink faster
-		 * here, plus handle next_voice_ts a bit differently */
-
-		/* to disable silent special case altogether, just uncomment this: */
-		/* jb->info.silence_begin_ts = 0; */
-
-		/* shrink interpl len every 10ms during silence */
-		if (diff < -jb->info.conf.target_extra &&
-			jb->info.last_adjustment + 10 <= now) {
-			jb->info.current -= interpl;
-			jb->info.last_adjustment = now;
-		}
-
-		frame = queue_get(jb, now - jb->info.current);
-		if (!frame) {
-			return JB_NOFRAME;
-		} else if (frame->type != JB_TYPE_VOICE) {
-			/* normal case; in silent mode, got a non-voice frame */
-			*frameout = *frame;
-			jb->info.frames_out++;
-			return JB_OK;
-		}
-		if (frame->ts < jb->info.silence_begin_ts) {
-			/* voice frame is late */
-			*frameout = *frame;
-			jb->info.frames_out++;
-			decrement_losspct(jb);
-			jb->info.frames_late++;
-			jb->info.frames_lost--;
-			jb_dbg("l");
-			/*jb_warn("\nlate: wanted=%ld, this=%ld, next=%ld\n", jb->info.next_voice_ts - jb->info.current, frame->ts, queue_next(jb));
-			  jb_warninfo(jb); */
-			return JB_DROP;
-		} else {
-			/* voice frame */
-			/* try setting current to target right away here */
-			jb->info.current = jb->info.target;
-			jb->info.silence_begin_ts = 0;
-			jb->info.next_voice_ts = frame->ts + jb->info.current + frame->ms;
-			jb->info.last_voice_ms = frame->ms;
-			jb->info.frames_out++;
-			decrement_losspct(jb);
-			*frameout = *frame;
-			jb_dbg("V");
-			return JB_OK;
-		}
-	}
-}
-
-time_in_ms_t jb_next(jitterbuf *jb)
-{
-	if (jb->info.silence_begin_ts) {
-		if (jb->frames) {
-			time_in_ms_t next = queue_next(jb);
-			history_get(jb);
-			/* shrink during silence */
-			if (jb->info.target - jb->info.current < -jb->info.conf.target_extra)
-				return jb->info.last_adjustment + 10;
-			return next + jb->info.target;
-		}
-		else
-			return JB_LONGMAX;
-	} else {
-		return jb->info.next_voice_ts;
-	}
-}
-
-enum jb_return_code jb_get(jitterbuf *jb, jb_frame *frameout, time_in_ms_t now, long interpl)
-{
-	enum jb_return_code ret = _jb_get(jb, frameout, now, interpl);
-#if 0
-	static int lastts=0;
-	int thists = ((ret == JB_OK) || (ret == JB_DROP)) ? frameout->ts : 0;
-	jb_warn("jb_get(%x,%x,%ld) = %d (%d)\n", jb, frameout, now, ret, thists);
-	if (thists && thists < lastts) jb_warn("XXXX timestamp roll-back!!!\n");
-	lastts = thists;
-#endif
-	return ret;
-}
-
-enum jb_return_code jb_getall(jitterbuf *jb, jb_frame *frameout)
-{
-	jb_frame *frame;
-	frame = queue_getall(jb);
-
-	if (!frame) {
-		return JB_NOFRAME;
-	}
-
-	*frameout = *frame;
-	return JB_OK;
-}
-
-
-enum jb_return_code jb_getinfo(jitterbuf *jb, jb_info *stats)
-{
-	history_get(jb);
-
-	*stats = jb->info;
-
-	return JB_OK;
-}
-
-enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf)
-{
-	/* take selected settings from the struct */
-
-	jb->info.conf.max_jitterbuf = conf->max_jitterbuf;
-	jb->info.conf.resync_threshold = conf->resync_threshold;
-	jb->info.conf.max_contig_interp = conf->max_contig_interp;
-
-	/* -1 indicates use of the default JB_TARGET_EXTRA value */
-	jb->info.conf.target_extra = ( conf->target_extra == -1 )
-		? JB_TARGET_EXTRA
-		: conf->target_extra
-		;
-
-	/* update these to match new target_extra setting */
-	jb->info.current = jb->info.conf.target_extra;
-	jb->info.target = jb->info.conf.target_extra;
-
-	return JB_OK;
-}
-
-
+/*
+ * jitterbuf: an application-independent jitterbuffer
+ *
+ * Copyrights:
+ * Copyright (C) 2004-2005, Horizon Wimba, Inc.
+ *
+ * Contributors:
+ * Steve Kann <stevek at stevek.com>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser (Library) General Public License
+ *
+ * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
+ */
+
+#include "iax2.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "jitterbuf.h"
+
+/* define these here, just for ancient compiler systems */
+#define JB_LONGMAX 2147483647L
+#define JB_LONGMIN (-JB_LONGMAX - 1L)
+
+/* MS VC can't do __VA_ARGS__ */
+#if (defined(WIN32)  ||  defined(_WIN32_WCE))  &&  defined(_MSC_VER)
+#define jb_warn if (warnf) warnf
+#define jb_err if (errf) errf
+#define jb_dbg if (dbgf) dbgf
+
+#ifdef DEEP_DEBUG
+  #define jb_dbg2 if (dbgf) dbgf
+#else
+  #define jb_dbg2 if (0) dbgf
+#endif
+
+#else
+
+#define jb_warn(...) (warnf ? warnf(__VA_ARGS__) : (void)0)
+#define jb_err(...) (errf ? errf(__VA_ARGS__) : (void)0)
+#define jb_dbg(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
+
+#ifdef DEEP_DEBUG
+#define jb_dbg2(...) (dbgf ? dbgf(__VA_ARGS__) : (void)0)
+#else
+#define jb_dbg2(...) ((void)0)
+#endif
+
+#endif
+
+static jb_output_function_t warnf, errf, dbgf;
+
+void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg)
+{
+	errf = err;
+	warnf = warn;
+	dbgf = dbg;
+}
+
+static void increment_losspct(jitterbuf *jb)
+{
+	jb->info.losspct = (100000 + 499 * jb->info.losspct)/500;
+}
+
+static void decrement_losspct(jitterbuf *jb)
+{
+	jb->info.losspct = (499 * jb->info.losspct)/500;
+}
+
+void jb_reset(jitterbuf *jb)
+{
+	/* only save settings */
+	jb_conf s = jb->info.conf;
+	memset(jb, 0, sizeof(*jb));
+	jb->info.conf = s;
+
+	/* initialize length, using the configured value */
+	jb->info.current = jb->info.target = jb->info.conf.target_extra;
+	jb->info.silence_begin_ts = -1;
+}
+
+jitterbuf * jb_new()
+{
+	jitterbuf *jb;
+
+	if (!(jb = (jitterbuf *)malloc(sizeof(*jb))))
+		return NULL;
+
+	jb->info.conf.target_extra = JB_TARGET_EXTRA;
+
+	jb_reset(jb);
+
+	jb_dbg2("jb_new() = %x\n", jb);
+	return jb;
+}
+
+void jb_destroy(jitterbuf *jb)
+{
+	jb_frame *frame;
+	jb_dbg2("jb_destroy(%x)\n", jb);
+
+	/* free all the frames on the "free list" */
+	frame = jb->free;
+	while (frame != NULL) {
+		jb_frame *next = frame->next;
+		free(frame);
+		frame = next;
+	}
+
+	/* free ourselves! */
+	free(jb);
+}
+
+
+
+#if 0
+static int longcmp(const void *a, const void *b)
+{
+	return *(long *)a - *(long *)b;
+}
+#endif
+
+/* simple history manipulation */
+/* maybe later we can make the history buckets variable size, or something? */
+/* drop parameter determines whether we will drop outliers to minimize
+ * delay */
+static int history_put(jitterbuf *jb, time_in_ms_t ts, time_in_ms_t now, long ms)
+{
+	time_in_ms_t delay = now - (ts - jb->info.resync_offset);
+	time_in_ms_t threshold = 2 * jb->info.jitter + jb->info.conf.resync_threshold;
+	time_in_ms_t kicked;
+
+	/* don't add special/negative times to history */
+	if (ts <= 0)
+		return 0;
+
+	/* check for drastic change in delay */
+	if (jb->info.conf.resync_threshold != -1) {
+		if (iax_abs(delay - jb->info.last_delay) > threshold) {
+			jb->info.cnt_delay_discont++;
+			if (jb->info.cnt_delay_discont > 3) {
+				/* resync the jitterbuffer */
+				jb->info.cnt_delay_discont = 0;
+				jb->hist_ptr = 0;
+				jb->hist_maxbuf_valid = 0;
+
+				jb_warn("Resyncing the jb. last_delay %ld, this delay %ld, threshold %ld, new offset %ld\n", jb->info.last_delay, delay, threshold, ts - now);
+				jb->info.resync_offset = ts - now;
+				jb->info.last_delay = delay = 0; /* after resync, frame is right on time */
+			} else {
+				return -1;
+			}
+		} else {
+			jb->info.last_delay = delay;
+			jb->info.cnt_delay_discont = 0;
+		}
+	}
+
+	kicked = jb->history[jb->hist_ptr % JB_HISTORY_SZ];
+
+	jb->history[(jb->hist_ptr++) % JB_HISTORY_SZ] = delay;
+
+	/* optimization; the max/min buffers don't need to be recalculated,
+	 * if this packet's entry doesn't change them. This happens if this
+	 * packet is not involved, _and_ any packet that got kicked out of
+	 * the history is also not involved. We do a number of comparisons,
+	 * but it's probably still worthwhile, because it will usually
+	 * succeed, and should be a lot faster than going through all 500
+	 * packets in history */
+	if (!jb->hist_maxbuf_valid)
+		return 0;
+
+	/* don't do this until we've filled history
+	 * (reduces some edge cases below) */
+	if (jb->hist_ptr < JB_HISTORY_SZ)
+		goto invalidate;
+
+	/* if the new delay would go into min */
+	if (delay < jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])
+		goto invalidate;
+
+	/* or max.. */
+	if (delay > jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])
+		goto invalidate;
+
+	/* or the kicked delay would be in min */
+	if (kicked <= jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])
+		goto invalidate;
+
+	if (kicked >= jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])
+		goto invalidate;
+
+	/* if we got here, we don't need to invalidate, 'cause this delay didn't
+	 * affect things */
+	return 0;
+	/* end optimization */
+
+
+invalidate:
+	jb->hist_maxbuf_valid = 0;
+	return 0;
+}
+
+static void history_calc_maxbuf(jitterbuf *jb)
+{
+	int i,j;
+
+	if (jb->hist_ptr == 0)
+		return;
+
+
+	/* initialize maxbuf/minbuf to the latest value */
+	for (i=0;i<JB_HISTORY_MAXBUF_SZ;i++) {
+		/*
+		 * jb->hist_maxbuf[i] = jb->history[(jb->hist_ptr-1) % JB_HISTORY_SZ];
+		 * jb->hist_minbuf[i] = jb->history[(jb->hist_ptr-1) % JB_HISTORY_SZ];
+		 */
+		jb->hist_maxbuf[i] = JB_LONGMIN;
+		jb->hist_minbuf[i] = JB_LONGMAX;
+	}
+
+	/* use insertion sort to populate maxbuf */
+	/* we want it to be the top "n" values, in order */
+
+	/* start at the beginning, or JB_HISTORY_SZ frames ago */
+	i = (jb->hist_ptr > JB_HISTORY_SZ) ? (jb->hist_ptr - JB_HISTORY_SZ) : 0;
+
+	for (;i<jb->hist_ptr;i++) {
+	time_in_ms_t toins = jb->history[i % JB_HISTORY_SZ];
+
+		/* if the maxbuf should get this */
+		if (toins > jb->hist_maxbuf[JB_HISTORY_MAXBUF_SZ-1])  {
+
+			/* insertion-sort it into the maxbuf */
+			for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
+				/* found where it fits */
+				if (toins > jb->hist_maxbuf[j]) {
+					/* move over */
+					memmove(jb->hist_maxbuf + j + 1, jb->hist_maxbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_maxbuf[0]));
+					/* insert */
+					jb->hist_maxbuf[j] = toins;
+
+					break;
+				}
+			}
+		}
+
+		/* if the minbuf should get this */
+		if (toins < jb->hist_minbuf[JB_HISTORY_MAXBUF_SZ-1])  {
+
+			/* insertion-sort it into the maxbuf */
+			for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
+				/* found where it fits */
+				if (toins < jb->hist_minbuf[j]) {
+					/* move over */
+					memmove(jb->hist_minbuf + j + 1, jb->hist_minbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_minbuf[0]));
+					/* insert */
+					jb->hist_minbuf[j] = toins;
+
+					break;
+				}
+			}
+		}
+
+		if (0) {
+			int k;
+			fprintf(stderr, "toins = %ld\n", toins);
+			fprintf(stderr, "maxbuf =");
+			for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
+				fprintf(stderr, "%ld ", jb->hist_maxbuf[k]);
+			fprintf(stderr, "\nminbuf =");
+			for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
+				fprintf(stderr, "%ld ", jb->hist_minbuf[k]);
+			fprintf(stderr, "\n");
+		}
+	}
+
+	jb->hist_maxbuf_valid = 1;
+}
+
+static void history_get(jitterbuf *jb)
+{
+    time_in_ms_t max, min, jitter;
+	int index;
+	int count;
+
+	if (!jb->hist_maxbuf_valid)
+		history_calc_maxbuf(jb);
+
+	/* count is how many items in history we're examining */
+	count = (jb->hist_ptr < JB_HISTORY_SZ) ? jb->hist_ptr : JB_HISTORY_SZ;
+
+	/* index is the "n"ths highest/lowest that we'll look for */
+	index = count * JB_HISTORY_DROPPCT / 100;
+
+	/* sanity checks for index */
+	if (index > (JB_HISTORY_MAXBUF_SZ - 1))
+		index = JB_HISTORY_MAXBUF_SZ - 1;
+
+
+	if (index < 0) {
+		jb->info.min = 0;
+		jb->info.jitter = 0;
+		return;
+	}
+
+	max = jb->hist_maxbuf[index];
+	min = jb->hist_minbuf[index];
+
+	jitter = max - min;
+
+	/* these debug stmts compare the difference between looking at the absolute jitter, and the
+	 * values we get by throwing away the outliers */
+	/*
+	fprintf(stderr, "[%d] min=%d, max=%d, jitter=%d\n", index, min, max, jitter);
+	fprintf(stderr, "[%d] min=%d, max=%d, jitter=%d\n", 0, jb->hist_minbuf[0], jb->hist_maxbuf[0], jb->hist_maxbuf[0]-jb->hist_minbuf[0]);
+	*/
+
+	jb->info.min = min;
+	jb->info.jitter = jitter;
+}
+
+/* returns 1 if frame was inserted into head of queue, 0 otherwise */
+static int queue_put(jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, time_in_ms_t ts)
+{
+	jb_frame *frame;
+	jb_frame *p;
+	int head = 0;
+	time_in_ms_t resync_ts = ts - jb->info.resync_offset;
+
+	if ((frame = jb->free)) {
+		jb->free = frame->next;
+	} else if (!(frame = (jb_frame *)malloc(sizeof(*frame)))) {
+		jb_err("cannot allocate frame\n");
+		return 0;
+	}
+
+	jb->info.frames_cur++;
+
+	frame->data = data;
+	frame->ts = resync_ts;
+	frame->ms = ms;
+	frame->type = type;
+
+	/*
+	 * frames are a circular list, jb-frames points to to the lowest ts,
+	 * jb->frames->prev points to the highest ts
+	 */
+
+	if (!jb->frames) {  /* queue is empty */
+		jb->frames = frame;
+		frame->next = frame;
+		frame->prev = frame;
+		head = 1;
+	} else if (resync_ts < jb->frames->ts) {
+		frame->next = jb->frames;
+		frame->prev = jb->frames->prev;
+
+		frame->next->prev = frame;
+		frame->prev->next = frame;
+
+		/* frame is out of order */
+		jb->info.frames_ooo++;
+
+		jb->frames = frame;
+		head = 1;
+	} else {
+		p = jb->frames;
+
+		/* frame is out of order */
+		if (resync_ts < p->prev->ts) jb->info.frames_ooo++;
+
+		while (resync_ts < p->prev->ts && p->prev != jb->frames)
+			p = p->prev;
+
+		frame->next = p;
+		frame->prev = p->prev;
+
+		frame->next->prev = frame;
+		frame->prev->next = frame;
+	}
+	return head;
+}
+
+static time_in_ms_t queue_next(jitterbuf *jb) 
+{
+	if (jb->frames)
+		return jb->frames->ts;
+	else
+		return -1;
+}
+
+static time_in_ms_t queue_last(jitterbuf *jb) 
+{
+	if (jb->frames)
+		return jb->frames->prev->ts;
+	else
+		return -1;
+}
+
+static jb_frame *_queue_get(jitterbuf *jb, time_in_ms_t ts, int all) 
+{
+	jb_frame *frame;
+	frame = jb->frames;
+
+	if (!frame)
+		return NULL;
+
+	/*jb_warn("queue_get: ASK %ld FIRST %ld\n", ts, frame->ts); */
+
+	if (all || ts >= frame->ts) {
+		/* remove this frame */
+		frame->prev->next = frame->next;
+		frame->next->prev = frame->prev;
+
+		if (frame->next == frame)
+			jb->frames = NULL;
+		else
+			jb->frames = frame->next;
+
+
+		/* insert onto "free" single-linked list */
+		frame->next = jb->free;
+		jb->free = frame;
+
+		jb->info.frames_cur--;
+
+		/* we return the frame pointer, even though it's on free list,
+		 * but caller must copy data */
+		return frame;
+	}
+
+	return NULL;
+}
+
+static jb_frame *queue_get(jitterbuf *jb, time_in_ms_t ts) 
+{
+	return _queue_get(jb,ts,0);
+}
+
+static jb_frame *queue_getall(jitterbuf *jb)
+{
+	return _queue_get(jb,0,1);
+}
+
+#if 0
+/* some diagnostics */
+static void jb_dbginfo(jitterbuf *jb)
+{
+	if (dbgf == NULL)
+		return;
+
+	jb_dbg("\njb info: fin=%ld fout=%ld flate=%ld flost=%ld fdrop=%ld fcur=%ld\n",
+		jb->info.frames_in, jb->info.frames_out, jb->info.frames_late, jb->info.frames_lost, jb->info.frames_dropped, jb->info.frames_cur);
+
+	jb_dbg("jitter=%ld current=%ld target=%ld min=%ld sil=%d len=%d len/fcur=%ld\n",
+		jb->info.jitter, jb->info.current, jb->info.target, jb->info.min, jb->info.silence_begin_ts, jb->info.current - jb->info.min,
+		jb->info.frames_cur ? (jb->info.current - jb->info.min)/jb->info.frames_cur : -8);
+	if (jb->info.frames_in > 0)
+		jb_dbg("jb info: Loss PCT = %ld%%, Late PCT = %ld%%\n",
+		jb->info.frames_lost * 100/(jb->info.frames_in + jb->info.frames_lost),
+		jb->info.frames_late * 100/jb->info.frames_in);
+	jb_dbg("jb info: queue %d -> %d.  last_ts %d (queue len: %d) last_ms %d\n",
+		queue_next(jb),
+		queue_last(jb),
+		jb->info.next_voice_ts,
+		queue_last(jb) - queue_next(jb),
+		jb->info.last_voice_ms);
+}
+#endif
+
+#ifdef DEEP_DEBUG
+static void jb_chkqueue(jitterbuf *jb)
+{
+	int i=0;
+	jb_frame *p = jb->frames;
+
+	if (!p) {
+		return;
+	}
+
+	do {
+		if (p->next == NULL)  {
+			jb_err("Queue is BROKEN at item [%d]", i);
+		}
+		i++;
+		p=p->next;
+	} while (p->next != jb->frames);
+}
+
+static void jb_dbgqueue(jitterbuf *jb)
+{
+	int i=0;
+	jb_frame *p = jb->frames;
+
+	jb_dbg("queue: ");
+
+	if (!p) {
+		jb_dbg("EMPTY\n");
+		return;
+	}
+
+	do {
+		jb_dbg("[%d]=%ld ", i++, p->ts);
+		p=p->next;
+	} while (p->next != jb->frames);
+
+	jb_dbg("\n");
+}
+#endif
+
+enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, time_in_ms_t ts, time_in_ms_t now)
+{
+	jb_dbg2("jb_put(%x,%x,%ld,%ld,%ld)\n", jb, data, ms, ts, now);
+
+	jb->info.frames_in++;
+
+	if (type == JB_TYPE_VOICE) {
+		/* presently, I'm only adding VOICE frames to history and drift
+		 * calculations; mostly because with the IAX integrations, I'm
+		 * sending retransmitted control frames with their awkward
+		 * timestamps through
+		 */
+		if (history_put(jb,ts,now,ms))
+			return JB_DROP;
+	}
+
+	/* if put into head of queue, caller needs to reschedule */
+	if (queue_put(jb,data,type,ms,ts)) {
+		return JB_SCHED;
+	}
+
+	return JB_OK;
+}
+
+
+static enum jb_return_code _jb_get(jitterbuf *jb, jb_frame *frameout, time_in_ms_t now, long interpl)
+{
+	jb_frame *frame;
+	time_in_ms_t diff;
+
+	/*if ((now - jb_next(jb)) > 2 * jb->info.last_voice_ms) jb_warn("SCHED: %ld", (now - jb_next(jb))); */
+	/* get jitter info */
+	history_get(jb);
+
+
+	/* target */
+	jb->info.target = jb->info.jitter + jb->info.min + jb->info.conf.target_extra;
+
+	/* if a hard clamp was requested, use it */
+	if ((jb->info.conf.max_jitterbuf) && ((jb->info.target - jb->info.min) > jb->info.conf.max_jitterbuf)) {
+		jb_dbg("clamping target from %d to %d\n", (jb->info.target - jb->info.min), jb->info.conf.max_jitterbuf);
+		jb->info.target = jb->info.min + jb->info.conf.max_jitterbuf;
+	}
+
+	diff = jb->info.target - jb->info.current;
+
+	/* jb_warn("diff = %d lms=%d last = %d now = %d\n", diff,  */
+	/*	jb->info.last_voice_ms, jb->info.last_adjustment, now); */
+
+	/* let's work on non-silent case first */
+	if (!jb->info.silence_begin_ts) {
+		/* we want to grow */
+		if ((diff > 0) &&
+			/* we haven't grown in the delay length */
+			(((jb->info.last_adjustment + JB_ADJUST_DELAY) < now) ||
+			/* we need to grow more than the "length" we have left */
+			(diff > queue_last(jb) - queue_next(jb)) ) ) {
+			/* grow by interp frame length */
+			jb->info.current += interpl;
+			jb->info.next_voice_ts += interpl;
+			jb->info.last_voice_ms = interpl;
+			jb->info.last_adjustment = now;
+			jb->info.cnt_contig_interp++;
+			/* assume silence instead of continuing to interpolate */
+			if (jb->info.conf.max_contig_interp && jb->info.cnt_contig_interp >= jb->info.conf.max_contig_interp) {
+				jb->info.silence_begin_ts = jb->info.next_voice_ts - jb->info.current;
+			}
+			jb_dbg("G");
+			return JB_INTERP;
+		}
+
+		frame = queue_get(jb, jb->info.next_voice_ts - jb->info.current);
+
+		/* not a voice frame; just return it. */
+		if (frame && frame->type != JB_TYPE_VOICE) {
+			/* track start of silence */
+			if (frame->type == JB_TYPE_SILENCE) {
+				jb->info.silence_begin_ts = frame->ts;
+				jb->info.cnt_contig_interp = 0;
+			}
+
+			*frameout = *frame;
+			jb->info.frames_out++;
+			jb_dbg("o");
+			return JB_OK;
+		}
+
+		/* voice frame is later than expected */
+		if (frame && frame->ts + jb->info.current < jb->info.next_voice_ts) {
+			if (frame->ts + jb->info.current > jb->info.next_voice_ts - jb->info.last_voice_ms) {
+				/* either we interpolated past this frame in the last jb_get */
+				/* or the frame is still in order, but came a little too quick */
+				*frameout = *frame;
+				/* reset expectation for next frame */
+				jb->info.next_voice_ts = frame->ts + jb->info.current + frame->ms;
+				jb->info.frames_out++;
+				decrement_losspct(jb);
+				jb->info.cnt_contig_interp = 0;
+				jb_dbg("v");
+				return JB_OK;
+			} else {
+				/* voice frame is late */
+				*frameout = *frame;
+				jb->info.frames_out++;
+				decrement_losspct(jb);
+				jb->info.frames_late++;
+				jb->info.frames_lost--;
+				jb_dbg("l");
+				/*jb_warn("\nlate: wanted=%ld, this=%ld, next=%ld\n", jb->info.next_voice_ts - jb->info.current, frame->ts, queue_next(jb));
+				  jb_warninfo(jb); */
+				return JB_DROP;
+			}
+		}
+
+		/* keep track of frame sizes, to allow for variable sized-frames */
+		if (frame && frame->ms > 0) {
+			jb->info.last_voice_ms = frame->ms;
+		}
+
+		/* we want to shrink; shrink at 1 frame / 500ms */
+		/* unless we don't have a frame, then shrink 1 frame */
+		/* every 80ms (though perhaps we can shrink even faster */
+		/* in this case) */
+		if (diff < -jb->info.conf.target_extra &&
+				((!frame && jb->info.last_adjustment + 80 < now) ||
+				 (jb->info.last_adjustment + 500 < now))) {
+
+			jb->info.last_adjustment = now;
+			jb->info.cnt_contig_interp = 0;
+
+			if (frame) {
+				*frameout = *frame;
+				/* shrink by frame size we're throwing out */
+				jb->info.current -= frame->ms;
+				jb->info.frames_out++;
+				decrement_losspct(jb);
+				jb->info.frames_dropped++;
+				jb_dbg("s");
+				return JB_DROP;
+			} else {
+				/* shrink by last_voice_ms */
+				jb->info.current -= jb->info.last_voice_ms;
+				jb->info.frames_lost++;
+				increment_losspct(jb);
+				jb_dbg("S");
+				return JB_NOFRAME;
+			}
+		}
+
+		/* lost frame */
+		if (!frame) {
+			/* this is a bit of a hack for now, but if we're close to
+			 * target, and we find a missing frame, it makes sense to
+			 * grow, because the frame might just be a bit late;
+			 * otherwise, we presently get into a pattern where we return
+			 * INTERP for the lost frame, then it shows up next, and we
+			 * throw it away because it's late */
+			/* I've recently only been able to replicate this using
+			 * iaxclient talking to app_echo on asterisk.  In this case,
+			 * my outgoing packets go through asterisk's (old)
+			 * jitterbuffer, and then might get an unusual increasing delay
+			 * there if it decides to grow?? */
+			/* Update: that might have been a different bug, that has been fixed..
+			 * But, this still seemed like a good idea, except that it ended up making a single actual
+			 * lost frame get interpolated two or more times, when there was "room" to grow, so it might
+			 * be a bit of a bad idea overall */
+			/*if (diff > -1 * jb->info.last_voice_ms) {
+				jb->info.current += jb->info.last_voice_ms;
+				jb->info.last_adjustment = now;
+				jb_warn("g");
+				return JB_INTERP;
+			} */
+			jb->info.frames_lost++;
+			increment_losspct(jb);
+			jb->info.next_voice_ts += interpl;
+			jb->info.last_voice_ms = interpl;
+			jb->info.cnt_contig_interp++;
+			/* assume silence instead of continuing to interpolate */
+			if (jb->info.conf.max_contig_interp && jb->info.cnt_contig_interp >= jb->info.conf.max_contig_interp) {
+				jb->info.silence_begin_ts = jb->info.next_voice_ts - jb->info.current;
+			}
+			jb_dbg("L");
+			return JB_INTERP;
+		}
+
+		/* normal case; return the frame, increment stuff */
+		*frameout = *frame;
+		jb->info.next_voice_ts += frame->ms;
+		jb->info.frames_out++;
+		jb->info.cnt_contig_interp = 0;
+		decrement_losspct(jb);
+		jb_dbg("v");
+		return JB_OK;
+	} else {
+		/* TODO: after we get the non-silent case down, we'll make the
+		 * silent case -- basically, we'll just grow and shrink faster
+		 * here, plus handle next_voice_ts a bit differently */
+
+		/* to disable silent special case altogether, just uncomment this: */
+		/* jb->info.silence_begin_ts = 0; */
+
+		/* shrink interpl len every 10ms during silence */
+		if (diff < -jb->info.conf.target_extra &&
+			jb->info.last_adjustment + 10 <= now) {
+			jb->info.current -= interpl;
+			jb->info.last_adjustment = now;
+		}
+
+		frame = queue_get(jb, now - jb->info.current);
+		if (!frame) {
+			return JB_NOFRAME;
+		} else if (frame->type != JB_TYPE_VOICE) {
+			/* normal case; in silent mode, got a non-voice frame */
+			*frameout = *frame;
+			jb->info.frames_out++;
+			return JB_OK;
+		}
+		if (frame->ts < jb->info.silence_begin_ts) {
+			/* voice frame is late */
+			*frameout = *frame;
+			jb->info.frames_out++;
+			decrement_losspct(jb);
+			jb->info.frames_late++;
+			jb->info.frames_lost--;
+			jb_dbg("l");
+			/*jb_warn("\nlate: wanted=%ld, this=%ld, next=%ld\n", jb->info.next_voice_ts - jb->info.current, frame->ts, queue_next(jb));
+			  jb_warninfo(jb); */
+			return JB_DROP;
+		} else {
+			/* voice frame */
+			/* try setting current to target right away here */
+			jb->info.current = jb->info.target;
+			jb->info.silence_begin_ts = 0;
+			jb->info.next_voice_ts = frame->ts + jb->info.current + frame->ms;
+			jb->info.last_voice_ms = frame->ms;
+			jb->info.frames_out++;
+			decrement_losspct(jb);
+			*frameout = *frame;
+			jb_dbg("V");
+			return JB_OK;
+		}
+	}
+}
+
+time_in_ms_t jb_next(jitterbuf *jb)
+{
+	if (jb->info.silence_begin_ts) {
+		if (jb->frames) {
+			time_in_ms_t next = queue_next(jb);
+			history_get(jb);
+			/* shrink during silence */
+			if (jb->info.target - jb->info.current < -jb->info.conf.target_extra)
+				return jb->info.last_adjustment + 10;
+			return next + jb->info.target;
+		}
+		else
+			return JB_LONGMAX;
+	} else {
+		return jb->info.next_voice_ts;
+	}
+}
+
+enum jb_return_code jb_get(jitterbuf *jb, jb_frame *frameout, time_in_ms_t now, long interpl)
+{
+	enum jb_return_code ret = _jb_get(jb, frameout, now, interpl);
+#if 0
+	static int lastts=0;
+	int thists = ((ret == JB_OK) || (ret == JB_DROP)) ? frameout->ts : 0;
+	jb_warn("jb_get(%x,%x,%ld) = %d (%d)\n", jb, frameout, now, ret, thists);
+	if (thists && thists < lastts) jb_warn("XXXX timestamp roll-back!!!\n");
+	lastts = thists;
+#endif
+	return ret;
+}
+
+enum jb_return_code jb_getall(jitterbuf *jb, jb_frame *frameout)
+{
+	jb_frame *frame;
+	frame = queue_getall(jb);
+
+	if (!frame) {
+		return JB_NOFRAME;
+	}
+
+	*frameout = *frame;
+	return JB_OK;
+}
+
+
+enum jb_return_code jb_getinfo(jitterbuf *jb, jb_info *stats)
+{
+	history_get(jb);
+
+	*stats = jb->info;
+
+	return JB_OK;
+}
+
+enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf)
+{
+	/* take selected settings from the struct */
+
+	jb->info.conf.max_jitterbuf = conf->max_jitterbuf;
+	jb->info.conf.resync_threshold = conf->resync_threshold;
+	jb->info.conf.max_contig_interp = conf->max_contig_interp;
+
+	/* -1 indicates use of the default JB_TARGET_EXTRA value */
+	jb->info.conf.target_extra = ( conf->target_extra == -1 )
+		? JB_TARGET_EXTRA
+		: conf->target_extra
+		;
+
+	/* update these to match new target_extra setting */
+	jb->info.current = jb->info.conf.target_extra;
+	jb->info.target = jb->info.conf.target_extra;
+
+	return JB_OK;
+}
+
+

Modified: freeswitch/trunk/libs/iax/src/jitterbuf.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/jitterbuf.h	(original)
+++ freeswitch/trunk/libs/iax/src/jitterbuf.h	Fri Sep 21 14:49:14 2007
@@ -1,162 +1,162 @@
-/*
- * jitterbuf: an application-independent jitterbuffer
- *
- * Copyrights:
- * Copyright (C) 2004-2005, Horizon Wimba, Inc.
- *
- * Contributors:
- * Steve Kann <stevek at stevek.com>
- *
- * This program is free software, distributed under the terms of
- * the GNU Lesser (Library) General Public License
- *
- * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
- */
-
-#ifndef _JITTERBUF_H_
-#define _JITTERBUF_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* configuration constants */
-	/* Number of historical timestamps to use in calculating jitter and drift */
-#define JB_HISTORY_SZ		500
-	/* what percentage of timestamps should we drop from the history when we examine it;
-	 * this might eventually be something made configurable */
-#define JB_HISTORY_DROPPCT	3
-	/* the maximum droppct we can handle (say it was configurable). */
-#define JB_HISTORY_DROPPCT_MAX	4
-	/* the size of the buffer we use to keep the top and botton timestamps for dropping */
-#define JB_HISTORY_MAXBUF_SZ	JB_HISTORY_SZ * JB_HISTORY_DROPPCT_MAX / 100
-	/* amount of additional jitterbuffer adjustment  */
-#define JB_TARGET_EXTRA 40
-	/* ms between growing and shrinking; may not be honored if jitterbuffer runs out of space */
-#define JB_ADJUST_DELAY 40
-
-enum jb_return_code {
-	/* return codes */
-	JB_OK,            /* 0 */
-	JB_EMPTY,         /* 1 */
-	JB_NOFRAME,       /* 2 */
-	JB_INTERP,        /* 3 */
-	JB_DROP,          /* 4 */
-	JB_SCHED          /* 5 */
-};
-
-enum jb_frame_type {
-/* frame types */
-	JB_TYPE_CONTROL,  /* 0            */
-	JB_TYPE_VOICE,    /* 1            */
-	JB_TYPE_VIDEO,    /* 2 - reserved */
-	JB_TYPE_SILENCE   /* 3            */
-};
-
-typedef struct jb_conf {
-	/* settings */
-	long max_jitterbuf;     /* defines a hard clamp to use in setting the jitter buffer delay */
-	long resync_threshold;  /* the jb will resync when delay increases to (2 * jitter) + this param */
-	long max_contig_interp; /* the max interp frames to return in a row */
-	long target_extra;      /* amount of additional jitterbuffer adjustment, overrides JB_TARGET_EXTRA */
-} jb_conf;
-
-typedef struct jb_info {
-	jb_conf conf;
-
-	/* statistics */
-	long frames_in;		/* number of frames input to the jitterbuffer.*/
-	long frames_out;	/* number of frames output from the jitterbuffer.*/
-	long frames_late;	/* number of frames which were too late, and dropped.*/
-	long frames_lost;	/* number of missing frames.*/
-	long frames_dropped;	/* number of frames dropped (shrinkage) */
-	long frames_ooo;	/* number of frames received out-of-order */
-	long frames_cur;	/* number of frames presently in jb, awaiting delivery.*/
-	time_in_ms_t jitter; 		/* jitter measured within current history interval*/
-	time_in_ms_t min;		/* minimum lateness within current history interval */
-	time_in_ms_t current; 		/* the present jitterbuffer adjustment */
-	time_in_ms_t target; 		/* the target jitterbuffer adjustment */
-	long losspct;		/* recent lost frame percentage (* 1000) */
-	time_in_ms_t next_voice_ts;	/* the ts of the next frame to be read from the jb - in receiver's time */
-	long last_voice_ms;	/* the duration of the last voice frame */
-	time_in_ms_t silence_begin_ts;	/* the time of the last CNG frame, when in silence */
-	time_in_ms_t last_adjustment;   /* the time of the last adjustment */
-	time_in_ms_t last_delay;        /* the last now added to history */
-	long cnt_delay_discont;	/* the count of discontinuous delays */
-	time_in_ms_t resync_offset;     /* the amount to offset ts to support resyncs */
-	long cnt_contig_interp;	/* the number of contiguous interp frames returned */
-} jb_info;
-
-typedef struct jb_frame {
-	void *data;               /* the frame data */
-	time_in_ms_t ts;	/* the relative delivery time expected */
-	long ms;                  /* the time covered by this frame, in sec/8000 */
-	enum jb_frame_type type;  /* the type of frame */
-	struct jb_frame *next, *prev;
-} jb_frame;
-
-typedef struct jitterbuf {
-	jb_info info;
-
-	/* history */
-	time_in_ms_t history[JB_HISTORY_SZ];   		/* history */
-	int  hist_ptr;				/* points to index in history for next entry */
-	time_in_ms_t hist_maxbuf[JB_HISTORY_MAXBUF_SZ];	/* a sorted buffer of the max delays (highest first) */
-	time_in_ms_t hist_minbuf[JB_HISTORY_MAXBUF_SZ];	/* a sorted buffer of the min delays (lowest first) */
-	int  hist_maxbuf_valid;			/* are the "maxbuf"/minbuf valid? */
-
-	jb_frame *frames;		/* queued frames */
-	jb_frame *free;			/* free frames (avoid malloc?) */
-} jitterbuf;
-
-
-/* new jitterbuf */
-jitterbuf *		jb_new(void);
-
-/* destroy jitterbuf */
-void			jb_destroy(jitterbuf *jb);
-
-/* reset jitterbuf */
-/* NOTE:  The jitterbuffer should be empty before you call this, otherwise
- * you will leak queued frames, and some internal structures */
-void			jb_reset(jitterbuf *jb);
-
-/* queue a frame data=frame data, timings (in ms): ms=length of frame (for voice), ts=ts (sender's time)
- * now=now (in receiver's time) return value is one of
- * JB_OK: Frame added. Last call to jb_next() still valid
- * JB_DROP: Drop this frame immediately
- * JB_SCHED: Frame added. Call jb_next() to get a new time for the next frame
- */
-enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, time_in_ms_t ts, time_in_ms_t now);
-
-/* get a frame for time now (receiver's time)  return value is one of
- * JB_OK:  You've got frame!
- * JB_DROP: Here's an audio frame you should just drop.  Ask me again for this time..
- * JB_NOFRAME: There's no frame scheduled for this time.
- * JB_INTERP: Please interpolate an interpl-length frame for this time (either we need to grow, or there was a lost frame)
- * JB_EMPTY: The jb is empty.
- */
-enum jb_return_code jb_get(jitterbuf *jb, jb_frame *frame, time_in_ms_t now, long interpl);
-
-/* unconditionally get frames from jitterbuf until empty */
-enum jb_return_code jb_getall(jitterbuf *jb, jb_frame *frameout);
-
-/* when is the next frame due out, in receiver's time (0=EMPTY)
- * This value may change as frames are added (esp non-audio frames) */
-time_in_ms_t			jb_next(jitterbuf *jb);
-
-/* get jitterbuf info: only "statistics" may be valid */
-enum jb_return_code jb_getinfo(jitterbuf *jb, jb_info *stats);
-
-/* set jitterbuf conf */
-enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf);
-
-typedef			void (*jb_output_function_t)(const char *fmt, ...);
-extern void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
+/*
+ * jitterbuf: an application-independent jitterbuffer
+ *
+ * Copyrights:
+ * Copyright (C) 2004-2005, Horizon Wimba, Inc.
+ *
+ * Contributors:
+ * Steve Kann <stevek at stevek.com>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU Lesser (Library) General Public License
+ *
+ * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
+ */
+
+#ifndef _JITTERBUF_H_
+#define _JITTERBUF_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* configuration constants */
+	/* Number of historical timestamps to use in calculating jitter and drift */
+#define JB_HISTORY_SZ		500
+	/* what percentage of timestamps should we drop from the history when we examine it;
+	 * this might eventually be something made configurable */
+#define JB_HISTORY_DROPPCT	3
+	/* the maximum droppct we can handle (say it was configurable). */
+#define JB_HISTORY_DROPPCT_MAX	4
+	/* the size of the buffer we use to keep the top and botton timestamps for dropping */
+#define JB_HISTORY_MAXBUF_SZ	JB_HISTORY_SZ * JB_HISTORY_DROPPCT_MAX / 100
+	/* amount of additional jitterbuffer adjustment  */
+#define JB_TARGET_EXTRA 40
+	/* ms between growing and shrinking; may not be honored if jitterbuffer runs out of space */
+#define JB_ADJUST_DELAY 40
+
+enum jb_return_code {
+	/* return codes */
+	JB_OK,            /* 0 */
+	JB_EMPTY,         /* 1 */
+	JB_NOFRAME,       /* 2 */
+	JB_INTERP,        /* 3 */
+	JB_DROP,          /* 4 */
+	JB_SCHED          /* 5 */
+};
+
+enum jb_frame_type {
+/* frame types */
+	JB_TYPE_CONTROL,  /* 0            */
+	JB_TYPE_VOICE,    /* 1            */
+	JB_TYPE_VIDEO,    /* 2 - reserved */
+	JB_TYPE_SILENCE   /* 3            */
+};
+
+typedef struct jb_conf {
+	/* settings */
+	long max_jitterbuf;     /* defines a hard clamp to use in setting the jitter buffer delay */
+	long resync_threshold;  /* the jb will resync when delay increases to (2 * jitter) + this param */
+	long max_contig_interp; /* the max interp frames to return in a row */
+	long target_extra;      /* amount of additional jitterbuffer adjustment, overrides JB_TARGET_EXTRA */
+} jb_conf;
+
+typedef struct jb_info {
+	jb_conf conf;
+
+	/* statistics */
+	long frames_in;		/* number of frames input to the jitterbuffer.*/
+	long frames_out;	/* number of frames output from the jitterbuffer.*/
+	long frames_late;	/* number of frames which were too late, and dropped.*/
+	long frames_lost;	/* number of missing frames.*/
+	long frames_dropped;	/* number of frames dropped (shrinkage) */
+	long frames_ooo;	/* number of frames received out-of-order */
+	long frames_cur;	/* number of frames presently in jb, awaiting delivery.*/
+	time_in_ms_t jitter; 		/* jitter measured within current history interval*/
+	time_in_ms_t min;		/* minimum lateness within current history interval */
+	time_in_ms_t current; 		/* the present jitterbuffer adjustment */
+	time_in_ms_t target; 		/* the target jitterbuffer adjustment */
+	long losspct;		/* recent lost frame percentage (* 1000) */
+	time_in_ms_t next_voice_ts;	/* the ts of the next frame to be read from the jb - in receiver's time */
+	long last_voice_ms;	/* the duration of the last voice frame */
+	time_in_ms_t silence_begin_ts;	/* the time of the last CNG frame, when in silence */
+	time_in_ms_t last_adjustment;   /* the time of the last adjustment */
+	time_in_ms_t last_delay;        /* the last now added to history */
+	long cnt_delay_discont;	/* the count of discontinuous delays */
+	time_in_ms_t resync_offset;     /* the amount to offset ts to support resyncs */
+	long cnt_contig_interp;	/* the number of contiguous interp frames returned */
+} jb_info;
+
+typedef struct jb_frame {
+	void *data;               /* the frame data */
+	time_in_ms_t ts;	/* the relative delivery time expected */
+	long ms;                  /* the time covered by this frame, in sec/8000 */
+	enum jb_frame_type type;  /* the type of frame */
+	struct jb_frame *next, *prev;
+} jb_frame;
+
+typedef struct jitterbuf {
+	jb_info info;
+
+	/* history */
+	time_in_ms_t history[JB_HISTORY_SZ];   		/* history */
+	int  hist_ptr;				/* points to index in history for next entry */
+	time_in_ms_t hist_maxbuf[JB_HISTORY_MAXBUF_SZ];	/* a sorted buffer of the max delays (highest first) */
+	time_in_ms_t hist_minbuf[JB_HISTORY_MAXBUF_SZ];	/* a sorted buffer of the min delays (lowest first) */
+	int  hist_maxbuf_valid;			/* are the "maxbuf"/minbuf valid? */
+
+	jb_frame *frames;		/* queued frames */
+	jb_frame *free;			/* free frames (avoid malloc?) */
+} jitterbuf;
+
+
+/* new jitterbuf */
+jitterbuf *		jb_new(void);
+
+/* destroy jitterbuf */
+void			jb_destroy(jitterbuf *jb);
+
+/* reset jitterbuf */
+/* NOTE:  The jitterbuffer should be empty before you call this, otherwise
+ * you will leak queued frames, and some internal structures */
+void			jb_reset(jitterbuf *jb);
+
+/* queue a frame data=frame data, timings (in ms): ms=length of frame (for voice), ts=ts (sender's time)
+ * now=now (in receiver's time) return value is one of
+ * JB_OK: Frame added. Last call to jb_next() still valid
+ * JB_DROP: Drop this frame immediately
+ * JB_SCHED: Frame added. Call jb_next() to get a new time for the next frame
+ */
+enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type type, long ms, time_in_ms_t ts, time_in_ms_t now);
+
+/* get a frame for time now (receiver's time)  return value is one of
+ * JB_OK:  You've got frame!
+ * JB_DROP: Here's an audio frame you should just drop.  Ask me again for this time..
+ * JB_NOFRAME: There's no frame scheduled for this time.
+ * JB_INTERP: Please interpolate an interpl-length frame for this time (either we need to grow, or there was a lost frame)
+ * JB_EMPTY: The jb is empty.
+ */
+enum jb_return_code jb_get(jitterbuf *jb, jb_frame *frame, time_in_ms_t now, long interpl);
+
+/* unconditionally get frames from jitterbuf until empty */
+enum jb_return_code jb_getall(jitterbuf *jb, jb_frame *frameout);
+
+/* when is the next frame due out, in receiver's time (0=EMPTY)
+ * This value may change as frames are added (esp non-audio frames) */
+time_in_ms_t			jb_next(jitterbuf *jb);
+
+/* get jitterbuf info: only "statistics" may be valid */
+enum jb_return_code jb_getinfo(jitterbuf *jb, jb_info *stats);
+
+/* set jitterbuf conf */
+enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf);
+
+typedef			void (*jb_output_function_t)(const char *fmt, ...);
+extern void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif

Modified: freeswitch/trunk/libs/libdingaling/src/sha1.h
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/sha1.h	(original)
+++ freeswitch/trunk/libs/libdingaling/src/sha1.h	Fri Sep 21 14:49:14 2007
@@ -34,18 +34,18 @@
 #else
 # if HAVE_STDINT_H
 #  include <stdint.h>
-# else
-#  ifndef uint32_t
-#   ifdef WIN32
-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;
-typedef unsigned long	in_addr_t;
+# else
+#  ifndef uint32_t
+#   ifdef WIN32
+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;
+typedef unsigned long	in_addr_t;
 #   endif
 #  endif
 # endif

Modified: freeswitch/trunk/libs/libetpan/build-windows/libetpan/libetpan.vcproj
==============================================================================
--- freeswitch/trunk/libs/libetpan/build-windows/libetpan/libetpan.vcproj	(original)
+++ freeswitch/trunk/libs/libetpan/build-windows/libetpan/libetpan.vcproj	Fri Sep 21 14:49:14 2007
@@ -1,850 +1,850 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="libetpan"
-	ProjectGUID="{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
-	RootNamespace="libetpan"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="2"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				InlineFunctionExpansion="0"
-				AdditionalIncludeDirectories="../include;../include/libetpan"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBETPAN_DLL"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="1"
-				ForcedIncludeFiles="../StdAfx.h"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/DLL"
-				AdditionalDependencies="oldnames.lib  Ws2_32.lib mswsock.lib"
-				OutputFile="../Debug/libetpan.dll"
-				LinkIncremental="2"
-				SuppressStartupBanner="TRUE"
-				IgnoreDefaultLibraryNames="C"
-				ModuleDefinitionFile=""
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/libetpan.pdb"
-				MapExports="TRUE"
-				SubSystem="0"
-				ImportLibrary="../Debug/libetpan.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="2"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../include;../include/libetpan"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBETPAN_DLL"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="0"
-				CompileAs="1"
-				ForcedIncludeFiles="../StdAfx.h"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/DLL"
-				AdditionalDependencies="oldnames.lib  Ws2_32.lib mswsock.lib"
-				OutputFile="../Release/libetpan.dll"
-				LinkIncremental="2"
-				IgnoreDefaultLibraryNames="C"
-				GenerateDebugInformation="FALSE"
-				SubSystem="0"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="../Release/libetpan.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath="..\build_headers.list">
-				<FileConfiguration
-					Name="Debug|Win32">
-					<Tool
-						Name="VCCustomBuildTool"
-						CommandLine="cd ..
-build_headers.bat
-"
-						Outputs="$(InputDir)\_headers_depends"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCustomBuildTool"
-						CommandLine="cd ..
-build_headers.bat
-"
-						Outputs="$(InputDir)\_headers_depends"/>
-				</FileConfiguration>
-			</File>
-			<Filter
-				Name="engine"
-				Filter="">
-				<File
-					RelativePath="..\..\src\engine\mailengine.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\..\src\engine\mailprivacy.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\..\src\engine\mailprivacy_gnupg.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\..\src\engine\mailprivacy_smime.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\..\src\engine\mailprivacy_tools.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-			</Filter>
-			<Filter
-				Name="datatypes"
-				Filter="">
-				<File
-					RelativePath="..\..\src\data-types\base64.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\carray.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\charconv.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\chash.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\cinthash.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\clist.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\connect.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mail_cache_db.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\maillock.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mailsem.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mailstream.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mailstream_helper.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mailstream_low.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mailstream_socket.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mailstream_ssl.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mapping.c">
-					<FileConfiguration
-						Name="Debug|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32"
-						ExcludedFromBuild="TRUE">
-						<Tool
-							Name="VCCLCompilerTool"/>
-					</FileConfiguration>
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\md5.c">
-				</File>
-				<File
-					RelativePath="..\..\src\data-types\mmapstring.c">
-				</File>
-			</Filter>
-			<Filter
-				Name="low-level"
-				Filter="">
-				<Filter
-					Name="imap"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_keywords.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_parser.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_print.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_sender.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_socket.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_ssl.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_types_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\mailimap_extension.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\annotatemore.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\annotatemore_sender.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\annotatemore_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\annotatemore_parser.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\acl.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\acl_sender.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\acl_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imap\acl_parser.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="pop3"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\pop3\mailpop3.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\pop3\mailpop3_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\pop3\mailpop3_socket.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\pop3\mailpop3_ssl.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="mime"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_content.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_decode.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_disposition.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_types_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_write.c">
-						<FileConfiguration
-							Name="Debug|Win32"
-							ExcludedFromBuild="TRUE">
-							<Tool
-								Name="VCCLCompilerTool"/>
-						</FileConfiguration>
-						<FileConfiguration
-							Name="Release|Win32"
-							ExcludedFromBuild="TRUE">
-							<Tool
-								Name="VCCLCompilerTool"/>
-						</FileConfiguration>
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_write_file.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_write_generic.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mime\mailmime_write_mem.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="imf"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf_types_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf_write.c">
-						<FileConfiguration
-							Name="Debug|Win32"
-							ExcludedFromBuild="TRUE">
-							<Tool
-								Name="VCCLCompilerTool"/>
-						</FileConfiguration>
-						<FileConfiguration
-							Name="Release|Win32"
-							ExcludedFromBuild="TRUE">
-							<Tool
-								Name="VCCLCompilerTool"/>
-						</FileConfiguration>
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf_write_file.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf_write_generic.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\imf\mailimf_write_mem.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="maildir"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\maildir\maildir.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="mbox"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\mbox\mailmbox.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mbox\mailmbox_parse.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\mbox\mailmbox_types.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="mh"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\mh\mailmh.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="nntp"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\nntp\newsnntp.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\nntp\newsnntp_socket.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\nntp\newsnntp_ssl.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="smtp"
-					Filter="">
-					<File
-						RelativePath="..\..\src\low-level\smtp\mailsmtp.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\smtp\mailsmtp_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\smtp\mailsmtp_socket.c">
-					</File>
-					<File
-						RelativePath="..\..\src\low-level\smtp\mailsmtp_ssl.c">
-					</File>
-				</Filter>
-			</Filter>
-			<Filter
-				Name="driver"
-				Filter="">
-				<Filter
-					Name="interface"
-					Filter="">
-					<File
-						RelativePath="..\..\src\driver\interface\maildriver.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\maildriver_tools.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\maildriver_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\maildriver_types_helper.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\mailfolder.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\mailmessage.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\mailmessage_tools.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\mailmessage_types.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\mailstorage.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\interface\mailstorage_tools.c">
-					</File>
-				</Filter>
-				<Filter
-					Name="implementation"
-					Filter="">
-					<Filter
-						Name="data-message"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\data-message\data_message_driver.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="db"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\db\dbdriver.c">
-							<FileConfiguration
-								Name="Debug|Win32"
-								ExcludedFromBuild="TRUE">
-								<Tool
-									Name="VCCLCompilerTool"/>
-							</FileConfiguration>
-							<FileConfiguration
-								Name="Release|Win32"
-								ExcludedFromBuild="TRUE">
-								<Tool
-									Name="VCCLCompilerTool"/>
-							</FileConfiguration>
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\db\dbdriver_message.c">
-							<FileConfiguration
-								Name="Debug|Win32"
-								ExcludedFromBuild="TRUE">
-								<Tool
-									Name="VCCLCompilerTool"/>
-							</FileConfiguration>
-							<FileConfiguration
-								Name="Release|Win32"
-								ExcludedFromBuild="TRUE">
-								<Tool
-									Name="VCCLCompilerTool"/>
-							</FileConfiguration>
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\db\dbstorage.c">
-							<FileConfiguration
-								Name="Debug|Win32"
-								ExcludedFromBuild="TRUE">
-								<Tool
-									Name="VCCLCompilerTool"/>
-							</FileConfiguration>
-							<FileConfiguration
-								Name="Release|Win32"
-								ExcludedFromBuild="TRUE">
-								<Tool
-									Name="VCCLCompilerTool"/>
-							</FileConfiguration>
-						</File>
-					</Filter>
-					<Filter
-						Name="hotmail"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\hotmail\hotmailstorage.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="imap"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\imap\imapdriver.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\imap\imapdriver_cached.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\imap\imapdriver_cached_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\imap\imapdriver_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\imap\imapdriver_tools.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\imap\imapstorage.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="maildir"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_cached.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_cached_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_tools.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\maildir\maildirstorage.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="mbox"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_cached.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_cached_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_tools.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mbox\mboxstorage.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="mh"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\mh\mhdriver.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mh\mhdriver_cached.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mh\mhdriver_cached_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mh\mhdriver_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mh\mhdriver_tools.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\mh\mhstorage.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="mime-message"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\mime-message\mime_message_driver.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="nntp"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_cached.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_cached_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_tools.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\nntp\nntpstorage.c">
-						</File>
-					</Filter>
-					<Filter
-						Name="pop3"
-						Filter="">
-						<File
-							RelativePath="..\..\src\driver\implementation\pop3\pop3driver.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_cached.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_cached_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_message.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_tools.c">
-						</File>
-						<File
-							RelativePath="..\..\src\driver\implementation\pop3\pop3storage.c">
-						</File>
-					</Filter>
-				</Filter>
-				<Filter
-					Name="tools"
-					Filter="">
-					<File
-						RelativePath="..\..\src\driver\tools\generic_cache.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\tools\imfcache.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\tools\mailthread.c">
-					</File>
-					<File
-						RelativePath="..\..\src\driver\tools\mailthread_types.c">
-					</File>
-				</Filter>
-			</Filter>
-			<Filter
-				Name="Windows"
-				Filter="">
-				<File
-					RelativePath="..\..\src\windows\dirent.c">
-				</File>
-				<File
-					RelativePath="..\..\src\windows\misc.c">
-				</File>
-				<File
-					RelativePath="..\..\src\windows\mmap.c">
-				</File>
-				<File
-					RelativePath="..\..\src\windows\time_r.c">
-				</File>
-				<File
-					RelativePath="..\..\src\windows\wsocket.cpp">
-					<FileConfiguration
-						Name="Debug|Win32">
-						<Tool
-							Name="VCCLCompilerTool"
-							CompileAs="2"/>
-					</FileConfiguration>
-					<FileConfiguration
-						Name="Release|Win32">
-						<Tool
-							Name="VCCLCompilerTool"
-							CompileAs="2"/>
-					</FileConfiguration>
-				</File>
-			</Filter>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-			<File
-				RelativePath="..\libetpan-config.h">
-			</File>
-			<File
-				RelativePath="..\libetpan_version.h">
-			</File>
-			<File
-				RelativePath="..\StdAfx.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="libetpan"
+	ProjectGUID="{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
+	RootNamespace="libetpan"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="../include;../include/libetpan"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBETPAN_DLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="1"
+				ForcedIncludeFiles="../StdAfx.h"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/DLL"
+				AdditionalDependencies="oldnames.lib  Ws2_32.lib mswsock.lib"
+				OutputFile="../Debug/libetpan.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				IgnoreDefaultLibraryNames="C"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/libetpan.pdb"
+				MapExports="TRUE"
+				SubSystem="0"
+				ImportLibrary="../Debug/libetpan.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include;../include/libetpan"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBETPAN_DLL"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="0"
+				CompileAs="1"
+				ForcedIncludeFiles="../StdAfx.h"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/DLL"
+				AdditionalDependencies="oldnames.lib  Ws2_32.lib mswsock.lib"
+				OutputFile="../Release/libetpan.dll"
+				LinkIncremental="2"
+				IgnoreDefaultLibraryNames="C"
+				GenerateDebugInformation="FALSE"
+				SubSystem="0"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="../Release/libetpan.lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\build_headers.list">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						CommandLine="cd ..
+build_headers.bat
+"
+						Outputs="$(InputDir)\_headers_depends"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						CommandLine="cd ..
+build_headers.bat
+"
+						Outputs="$(InputDir)\_headers_depends"/>
+				</FileConfiguration>
+			</File>
+			<Filter
+				Name="engine"
+				Filter="">
+				<File
+					RelativePath="..\..\src\engine\mailengine.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\src\engine\mailprivacy.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\src\engine\mailprivacy_gnupg.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\src\engine\mailprivacy_smime.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\src\engine\mailprivacy_tools.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+			</Filter>
+			<Filter
+				Name="datatypes"
+				Filter="">
+				<File
+					RelativePath="..\..\src\data-types\base64.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\carray.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\charconv.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\chash.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\cinthash.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\clist.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\connect.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mail_cache_db.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\maillock.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mailsem.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mailstream.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mailstream_helper.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mailstream_low.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mailstream_socket.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mailstream_ssl.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mapping.c">
+					<FileConfiguration
+						Name="Debug|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						ExcludedFromBuild="TRUE">
+						<Tool
+							Name="VCCLCompilerTool"/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\md5.c">
+				</File>
+				<File
+					RelativePath="..\..\src\data-types\mmapstring.c">
+				</File>
+			</Filter>
+			<Filter
+				Name="low-level"
+				Filter="">
+				<Filter
+					Name="imap"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_keywords.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_parser.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_print.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_sender.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_socket.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_ssl.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_types_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\mailimap_extension.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\annotatemore.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\annotatemore_sender.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\annotatemore_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\annotatemore_parser.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\acl.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\acl_sender.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\acl_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imap\acl_parser.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="pop3"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\pop3\mailpop3.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\pop3\mailpop3_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\pop3\mailpop3_socket.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\pop3\mailpop3_ssl.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="mime"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_content.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_decode.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_disposition.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_types_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_write.c">
+						<FileConfiguration
+							Name="Debug|Win32"
+							ExcludedFromBuild="TRUE">
+							<Tool
+								Name="VCCLCompilerTool"/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							ExcludedFromBuild="TRUE">
+							<Tool
+								Name="VCCLCompilerTool"/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_write_file.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_write_generic.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mime\mailmime_write_mem.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="imf"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf_types_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf_write.c">
+						<FileConfiguration
+							Name="Debug|Win32"
+							ExcludedFromBuild="TRUE">
+							<Tool
+								Name="VCCLCompilerTool"/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							ExcludedFromBuild="TRUE">
+							<Tool
+								Name="VCCLCompilerTool"/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf_write_file.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf_write_generic.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\imf\mailimf_write_mem.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="maildir"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\maildir\maildir.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="mbox"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\mbox\mailmbox.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mbox\mailmbox_parse.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\mbox\mailmbox_types.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="mh"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\mh\mailmh.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="nntp"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\nntp\newsnntp.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\nntp\newsnntp_socket.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\nntp\newsnntp_ssl.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="smtp"
+					Filter="">
+					<File
+						RelativePath="..\..\src\low-level\smtp\mailsmtp.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\smtp\mailsmtp_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\smtp\mailsmtp_socket.c">
+					</File>
+					<File
+						RelativePath="..\..\src\low-level\smtp\mailsmtp_ssl.c">
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="driver"
+				Filter="">
+				<Filter
+					Name="interface"
+					Filter="">
+					<File
+						RelativePath="..\..\src\driver\interface\maildriver.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\maildriver_tools.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\maildriver_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\maildriver_types_helper.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\mailfolder.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\mailmessage.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\mailmessage_tools.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\mailmessage_types.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\mailstorage.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\interface\mailstorage_tools.c">
+					</File>
+				</Filter>
+				<Filter
+					Name="implementation"
+					Filter="">
+					<Filter
+						Name="data-message"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\data-message\data_message_driver.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="db"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\db\dbdriver.c">
+							<FileConfiguration
+								Name="Debug|Win32"
+								ExcludedFromBuild="TRUE">
+								<Tool
+									Name="VCCLCompilerTool"/>
+							</FileConfiguration>
+							<FileConfiguration
+								Name="Release|Win32"
+								ExcludedFromBuild="TRUE">
+								<Tool
+									Name="VCCLCompilerTool"/>
+							</FileConfiguration>
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\db\dbdriver_message.c">
+							<FileConfiguration
+								Name="Debug|Win32"
+								ExcludedFromBuild="TRUE">
+								<Tool
+									Name="VCCLCompilerTool"/>
+							</FileConfiguration>
+							<FileConfiguration
+								Name="Release|Win32"
+								ExcludedFromBuild="TRUE">
+								<Tool
+									Name="VCCLCompilerTool"/>
+							</FileConfiguration>
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\db\dbstorage.c">
+							<FileConfiguration
+								Name="Debug|Win32"
+								ExcludedFromBuild="TRUE">
+								<Tool
+									Name="VCCLCompilerTool"/>
+							</FileConfiguration>
+							<FileConfiguration
+								Name="Release|Win32"
+								ExcludedFromBuild="TRUE">
+								<Tool
+									Name="VCCLCompilerTool"/>
+							</FileConfiguration>
+						</File>
+					</Filter>
+					<Filter
+						Name="hotmail"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\hotmail\hotmailstorage.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="imap"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\imap\imapdriver.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\imap\imapdriver_cached.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\imap\imapdriver_cached_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\imap\imapdriver_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\imap\imapdriver_tools.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\imap\imapstorage.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="maildir"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_cached.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_cached_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_tools.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\maildir\maildirstorage.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="mbox"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_cached.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_cached_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_tools.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mbox\mboxstorage.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="mh"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\mh\mhdriver.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mh\mhdriver_cached.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mh\mhdriver_cached_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mh\mhdriver_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mh\mhdriver_tools.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\mh\mhstorage.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="mime-message"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\mime-message\mime_message_driver.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="nntp"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_cached.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_cached_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_tools.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\nntp\nntpstorage.c">
+						</File>
+					</Filter>
+					<Filter
+						Name="pop3"
+						Filter="">
+						<File
+							RelativePath="..\..\src\driver\implementation\pop3\pop3driver.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_cached.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_cached_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_message.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\pop3\pop3driver_tools.c">
+						</File>
+						<File
+							RelativePath="..\..\src\driver\implementation\pop3\pop3storage.c">
+						</File>
+					</Filter>
+				</Filter>
+				<Filter
+					Name="tools"
+					Filter="">
+					<File
+						RelativePath="..\..\src\driver\tools\generic_cache.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\tools\imfcache.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\tools\mailthread.c">
+					</File>
+					<File
+						RelativePath="..\..\src\driver\tools\mailthread_types.c">
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="Windows"
+				Filter="">
+				<File
+					RelativePath="..\..\src\windows\dirent.c">
+				</File>
+				<File
+					RelativePath="..\..\src\windows\misc.c">
+				</File>
+				<File
+					RelativePath="..\..\src\windows\mmap.c">
+				</File>
+				<File
+					RelativePath="..\..\src\windows\time_r.c">
+				</File>
+				<File
+					RelativePath="..\..\src\windows\wsocket.cpp">
+					<FileConfiguration
+						Name="Debug|Win32">
+						<Tool
+							Name="VCCLCompilerTool"
+							CompileAs="2"/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32">
+						<Tool
+							Name="VCCLCompilerTool"
+							CompileAs="2"/>
+					</FileConfiguration>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath="..\libetpan-config.h">
+			</File>
+			<File
+				RelativePath="..\libetpan_version.h">
+			</File>
+			<File
+				RelativePath="..\StdAfx.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: freeswitch/trunk/libs/libetpan/build-windows/readmsg/readmsg.vcproj
==============================================================================
--- freeswitch/trunk/libs/libetpan/build-windows/readmsg/readmsg.vcproj	(original)
+++ freeswitch/trunk/libs/libetpan/build-windows/readmsg/readmsg.vcproj	Fri Sep 21 14:49:14 2007
@@ -1,170 +1,170 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="readmsg"
-	ProjectGUID="{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="1"
-				ForcedIncludeFiles="../../StdAfx.h"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libetpan.lib"
-				OutputFile="../Debug/readmsg.exe"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\Debug"
-				IgnoreDefaultLibraryNames="C"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/readmsg.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="0"
-				ForcedIncludeFiles="../StdAfx.h"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libetpan.lib"
-				OutputFile="../Release/readmsg.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\Release"
-				IgnoreDefaultLibraryNames="C"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath="..\..\src\bsd\getopt.c">
-			</File>
-			<File
-				RelativePath="..\..\src\bsd\getopt_long.c">
-			</File>
-			<File
-				RelativePath="..\..\tests\Makefile">
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="TRUE">
-					<Tool
-						Name="VCCustomBuildTool"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="TRUE">
-					<Tool
-						Name="VCCustomBuildTool"/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\tests\option-parser.c">
-			</File>
-			<File
-				RelativePath="..\..\tests\readmsg-common.c">
-			</File>
-			<File
-				RelativePath="..\..\tests\readmsg.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="readmsg"
+	ProjectGUID="{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="1"
+				ForcedIncludeFiles="../../StdAfx.h"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="libetpan.lib"
+				OutputFile="../Debug/readmsg.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="..\Debug"
+				IgnoreDefaultLibraryNames="C"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/readmsg.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="0"
+				ForcedIncludeFiles="../StdAfx.h"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="libetpan.lib"
+				OutputFile="../Release/readmsg.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\Release"
+				IgnoreDefaultLibraryNames="C"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\..\src\bsd\getopt.c">
+			</File>
+			<File
+				RelativePath="..\..\src\bsd\getopt_long.c">
+			</File>
+			<File
+				RelativePath="..\..\tests\Makefile">
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="TRUE">
+					<Tool
+						Name="VCCustomBuildTool"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="TRUE">
+					<Tool
+						Name="VCCustomBuildTool"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\tests\option-parser.c">
+			</File>
+			<File
+				RelativePath="..\..\tests\readmsg-common.c">
+			</File>
+			<File
+				RelativePath="..\..\tests\readmsg.c">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: freeswitch/trunk/libs/libetpan/build-windows/smtpsend/smtpsend.vcproj
==============================================================================
--- freeswitch/trunk/libs/libetpan/build-windows/smtpsend/smtpsend.vcproj	(original)
+++ freeswitch/trunk/libs/libetpan/build-windows/smtpsend/smtpsend.vcproj	Fri Sep 21 14:49:14 2007
@@ -1,164 +1,164 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="smtpsend"
-	ProjectGUID="{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"
-				CompileAs="1"
-				ForcedIncludeFiles="../../StdAfx.h"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libetpan.lib"
-				OutputFile="../Debug/smtpsend.exe"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\Debug"
-				IgnoreDefaultLibraryNames="C"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/smtpsend.pdb"
-				SubSystem="1"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="0"
-				ForcedIncludeFiles="../StdAfx.h"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="libetpan.lib"
-				OutputFile="../Release/smtpsend.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\Release"
-				IgnoreDefaultLibraryNames="C"
-				GenerateDebugInformation="TRUE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath="..\..\src\bsd\getopt.c">
-			</File>
-			<File
-				RelativePath="..\..\src\bsd\getopt_long.c">
-			</File>
-			<File
-				RelativePath="..\..\tests\Makefile">
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="TRUE">
-					<Tool
-						Name="VCCustomBuildTool"/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="TRUE">
-					<Tool
-						Name="VCCustomBuildTool"/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\tests\smtpsend.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="smtpsend"
+	ProjectGUID="{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="1"
+				ForcedIncludeFiles="../../StdAfx.h"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="libetpan.lib"
+				OutputFile="../Debug/smtpsend.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="..\Debug"
+				IgnoreDefaultLibraryNames="C"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/smtpsend.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="0"
+				ForcedIncludeFiles="../StdAfx.h"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="libetpan.lib"
+				OutputFile="../Release/smtpsend.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\Release"
+				IgnoreDefaultLibraryNames="C"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\..\src\bsd\getopt.c">
+			</File>
+			<File
+				RelativePath="..\..\src\bsd\getopt_long.c">
+			</File>
+			<File
+				RelativePath="..\..\tests\Makefile">
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="TRUE">
+					<Tool
+						Name="VCCustomBuildTool"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="TRUE">
+					<Tool
+						Name="VCCustomBuildTool"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\tests\smtpsend.c">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/example/sine.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/example/sine.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/example/sine.cxx	Fri Sep 21 14:49:14 2007
@@ -1,137 +1,137 @@
-// ---------------------------------------------------------------------------------------
-
-#include <iostream>
-#include <cmath>
-#include <cassert>
-#include <cstddef>
-#include "portaudiocpp/PortAudioCpp.hxx"
-
-// ---------------------------------------------------------------------------------------
-
-// Some constants:
-const int NUM_SECONDS = 5;
-const double SAMPLE_RATE = 44100.0;
-const int FRAMES_PER_BUFFER = 64;
-const int TABLE_SIZE = 200;
-
-// ---------------------------------------------------------------------------------------
-
-// SineGenerator class:
-class SineGenerator
-{
-public:
-	SineGenerator(int tableSize) : tableSize_(tableSize), leftPhase_(0), rightPhase_(0)
-	{
-		const double PI = 3.14159265;
-		table_ = new float[tableSize];
-		for (int i = 0; i < tableSize; ++i)
-		{
-			table_[i] = 0.125f * (float)sin(((double)i/(double)tableSize)*PI*2.);
-		}
-	}
-
-	~SineGenerator()
-	{
-		delete[] table_;
-	}
-
-	int generate(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, 
-		const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags)
-	{
-		assert(outputBuffer != NULL);
-
-		float **out = static_cast<float **>(outputBuffer);
-
-		for (unsigned int i = 0; i < framesPerBuffer; ++i)
-		{
-			out[0][i] = table_[leftPhase_];
-			out[1][i] = table_[rightPhase_];
-
-			leftPhase_ += 1;
-			if (leftPhase_ >= tableSize_)
-				leftPhase_ -= tableSize_;
-
-			rightPhase_ += 3;
-			if (rightPhase_ >= tableSize_)
-				rightPhase_ -= tableSize_;
-		}
-
-		return paContinue;
-	}
-
-private:
-	float *table_;
-	int tableSize_;
-	int leftPhase_;
-	int rightPhase_;
-};
-
-// ---------------------------------------------------------------------------------------
-
-// main:
-int main(int, char *[]);
-int main(int, char *[])
-{
-	try
-	{
-		// Create a SineGenerator object:
-		SineGenerator sineGenerator(TABLE_SIZE);
-
-		std::cout << "Setting up PortAudio..." << std::endl;
-
-		// Set up the System:
-		portaudio::AutoSystem autoSys;
-		portaudio::System &sys = portaudio::System::instance();
-
-		// Set up the parameters required to open a (Callback)Stream:
-		portaudio::DirectionSpecificStreamParameters outParams(sys.defaultOutputDevice(), 2, portaudio::FLOAT32, false, sys.defaultOutputDevice().defaultLowOutputLatency(), NULL);
-		portaudio::StreamParameters params(portaudio::DirectionSpecificStreamParameters::null(), outParams, SAMPLE_RATE, FRAMES_PER_BUFFER, paClipOff);
-
-		std::cout << "Opening stereo output stream..." << std::endl;
-
-		// Create (and open) a new Stream, using the SineGenerator::generate function as a callback:
-		portaudio::MemFunCallbackStream<SineGenerator> stream(params, sineGenerator, &SineGenerator::generate);
-
-		std::cout << "Starting playback for " << NUM_SECONDS << " seconds." << std::endl;
-
-		// Start the Stream (audio playback starts):
-		stream.start();
-
-		// Wait for 5 seconds:
-		sys.sleep(NUM_SECONDS * 1000);
-
-		std::cout << "Closing stream..." <<std::endl;
-
-		// Stop the Stream (not strictly needed as termintating the System will also stop all open Streams):
-		stream.stop();
-
-		// Close the Stream (not strictly needed as terminating the System will also close all open Streams):
-		stream.close();
-
-		// Terminate the System (not strictly needed as the AutoSystem will also take care of this when it 
-		// goes out of scope):
-		sys.terminate();
-
-		std::cout << "Test finished." << std::endl;
-	}
-	catch (const portaudio::PaException &e)
-	{
-		std::cout << "A PortAudio error occured: " << e.paErrorText() << std::endl;
-	}
-	catch (const portaudio::PaCppException &e)
-	{
-		std::cout << "A PortAudioCpp error occured: " << e.what() << std::endl;
-	}
-	catch (const std::exception &e)
-	{
-		std::cout << "A generic exception occured: " << e.what() << std::endl;
-	}
-	catch (...)
-	{
-		std::cout << "An unknown exception occured." << std::endl;
-	}
-
-	return 0;
-}
-
-
+// ---------------------------------------------------------------------------------------
+
+#include <iostream>
+#include <cmath>
+#include <cassert>
+#include <cstddef>
+#include "portaudiocpp/PortAudioCpp.hxx"
+
+// ---------------------------------------------------------------------------------------
+
+// Some constants:
+const int NUM_SECONDS = 5;
+const double SAMPLE_RATE = 44100.0;
+const int FRAMES_PER_BUFFER = 64;
+const int TABLE_SIZE = 200;
+
+// ---------------------------------------------------------------------------------------
+
+// SineGenerator class:
+class SineGenerator
+{
+public:
+	SineGenerator(int tableSize) : tableSize_(tableSize), leftPhase_(0), rightPhase_(0)
+	{
+		const double PI = 3.14159265;
+		table_ = new float[tableSize];
+		for (int i = 0; i < tableSize; ++i)
+		{
+			table_[i] = 0.125f * (float)sin(((double)i/(double)tableSize)*PI*2.);
+		}
+	}
+
+	~SineGenerator()
+	{
+		delete[] table_;
+	}
+
+	int generate(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, 
+		const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags)
+	{
+		assert(outputBuffer != NULL);
+
+		float **out = static_cast<float **>(outputBuffer);
+
+		for (unsigned int i = 0; i < framesPerBuffer; ++i)
+		{
+			out[0][i] = table_[leftPhase_];
+			out[1][i] = table_[rightPhase_];
+
+			leftPhase_ += 1;
+			if (leftPhase_ >= tableSize_)
+				leftPhase_ -= tableSize_;
+
+			rightPhase_ += 3;
+			if (rightPhase_ >= tableSize_)
+				rightPhase_ -= tableSize_;
+		}
+
+		return paContinue;
+	}
+
+private:
+	float *table_;
+	int tableSize_;
+	int leftPhase_;
+	int rightPhase_;
+};
+
+// ---------------------------------------------------------------------------------------
+
+// main:
+int main(int, char *[]);
+int main(int, char *[])
+{
+	try
+	{
+		// Create a SineGenerator object:
+		SineGenerator sineGenerator(TABLE_SIZE);
+
+		std::cout << "Setting up PortAudio..." << std::endl;
+
+		// Set up the System:
+		portaudio::AutoSystem autoSys;
+		portaudio::System &sys = portaudio::System::instance();
+
+		// Set up the parameters required to open a (Callback)Stream:
+		portaudio::DirectionSpecificStreamParameters outParams(sys.defaultOutputDevice(), 2, portaudio::FLOAT32, false, sys.defaultOutputDevice().defaultLowOutputLatency(), NULL);
+		portaudio::StreamParameters params(portaudio::DirectionSpecificStreamParameters::null(), outParams, SAMPLE_RATE, FRAMES_PER_BUFFER, paClipOff);
+
+		std::cout << "Opening stereo output stream..." << std::endl;
+
+		// Create (and open) a new Stream, using the SineGenerator::generate function as a callback:
+		portaudio::MemFunCallbackStream<SineGenerator> stream(params, sineGenerator, &SineGenerator::generate);
+
+		std::cout << "Starting playback for " << NUM_SECONDS << " seconds." << std::endl;
+
+		// Start the Stream (audio playback starts):
+		stream.start();
+
+		// Wait for 5 seconds:
+		sys.sleep(NUM_SECONDS * 1000);
+
+		std::cout << "Closing stream..." <<std::endl;
+
+		// Stop the Stream (not strictly needed as termintating the System will also stop all open Streams):
+		stream.stop();
+
+		// Close the Stream (not strictly needed as terminating the System will also close all open Streams):
+		stream.close();
+
+		// Terminate the System (not strictly needed as the AutoSystem will also take care of this when it 
+		// goes out of scope):
+		sys.terminate();
+
+		std::cout << "Test finished." << std::endl;
+	}
+	catch (const portaudio::PaException &e)
+	{
+		std::cout << "A PortAudio error occured: " << e.paErrorText() << std::endl;
+	}
+	catch (const portaudio::PaCppException &e)
+	{
+		std::cout << "A PortAudioCpp error occured: " << e.what() << std::endl;
+	}
+	catch (const std::exception &e)
+	{
+		std::cout << "A generic exception occured: " << e.what() << std::endl;
+	}
+	catch (...)
+	{
+		std::cout << "An unknown exception occured." << std::endl;
+	}
+
+	return 0;
+}
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/AsioDeviceAdapter.cxx	Fri Sep 21 14:49:14 2007
@@ -1,83 +1,83 @@
-#include "portaudiocpp/AsioDeviceAdapter.hxx"
-
-#include "portaudio.h"
-#include "pa_asio.h"
-
-#include "portaudiocpp/Device.hxx"
-#include "portaudiocpp/HostApi.hxx"
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-	AsioDeviceAdapter::AsioDeviceAdapter(Device &device)
-	{
-		if (device.hostApi().typeId() != paASIO)
-			throw PaCppException(PaCppException::UNABLE_TO_ADAPT_DEVICE);
-
-		device_ = &device;
-
-		PaError err = PaAsio_GetAvailableLatencyValues(device_->index(), &minBufferSize_, &maxBufferSize_, 
-			&preferredBufferSize_, &granularity_);
-
-		if (err != paNoError)
-			throw PaException(err);
-
-	}
-
-	Device &AsioDeviceAdapter::device()
-	{
-		return *device_;
-	}
-
-	long AsioDeviceAdapter::minBufferSize() const
-	{
-		return minBufferSize_;
-	}
-
-	long AsioDeviceAdapter::maxBufferSize() const
-	{
-		return maxBufferSize_;
-	}
-
-	long AsioDeviceAdapter::preferredBufferSize() const
-	{
-		return preferredBufferSize_;
-	}
-
-	long AsioDeviceAdapter::granularity() const
-	{
-		return granularity_;
-	}
-
-	void AsioDeviceAdapter::showControlPanel(void *systemSpecific)
-	{
-		PaError err = PaAsio_ShowControlPanel(device_->index(), systemSpecific);
-
-		if (err != paNoError)
-			throw PaException(err);
-	}
-
-	const char *AsioDeviceAdapter::inputChannelName(int channelIndex) const
-	{
-		const char *channelName;
+#include "portaudiocpp/AsioDeviceAdapter.hxx"
+
+#include "portaudio.h"
+#include "pa_asio.h"
+
+#include "portaudiocpp/Device.hxx"
+#include "portaudiocpp/HostApi.hxx"
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+	AsioDeviceAdapter::AsioDeviceAdapter(Device &device)
+	{
+		if (device.hostApi().typeId() != paASIO)
+			throw PaCppException(PaCppException::UNABLE_TO_ADAPT_DEVICE);
+
+		device_ = &device;
+
+		PaError err = PaAsio_GetAvailableLatencyValues(device_->index(), &minBufferSize_, &maxBufferSize_, 
+			&preferredBufferSize_, &granularity_);
+
+		if (err != paNoError)
+			throw PaException(err);
+
+	}
+
+	Device &AsioDeviceAdapter::device()
+	{
+		return *device_;
+	}
+
+	long AsioDeviceAdapter::minBufferSize() const
+	{
+		return minBufferSize_;
+	}
+
+	long AsioDeviceAdapter::maxBufferSize() const
+	{
+		return maxBufferSize_;
+	}
+
+	long AsioDeviceAdapter::preferredBufferSize() const
+	{
+		return preferredBufferSize_;
+	}
+
+	long AsioDeviceAdapter::granularity() const
+	{
+		return granularity_;
+	}
+
+	void AsioDeviceAdapter::showControlPanel(void *systemSpecific)
+	{
+		PaError err = PaAsio_ShowControlPanel(device_->index(), systemSpecific);
+
+		if (err != paNoError)
+			throw PaException(err);
+	}
+
+	const char *AsioDeviceAdapter::inputChannelName(int channelIndex) const
+	{
+		const char *channelName;
 		PaError err = PaAsio_GetInputChannelName(device_->index(), channelIndex, &channelName);
 
 		if (err != paNoError)
 			throw PaException(err);
 
 		return channelName;
-	}
-
-	const char *AsioDeviceAdapter::outputChannelName(int channelIndex) const
-	{
-		const char *channelName;
+	}
+
+	const char *AsioDeviceAdapter::outputChannelName(int channelIndex) const
+	{
+		const char *channelName;
 		PaError err = PaAsio_GetOutputChannelName(device_->index(), channelIndex, &channelName);
 
 		if (err != paNoError)
 			throw PaException(err);
 
 		return channelName;
-	}
-}
-
-
+	}
+}
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/BlockingStream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/BlockingStream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/BlockingStream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,100 +1,100 @@
-#include "portaudiocpp/BlockingStream.hxx"
-
-#include "portaudio.h"
-
-#include "portaudiocpp/StreamParameters.hxx"
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-
-	// --------------------------------------------------------------------------------------
-
-	BlockingStream::BlockingStream()
-	{
-	}
-
-	BlockingStream::BlockingStream(const StreamParameters &parameters)
-	{
-		open(parameters);
-	}
-
-	BlockingStream::~BlockingStream()
-	{
-		try
-		{
-			close();
-		}
-		catch (...)
-		{
-			// ignore all errors
-		}
-	}
-
-	// --------------------------------------------------------------------------------------
-
-	void BlockingStream::open(const StreamParameters &parameters)
-	{
-		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
-			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), NULL, NULL);
-
-		if (err != paNoError)
-		{
-			throw PaException(err);
-		}
-	}
-
-	// --------------------------------------------------------------------------------------
-
-	void BlockingStream::read(void *buffer, unsigned long numFrames)
-	{
-		PaError err = Pa_ReadStream(stream_, buffer, numFrames);
-
-		if (err != paNoError)
-		{
-			throw PaException(err);
-		}
-	}
-
-	void BlockingStream::write(const void *buffer, unsigned long numFrames)
-	{
-		PaError err = Pa_WriteStream(stream_, buffer, numFrames);
-
-		if (err != paNoError)
-		{
-			throw PaException(err);
-		}
-	}
-
-	// --------------------------------------------------------------------------------------
-
-	signed long BlockingStream::availableReadSize() const
-	{
-		signed long avail = Pa_GetStreamReadAvailable(stream_);
-
-		if (avail < 0)
-		{
-			throw PaException(avail);
-		}
-
-		return avail;
-	}
-
-	signed long BlockingStream::availableWriteSize() const
-	{
-		signed long avail = Pa_GetStreamWriteAvailable(stream_);
-
-		if (avail < 0)
-		{
-			throw PaException(avail);
-		}
-
-		return avail;
-	}
-
-	// --------------------------------------------------------------------------------------
-
-} // portaudio
-
-
-
+#include "portaudiocpp/BlockingStream.hxx"
+
+#include "portaudio.h"
+
+#include "portaudiocpp/StreamParameters.hxx"
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+
+	// --------------------------------------------------------------------------------------
+
+	BlockingStream::BlockingStream()
+	{
+	}
+
+	BlockingStream::BlockingStream(const StreamParameters &parameters)
+	{
+		open(parameters);
+	}
+
+	BlockingStream::~BlockingStream()
+	{
+		try
+		{
+			close();
+		}
+		catch (...)
+		{
+			// ignore all errors
+		}
+	}
+
+	// --------------------------------------------------------------------------------------
+
+	void BlockingStream::open(const StreamParameters &parameters)
+	{
+		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
+			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), NULL, NULL);
+
+		if (err != paNoError)
+		{
+			throw PaException(err);
+		}
+	}
+
+	// --------------------------------------------------------------------------------------
+
+	void BlockingStream::read(void *buffer, unsigned long numFrames)
+	{
+		PaError err = Pa_ReadStream(stream_, buffer, numFrames);
+
+		if (err != paNoError)
+		{
+			throw PaException(err);
+		}
+	}
+
+	void BlockingStream::write(const void *buffer, unsigned long numFrames)
+	{
+		PaError err = Pa_WriteStream(stream_, buffer, numFrames);
+
+		if (err != paNoError)
+		{
+			throw PaException(err);
+		}
+	}
+
+	// --------------------------------------------------------------------------------------
+
+	signed long BlockingStream::availableReadSize() const
+	{
+		signed long avail = Pa_GetStreamReadAvailable(stream_);
+
+		if (avail < 0)
+		{
+			throw PaException(avail);
+		}
+
+		return avail;
+	}
+
+	signed long BlockingStream::availableWriteSize() const
+	{
+		signed long avail = Pa_GetStreamWriteAvailable(stream_);
+
+		if (avail < 0)
+		{
+			throw PaException(avail);
+		}
+
+		return avail;
+	}
+
+	// --------------------------------------------------------------------------------------
+
+} // portaudio
+
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CFunCallbackStream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,41 +1,41 @@
-#include "portaudiocpp/CFunCallbackStream.hxx"
-
-#include "portaudiocpp/StreamParameters.hxx"
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-	CFunCallbackStream::CFunCallbackStream()
-	{
-	}
-
-	CFunCallbackStream::CFunCallbackStream(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData)
-	{
-		open(parameters, funPtr, userData);
-	}
-
-	CFunCallbackStream::~CFunCallbackStream()
-	{
-		try
-		{
-			close();
-		}
-		catch (...)
-		{
-			// ignore all errors
-		}
-	}
-
-	// ---------------------------------------------------------------------------------==
-
-	void CFunCallbackStream::open(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData)
-	{
-		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
-			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), funPtr, userData);
-
-		if (err != paNoError)
-		{
-			throw PaException(err);
-		}
-	}
-}
+#include "portaudiocpp/CFunCallbackStream.hxx"
+
+#include "portaudiocpp/StreamParameters.hxx"
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+	CFunCallbackStream::CFunCallbackStream()
+	{
+	}
+
+	CFunCallbackStream::CFunCallbackStream(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData)
+	{
+		open(parameters, funPtr, userData);
+	}
+
+	CFunCallbackStream::~CFunCallbackStream()
+	{
+		try
+		{
+			close();
+		}
+		catch (...)
+		{
+			// ignore all errors
+		}
+	}
+
+	// ---------------------------------------------------------------------------------==
+
+	void CFunCallbackStream::open(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData)
+	{
+		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
+			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), funPtr, userData);
+
+		if (err != paNoError)
+		{
+			throw PaException(err);
+		}
+	}
+}

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx	Fri Sep 21 14:49:14 2007
@@ -1,25 +1,25 @@
-#include "portaudiocpp/CallbackInterface.hxx"
-
-namespace portaudio
-{
-
-	namespace impl
-	{
-
-		//////
-		/// Adapts any CallbackInterface object to a C-callable function (ie this function). A 
-		/// pointer to the object should be passed as ``userData'' when setting up the callback.
-		//////
-		int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, 
-			const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
-		{
-			CallbackInterface *cb = static_cast<CallbackInterface *>(userData);
-			return cb->paCallbackFun(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags);
-		}
-
-
-	} // namespace impl
-
-} // namespace portaudio
-
-
+#include "portaudiocpp/CallbackInterface.hxx"
+
+namespace portaudio
+{
+
+	namespace impl
+	{
+
+		//////
+		/// Adapts any CallbackInterface object to a C-callable function (ie this function). A 
+		/// pointer to the object should be passed as ``userData'' when setting up the callback.
+		//////
+		int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, 
+			const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
+		{
+			CallbackInterface *cb = static_cast<CallbackInterface *>(userData);
+			return cb->paCallbackFun(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags);
+		}
+
+
+	} // namespace impl
+
+} // namespace portaudio
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackStream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackStream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CallbackStream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,20 +1,20 @@
-#include "portaudiocpp/CallbackStream.hxx"
-
-namespace portaudio
-{
-	CallbackStream::CallbackStream()
-	{
-	}
-
-	CallbackStream::~CallbackStream()
-	{
-	}
-
-	// -----------------------------------------------------------------------------------
-	
-	double CallbackStream::cpuLoad() const
-	{
-		return Pa_GetStreamCpuLoad(stream_);
-	}
-
-} // namespace portaudio
+#include "portaudiocpp/CallbackStream.hxx"
+
+namespace portaudio
+{
+	CallbackStream::CallbackStream()
+	{
+	}
+
+	CallbackStream::~CallbackStream()
+	{
+	}
+
+	// -----------------------------------------------------------------------------------
+	
+	double CallbackStream::cpuLoad() const
+	{
+		return Pa_GetStreamCpuLoad(stream_);
+	}
+
+} // namespace portaudio

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/CppFunCallbackStream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,81 +1,81 @@
-#include "portaudiocpp/CppFunCallbackStream.hxx"
-
-#include "portaudiocpp/StreamParameters.hxx"
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-	namespace impl
-	{
-		//////
-		/// Adapts any a C++ callback to a C-callable function (ie this function). A 
-		/// pointer to a struct with the C++ function pointer and the actual user data should be 
-		/// passed as the ``userData'' parameter when setting up the callback.
-		//////
-		int cppCallbackToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, 
-			const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
-		{
-			FunCallbackStream::CppToCCallbackData *data = static_cast<FunCallbackStream::CppToCCallbackData *>(userData);
-			return data->funPtr(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags, data->userData);
-		}
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	FunCallbackStream::CppToCCallbackData::CppToCCallbackData()
-	{
-	}
-
-	FunCallbackStream::CppToCCallbackData::CppToCCallbackData(CallbackFunPtr funPtr, void *userData) : funPtr(funPtr), userData(userData)
-	{
-	}
-
-	void FunCallbackStream::CppToCCallbackData::init(CallbackFunPtr funPtr, void *userData)
-	{
-		this->funPtr = funPtr;
-		this->userData = userData;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	FunCallbackStream::FunCallbackStream()
-	{
-	}
-
-	FunCallbackStream::FunCallbackStream(const StreamParameters &parameters, CallbackFunPtr funPtr, void *userData) : adapterData_(funPtr, userData)
-	{
-		open(parameters);
-	}
-
-	FunCallbackStream::~FunCallbackStream()
-	{
-		try
-		{
-			close();
-		}
-		catch (...)
-		{
-			// ignore all errors
-		}
-	}
-
-	void FunCallbackStream::open(const StreamParameters &parameters, CallbackFunPtr funPtr, void *userData)
-	{
-		adapterData_.init(funPtr, userData);
-		open(parameters);
-	}
-
-	void FunCallbackStream::open(const StreamParameters &parameters)
-	{
-		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
-			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::cppCallbackToPaCallbackAdapter, 
-			static_cast<void *>(&adapterData_));
-
-		if (err != paNoError)
-		{
-			throw PaException(err);
-		}
-	}
-
-	// -----------------------------------------------------------------------------------
-}
+#include "portaudiocpp/CppFunCallbackStream.hxx"
+
+#include "portaudiocpp/StreamParameters.hxx"
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+	namespace impl
+	{
+		//////
+		/// Adapts any a C++ callback to a C-callable function (ie this function). A 
+		/// pointer to a struct with the C++ function pointer and the actual user data should be 
+		/// passed as the ``userData'' parameter when setting up the callback.
+		//////
+		int cppCallbackToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, 
+			const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
+		{
+			FunCallbackStream::CppToCCallbackData *data = static_cast<FunCallbackStream::CppToCCallbackData *>(userData);
+			return data->funPtr(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags, data->userData);
+		}
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	FunCallbackStream::CppToCCallbackData::CppToCCallbackData()
+	{
+	}
+
+	FunCallbackStream::CppToCCallbackData::CppToCCallbackData(CallbackFunPtr funPtr, void *userData) : funPtr(funPtr), userData(userData)
+	{
+	}
+
+	void FunCallbackStream::CppToCCallbackData::init(CallbackFunPtr funPtr, void *userData)
+	{
+		this->funPtr = funPtr;
+		this->userData = userData;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	FunCallbackStream::FunCallbackStream()
+	{
+	}
+
+	FunCallbackStream::FunCallbackStream(const StreamParameters &parameters, CallbackFunPtr funPtr, void *userData) : adapterData_(funPtr, userData)
+	{
+		open(parameters);
+	}
+
+	FunCallbackStream::~FunCallbackStream()
+	{
+		try
+		{
+			close();
+		}
+		catch (...)
+		{
+			// ignore all errors
+		}
+	}
+
+	void FunCallbackStream::open(const StreamParameters &parameters, CallbackFunPtr funPtr, void *userData)
+	{
+		adapterData_.init(funPtr, userData);
+		open(parameters);
+	}
+
+	void FunCallbackStream::open(const StreamParameters &parameters)
+	{
+		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
+			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::cppCallbackToPaCallbackAdapter, 
+			static_cast<void *>(&adapterData_));
+
+		if (err != paNoError)
+		{
+			throw PaException(err);
+		}
+	}
+
+	// -----------------------------------------------------------------------------------
+}

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Device.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Device.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Device.cxx	Fri Sep 21 14:49:14 2007
@@ -1,168 +1,168 @@
-#include "portaudiocpp/Device.hxx"
-
-#include <cstddef>
-
-#include "portaudiocpp/HostApi.hxx"
-#include "portaudiocpp/System.hxx"
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-
-		// -------------------------------------------------------------------------------
-
-		Device::Device(PaDeviceIndex index) : index_(index)
-		{
-			if (index == paNoDevice)
-				info_ = NULL;
-			else
-				info_ = Pa_GetDeviceInfo(index);
-		}
-
-		Device::~Device()
-		{
-		}
-
-		PaDeviceIndex Device::index() const
-		{
-			return index_;
-		}
-
-		const char *Device::name() const
-		{
-			if (info_ == NULL)
-				return "";
-
-			return info_->name;
-		}
-
-		int Device::maxInputChannels() const
-		{
-			if (info_ == NULL)
-				return 0;
-
-			return info_->maxInputChannels;
-		}
-
-		int Device::maxOutputChannels() const
-		{
-			if (info_ == NULL)
-				return 0;
-
-			return info_->maxOutputChannels;
-		}
-
-		PaTime Device::defaultLowInputLatency() const
-		{
-			if (info_ == NULL)
-				return static_cast<PaTime>(0.0);
-
-			return info_->defaultLowInputLatency;
-		}
-
-		PaTime Device::defaultHighInputLatency() const
-		{
-			if (info_ == NULL)
-				return static_cast<PaTime>(0.0);
-
-			return info_->defaultHighInputLatency;
-		}
-
-		PaTime Device::defaultLowOutputLatency() const
-		{
-			if (info_ == NULL)
-				return static_cast<PaTime>(0.0);
-
-			return info_->defaultLowOutputLatency;
-		}
-
-		PaTime Device::defaultHighOutputLatency() const
-		{
-			if (info_ == NULL)
-				return static_cast<PaTime>(0.0);
-
-			return info_->defaultHighOutputLatency;
-		}
-
-		double Device::defaultSampleRate() const
-		{
-			if (info_ == NULL)
-				return 0.0;
-
-			return info_->defaultSampleRate;
-		}
-
-		// -------------------------------------------------------------------------------
-
-		bool Device::isInputOnlyDevice() const
-		{
-			return (maxOutputChannels() == 0);
-		}
-
-		bool Device::isOutputOnlyDevice() const
-		{
-			return (maxInputChannels() == 0);
-		}
-
-		bool Device::isFullDuplexDevice() const
-		{
-			return (maxInputChannels() > 0 && maxOutputChannels() > 0);
-		}
-
-		bool Device::isSystemDefaultInputDevice() const
-		{
-			return (System::instance().defaultInputDevice() == *this);
-		}
-
-		bool Device::isSystemDefaultOutputDevice() const
-		{
-			return (System::instance().defaultOutputDevice() == *this);
-		}
-
-		bool Device::isHostApiDefaultInputDevice() const
-		{
-			return (hostApi().defaultInputDevice() == *this);
-		}
-
-		bool Device::isHostApiDefaultOutputDevice() const
-		{
-			return (hostApi().defaultOutputDevice() == *this);
-		}
-
-		// -------------------------------------------------------------------------------
-
-		bool Device::operator==(const Device &rhs)
-		{
-			return (index_ == rhs.index_);
-		}
-
-		bool Device::operator!=(const Device &rhs)
-		{
-			return !(*this == rhs);
-		}
-
-		// -------------------------------------------------------------------------------
-
-		HostApi &Device::hostApi()
-		{
-			// NOTE: will cause an exception when called for the null device
-			if (info_ == NULL)
-				throw PaException(paInternalError);
-
-			return System::instance().hostApiByIndex(info_->hostApi);
-		}
-
-		const HostApi &Device::hostApi() const
-		{
-			// NOTE; will cause an exception when called for the null device
-			if (info_ == NULL)
-				throw PaException(paInternalError);
-
-			return System::instance().hostApiByIndex(info_->hostApi);
-		}
-
-		// -------------------------------------------------------------------------------
-
-} // namespace portaudio
-
-
+#include "portaudiocpp/Device.hxx"
+
+#include <cstddef>
+
+#include "portaudiocpp/HostApi.hxx"
+#include "portaudiocpp/System.hxx"
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+
+		// -------------------------------------------------------------------------------
+
+		Device::Device(PaDeviceIndex index) : index_(index)
+		{
+			if (index == paNoDevice)
+				info_ = NULL;
+			else
+				info_ = Pa_GetDeviceInfo(index);
+		}
+
+		Device::~Device()
+		{
+		}
+
+		PaDeviceIndex Device::index() const
+		{
+			return index_;
+		}
+
+		const char *Device::name() const
+		{
+			if (info_ == NULL)
+				return "";
+
+			return info_->name;
+		}
+
+		int Device::maxInputChannels() const
+		{
+			if (info_ == NULL)
+				return 0;
+
+			return info_->maxInputChannels;
+		}
+
+		int Device::maxOutputChannels() const
+		{
+			if (info_ == NULL)
+				return 0;
+
+			return info_->maxOutputChannels;
+		}
+
+		PaTime Device::defaultLowInputLatency() const
+		{
+			if (info_ == NULL)
+				return static_cast<PaTime>(0.0);
+
+			return info_->defaultLowInputLatency;
+		}
+
+		PaTime Device::defaultHighInputLatency() const
+		{
+			if (info_ == NULL)
+				return static_cast<PaTime>(0.0);
+
+			return info_->defaultHighInputLatency;
+		}
+
+		PaTime Device::defaultLowOutputLatency() const
+		{
+			if (info_ == NULL)
+				return static_cast<PaTime>(0.0);
+
+			return info_->defaultLowOutputLatency;
+		}
+
+		PaTime Device::defaultHighOutputLatency() const
+		{
+			if (info_ == NULL)
+				return static_cast<PaTime>(0.0);
+
+			return info_->defaultHighOutputLatency;
+		}
+
+		double Device::defaultSampleRate() const
+		{
+			if (info_ == NULL)
+				return 0.0;
+
+			return info_->defaultSampleRate;
+		}
+
+		// -------------------------------------------------------------------------------
+
+		bool Device::isInputOnlyDevice() const
+		{
+			return (maxOutputChannels() == 0);
+		}
+
+		bool Device::isOutputOnlyDevice() const
+		{
+			return (maxInputChannels() == 0);
+		}
+
+		bool Device::isFullDuplexDevice() const
+		{
+			return (maxInputChannels() > 0 && maxOutputChannels() > 0);
+		}
+
+		bool Device::isSystemDefaultInputDevice() const
+		{
+			return (System::instance().defaultInputDevice() == *this);
+		}
+
+		bool Device::isSystemDefaultOutputDevice() const
+		{
+			return (System::instance().defaultOutputDevice() == *this);
+		}
+
+		bool Device::isHostApiDefaultInputDevice() const
+		{
+			return (hostApi().defaultInputDevice() == *this);
+		}
+
+		bool Device::isHostApiDefaultOutputDevice() const
+		{
+			return (hostApi().defaultOutputDevice() == *this);
+		}
+
+		// -------------------------------------------------------------------------------
+
+		bool Device::operator==(const Device &rhs)
+		{
+			return (index_ == rhs.index_);
+		}
+
+		bool Device::operator!=(const Device &rhs)
+		{
+			return !(*this == rhs);
+		}
+
+		// -------------------------------------------------------------------------------
+
+		HostApi &Device::hostApi()
+		{
+			// NOTE: will cause an exception when called for the null device
+			if (info_ == NULL)
+				throw PaException(paInternalError);
+
+			return System::instance().hostApiByIndex(info_->hostApi);
+		}
+
+		const HostApi &Device::hostApi() const
+		{
+			// NOTE; will cause an exception when called for the null device
+			if (info_ == NULL)
+				throw PaException(paInternalError);
+
+			return System::instance().hostApiByIndex(info_->hostApi);
+		}
+
+		// -------------------------------------------------------------------------------
+
+} // namespace portaudio
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/DirectionSpecificStreamParameters.cxx	Fri Sep 21 14:49:14 2007
@@ -1,163 +1,163 @@
-#include "portaudiocpp/DirectionSpecificStreamParameters.hxx"
-
-#include "portaudiocpp/Device.hxx"
-
-namespace portaudio
-{
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Returns a `nil' DirectionSpecificStreamParameters object. This can be used to 
-	/// specify that one direction of a Stream is not required (i.e. when creating 
-	/// a half-duplex Stream). All fields of the null DirectionSpecificStreamParameters 
-	/// object are invalid except for the device and the number of channel, which are set 
-	/// to paNoDevice and 0 respectively.
-	//////
-	DirectionSpecificStreamParameters DirectionSpecificStreamParameters::null()
-	{
-		DirectionSpecificStreamParameters tmp;
-		tmp.paStreamParameters_.device = paNoDevice;
-		tmp.paStreamParameters_.channelCount = 0;
-		return tmp;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Default constructor -- all parameters will be uninitialized.
-	//////
-	DirectionSpecificStreamParameters::DirectionSpecificStreamParameters()
-	{
-	}
-
-	//////
-	/// Constructor which sets all required fields.
-	//////
-	DirectionSpecificStreamParameters::DirectionSpecificStreamParameters(const Device &device, int numChannels, 
-		SampleDataFormat format, bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo)
-	{
-		setDevice(device);
-		setNumChannels(numChannels);
-		setSampleFormat(format, interleaved);
-		setSuggestedLatency(suggestedLatency);
-		setHostApiSpecificStreamInfo(hostApiSpecificStreamInfo);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	void DirectionSpecificStreamParameters::setDevice(const Device &device)
-	{
-		paStreamParameters_.device = device.index();
-	}
-
-	void DirectionSpecificStreamParameters::setNumChannels(int numChannels)
-	{
-		paStreamParameters_.channelCount = numChannels;
-	}
-
-	void DirectionSpecificStreamParameters::setSampleFormat(SampleDataFormat format, bool interleaved)
-	{
-		paStreamParameters_.sampleFormat = static_cast<PaSampleFormat>(format);
-
-		if (!interleaved)
-			paStreamParameters_.sampleFormat |= paNonInterleaved;
-	}
-
-	void DirectionSpecificStreamParameters::setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved)
-	{
-		paStreamParameters_.sampleFormat = format;
-
-		paStreamParameters_.sampleFormat |= paCustomFormat;
-
-		if (!interleaved)
-			paStreamParameters_.sampleFormat |= paNonInterleaved;
-	}
-
-	void DirectionSpecificStreamParameters::setSuggestedLatency(PaTime latency)
-	{
-		paStreamParameters_.suggestedLatency = latency;
-	}
-
-	void DirectionSpecificStreamParameters::setHostApiSpecificStreamInfo(void *streamInfo)
-	{
-		paStreamParameters_.hostApiSpecificStreamInfo = streamInfo;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	PaStreamParameters *DirectionSpecificStreamParameters::paStreamParameters()
-	{
-		if (paStreamParameters_.channelCount > 0 && paStreamParameters_.device != paNoDevice)
-			return &paStreamParameters_;
-		else
-			return NULL;
-	}
-
-	const PaStreamParameters *DirectionSpecificStreamParameters::paStreamParameters() const
-	{
-		if (paStreamParameters_.channelCount > 0 && paStreamParameters_.device != paNoDevice)
-			return &paStreamParameters_;
-		else
-			return NULL;
-	}
-
-	Device &DirectionSpecificStreamParameters::device() const
-	{
-		return System::instance().deviceByIndex(paStreamParameters_.device);
-	}
-
-	int DirectionSpecificStreamParameters::numChannels() const
-	{
-		return paStreamParameters_.channelCount;
-	}
-
-	//////
-	/// Returns the (non host api-specific) sample format, without including 
-	/// the paNonInterleaved flag. If the sample format is host api-spefific, 
-	/// INVALID_FORMAT (0) will be returned.
-	//////
-	SampleDataFormat DirectionSpecificStreamParameters::sampleFormat() const
-	{
-		if (isSampleFormatHostApiSpecific())
-			return INVALID_FORMAT;
-		else
-			return static_cast<SampleDataFormat>(paStreamParameters_.sampleFormat & ~paNonInterleaved);
-	}
-
-	bool DirectionSpecificStreamParameters::isSampleFormatInterleaved() const
-	{
-		return ((paStreamParameters_.sampleFormat & paNonInterleaved) == 0);
-	}
-
-	bool DirectionSpecificStreamParameters::isSampleFormatHostApiSpecific() const
-	{
-		return ((paStreamParameters_.sampleFormat & paCustomFormat) == 0);
-	}
-
-	//////
-	/// Returns the host api-specific sample format, without including any 
-	/// paCustomFormat or paNonInterleaved flags. Will return 0 if the sample format is 
-	/// not host api-specific.
-	//////
-	PaSampleFormat DirectionSpecificStreamParameters::hostApiSpecificSampleFormat() const
-	{
-		if (isSampleFormatHostApiSpecific())
-			return paStreamParameters_.sampleFormat & ~paCustomFormat & ~paNonInterleaved;
-		else
-			return 0;
-	}
-
-	PaTime DirectionSpecificStreamParameters::suggestedLatency() const
-	{
-		return paStreamParameters_.suggestedLatency;
-	}
-
-	void *DirectionSpecificStreamParameters::hostApiSpecificStreamInfo() const
-	{
-		return paStreamParameters_.hostApiSpecificStreamInfo;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-} // namespace portaudio
+#include "portaudiocpp/DirectionSpecificStreamParameters.hxx"
+
+#include "portaudiocpp/Device.hxx"
+
+namespace portaudio
+{
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Returns a `nil' DirectionSpecificStreamParameters object. This can be used to 
+	/// specify that one direction of a Stream is not required (i.e. when creating 
+	/// a half-duplex Stream). All fields of the null DirectionSpecificStreamParameters 
+	/// object are invalid except for the device and the number of channel, which are set 
+	/// to paNoDevice and 0 respectively.
+	//////
+	DirectionSpecificStreamParameters DirectionSpecificStreamParameters::null()
+	{
+		DirectionSpecificStreamParameters tmp;
+		tmp.paStreamParameters_.device = paNoDevice;
+		tmp.paStreamParameters_.channelCount = 0;
+		return tmp;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Default constructor -- all parameters will be uninitialized.
+	//////
+	DirectionSpecificStreamParameters::DirectionSpecificStreamParameters()
+	{
+	}
+
+	//////
+	/// Constructor which sets all required fields.
+	//////
+	DirectionSpecificStreamParameters::DirectionSpecificStreamParameters(const Device &device, int numChannels, 
+		SampleDataFormat format, bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo)
+	{
+		setDevice(device);
+		setNumChannels(numChannels);
+		setSampleFormat(format, interleaved);
+		setSuggestedLatency(suggestedLatency);
+		setHostApiSpecificStreamInfo(hostApiSpecificStreamInfo);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	void DirectionSpecificStreamParameters::setDevice(const Device &device)
+	{
+		paStreamParameters_.device = device.index();
+	}
+
+	void DirectionSpecificStreamParameters::setNumChannels(int numChannels)
+	{
+		paStreamParameters_.channelCount = numChannels;
+	}
+
+	void DirectionSpecificStreamParameters::setSampleFormat(SampleDataFormat format, bool interleaved)
+	{
+		paStreamParameters_.sampleFormat = static_cast<PaSampleFormat>(format);
+
+		if (!interleaved)
+			paStreamParameters_.sampleFormat |= paNonInterleaved;
+	}
+
+	void DirectionSpecificStreamParameters::setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved)
+	{
+		paStreamParameters_.sampleFormat = format;
+
+		paStreamParameters_.sampleFormat |= paCustomFormat;
+
+		if (!interleaved)
+			paStreamParameters_.sampleFormat |= paNonInterleaved;
+	}
+
+	void DirectionSpecificStreamParameters::setSuggestedLatency(PaTime latency)
+	{
+		paStreamParameters_.suggestedLatency = latency;
+	}
+
+	void DirectionSpecificStreamParameters::setHostApiSpecificStreamInfo(void *streamInfo)
+	{
+		paStreamParameters_.hostApiSpecificStreamInfo = streamInfo;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	PaStreamParameters *DirectionSpecificStreamParameters::paStreamParameters()
+	{
+		if (paStreamParameters_.channelCount > 0 && paStreamParameters_.device != paNoDevice)
+			return &paStreamParameters_;
+		else
+			return NULL;
+	}
+
+	const PaStreamParameters *DirectionSpecificStreamParameters::paStreamParameters() const
+	{
+		if (paStreamParameters_.channelCount > 0 && paStreamParameters_.device != paNoDevice)
+			return &paStreamParameters_;
+		else
+			return NULL;
+	}
+
+	Device &DirectionSpecificStreamParameters::device() const
+	{
+		return System::instance().deviceByIndex(paStreamParameters_.device);
+	}
+
+	int DirectionSpecificStreamParameters::numChannels() const
+	{
+		return paStreamParameters_.channelCount;
+	}
+
+	//////
+	/// Returns the (non host api-specific) sample format, without including 
+	/// the paNonInterleaved flag. If the sample format is host api-spefific, 
+	/// INVALID_FORMAT (0) will be returned.
+	//////
+	SampleDataFormat DirectionSpecificStreamParameters::sampleFormat() const
+	{
+		if (isSampleFormatHostApiSpecific())
+			return INVALID_FORMAT;
+		else
+			return static_cast<SampleDataFormat>(paStreamParameters_.sampleFormat & ~paNonInterleaved);
+	}
+
+	bool DirectionSpecificStreamParameters::isSampleFormatInterleaved() const
+	{
+		return ((paStreamParameters_.sampleFormat & paNonInterleaved) == 0);
+	}
+
+	bool DirectionSpecificStreamParameters::isSampleFormatHostApiSpecific() const
+	{
+		return ((paStreamParameters_.sampleFormat & paCustomFormat) == 0);
+	}
+
+	//////
+	/// Returns the host api-specific sample format, without including any 
+	/// paCustomFormat or paNonInterleaved flags. Will return 0 if the sample format is 
+	/// not host api-specific.
+	//////
+	PaSampleFormat DirectionSpecificStreamParameters::hostApiSpecificSampleFormat() const
+	{
+		if (isSampleFormatHostApiSpecific())
+			return paStreamParameters_.sampleFormat & ~paCustomFormat & ~paNonInterleaved;
+		else
+			return 0;
+	}
+
+	PaTime DirectionSpecificStreamParameters::suggestedLatency() const
+	{
+		return paStreamParameters_.suggestedLatency;
+	}
+
+	void *DirectionSpecificStreamParameters::hostApiSpecificStreamInfo() const
+	{
+		return paStreamParameters_.hostApiSpecificStreamInfo;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+} // namespace portaudio

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Exception.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Exception.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Exception.cxx	Fri Sep 21 14:49:14 2007
@@ -1,123 +1,123 @@
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-	// -----------------------------------------------------------------------------------
-	// PaException:
-	// -----------------------------------------------------------------------------------
-
-	//////
-	///  Wraps a PortAudio error into a PortAudioCpp PaException.
-	//////
-	PaException::PaException(PaError error) : error_(error)
-	{
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Alias for paErrorText(), to have std::exception compliance.
-	//////
-	const char *PaException::what() const throw()
-	{
-		return paErrorText();
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Returns the PortAudio error code (PaError).
-	//////
-	PaError PaException::paError() const
-	{
-		return error_;
-	}
-
-	//////
-	/// Returns the error as a (zero-terminated) text string.
-	//////
-	const char *PaException::paErrorText() const
-	{
-		return Pa_GetErrorText(error_);
-	}
-
-	//////
-	/// Returns true is the error is a HostApi error.
-	//////
-	bool PaException::isHostApiError() const
-	{
-		return (error_ == paUnanticipatedHostError);
-	}
-
-	//////
-	/// Returns the last HostApi error (which is the current one if 
-	/// isHostApiError() returns true) as an error code.
-	//////
-	long PaException::lastHostApiError() const
-	{
-		return Pa_GetLastHostErrorInfo()->errorCode;
-	}
-
-	//////
-	/// Returns the last HostApi error (which is the current one if 
-	/// isHostApiError() returns true) as a (zero-terminated) text 
-	/// string, if it's available.
-	//////
-	const char *PaException::lastHostApiErrorText() const
-	{
-		return Pa_GetLastHostErrorInfo()->errorText;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	bool PaException::operator==(const PaException &rhs) const
-	{
-		return (error_ == rhs.error_);
-	}
-
-	bool PaException::operator!=(const PaException &rhs) const
-	{
-		return !(*this == rhs);
-	}
-
-	// -----------------------------------------------------------------------------------
-	// PaCppException:
-	// -----------------------------------------------------------------------------------
-	
-	PaCppException::PaCppException(ExceptionSpecifier specifier) : specifier_(specifier)
-	{
-	}
-
-	const char *PaCppException::what() const throw()
-	{
-		switch (specifier_)
-		{
-			case UNABLE_TO_ADAPT_DEVICE:
-			{
-				return "Unable to adapt the given device to the specified host api specific device extension";
-			}
-		}
-
-		return "Unknown exception";
-	}
-
-	PaCppException::ExceptionSpecifier PaCppException::specifier() const
-	{
-		return specifier_;
-	}
-
-	bool PaCppException::operator==(const PaCppException &rhs) const
-	{
-		return (specifier_ == rhs.specifier_);
-	}
-
-	bool PaCppException::operator!=(const PaCppException &rhs) const
-	{
-		return !(*this == rhs);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-} // namespace portaudio
-
-
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+	// -----------------------------------------------------------------------------------
+	// PaException:
+	// -----------------------------------------------------------------------------------
+
+	//////
+	///  Wraps a PortAudio error into a PortAudioCpp PaException.
+	//////
+	PaException::PaException(PaError error) : error_(error)
+	{
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Alias for paErrorText(), to have std::exception compliance.
+	//////
+	const char *PaException::what() const throw()
+	{
+		return paErrorText();
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Returns the PortAudio error code (PaError).
+	//////
+	PaError PaException::paError() const
+	{
+		return error_;
+	}
+
+	//////
+	/// Returns the error as a (zero-terminated) text string.
+	//////
+	const char *PaException::paErrorText() const
+	{
+		return Pa_GetErrorText(error_);
+	}
+
+	//////
+	/// Returns true is the error is a HostApi error.
+	//////
+	bool PaException::isHostApiError() const
+	{
+		return (error_ == paUnanticipatedHostError);
+	}
+
+	//////
+	/// Returns the last HostApi error (which is the current one if 
+	/// isHostApiError() returns true) as an error code.
+	//////
+	long PaException::lastHostApiError() const
+	{
+		return Pa_GetLastHostErrorInfo()->errorCode;
+	}
+
+	//////
+	/// Returns the last HostApi error (which is the current one if 
+	/// isHostApiError() returns true) as a (zero-terminated) text 
+	/// string, if it's available.
+	//////
+	const char *PaException::lastHostApiErrorText() const
+	{
+		return Pa_GetLastHostErrorInfo()->errorText;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	bool PaException::operator==(const PaException &rhs) const
+	{
+		return (error_ == rhs.error_);
+	}
+
+	bool PaException::operator!=(const PaException &rhs) const
+	{
+		return !(*this == rhs);
+	}
+
+	// -----------------------------------------------------------------------------------
+	// PaCppException:
+	// -----------------------------------------------------------------------------------
+	
+	PaCppException::PaCppException(ExceptionSpecifier specifier) : specifier_(specifier)
+	{
+	}
+
+	const char *PaCppException::what() const throw()
+	{
+		switch (specifier_)
+		{
+			case UNABLE_TO_ADAPT_DEVICE:
+			{
+				return "Unable to adapt the given device to the specified host api specific device extension";
+			}
+		}
+
+		return "Unknown exception";
+	}
+
+	PaCppException::ExceptionSpecifier PaCppException::specifier() const
+	{
+		return specifier_;
+	}
+
+	bool PaCppException::operator==(const PaCppException &rhs) const
+	{
+		return (specifier_ == rhs.specifier_);
+	}
+
+	bool PaCppException::operator!=(const PaCppException &rhs) const
+	{
+		return !(*this == rhs);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+} // namespace portaudio
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/HostApi.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/HostApi.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/HostApi.cxx	Fri Sep 21 14:49:14 2007
@@ -1,121 +1,121 @@
-#include "portaudiocpp/HostApi.hxx"
-
-#include "portaudiocpp/System.hxx"
-#include "portaudiocpp/Device.hxx"
-#include "portaudiocpp/SystemDeviceIterator.hxx"
-#include "portaudiocpp/Exception.hxx"
-
-namespace portaudio
-{
-
-	// -----------------------------------------------------------------------------------
-
-	HostApi::HostApi(PaHostApiIndex index) : devices_(NULL)
-	{
-		try
-		{
-			info_ = Pa_GetHostApiInfo(index);
-
-			// Create and populate devices array:
-			int numDevices = deviceCount();
-
-			devices_ = new Device*[numDevices];
-
-			for (int i = 0; i < numDevices; ++i)
-			{
-				PaDeviceIndex deviceIndex = Pa_HostApiDeviceIndexToDeviceIndex(index, i);
-
-				if (deviceIndex < 0)
-				{
-					throw PaException(deviceIndex);
-				}
-
-				devices_[i] = &System::instance().deviceByIndex(deviceIndex);
-			}
-		}
-		catch (const std::exception &e)
-		{
-			// Delete any (partially) constructed objects (deconstructor isn't called):
-			delete[] devices_; // devices_ is either NULL or valid
-
-			// Re-throw exception:
-			throw e;
-		}
-	}
-
-	HostApi::~HostApi()
-	{
-		// Destroy devices array:
-		delete[] devices_;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	PaHostApiTypeId HostApi::typeId() const
-	{
-		return info_->type;
-	}
-
-	PaHostApiIndex HostApi::index() const
-	{
-		PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(typeId());
-
-		if (index < 0)
-			throw PaException(index);
-
-		return index;
-	}
-
-	const char *HostApi::name() const
-	{
-		return info_->name;
-	}
-
-	int HostApi::deviceCount() const
-	{
-		return info_->deviceCount;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	HostApi::DeviceIterator HostApi::devicesBegin()
-	{
-		DeviceIterator tmp;
-		tmp.ptr_ = &devices_[0]; // begin (first element)
-		return tmp;
-	}
-
-	HostApi::DeviceIterator HostApi::devicesEnd()
-	{
-		DeviceIterator tmp;
-		tmp.ptr_ = &devices_[deviceCount()]; // end (one past last element)
-		return tmp;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	Device &HostApi::defaultInputDevice() const
-	{
-		return System::instance().deviceByIndex(info_->defaultInputDevice);
-	}
-
-	Device &HostApi::defaultOutputDevice() const
-	{
-		return System::instance().deviceByIndex(info_->defaultOutputDevice);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	bool HostApi::operator==(const HostApi &rhs) const
-	{
-		return (typeId() == rhs.typeId());
-	}
-
-	bool HostApi::operator!=(const HostApi &rhs) const
-	{
-		return !(*this == rhs);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-} // namespace portaudio
+#include "portaudiocpp/HostApi.hxx"
+
+#include "portaudiocpp/System.hxx"
+#include "portaudiocpp/Device.hxx"
+#include "portaudiocpp/SystemDeviceIterator.hxx"
+#include "portaudiocpp/Exception.hxx"
+
+namespace portaudio
+{
+
+	// -----------------------------------------------------------------------------------
+
+	HostApi::HostApi(PaHostApiIndex index) : devices_(NULL)
+	{
+		try
+		{
+			info_ = Pa_GetHostApiInfo(index);
+
+			// Create and populate devices array:
+			int numDevices = deviceCount();
+
+			devices_ = new Device*[numDevices];
+
+			for (int i = 0; i < numDevices; ++i)
+			{
+				PaDeviceIndex deviceIndex = Pa_HostApiDeviceIndexToDeviceIndex(index, i);
+
+				if (deviceIndex < 0)
+				{
+					throw PaException(deviceIndex);
+				}
+
+				devices_[i] = &System::instance().deviceByIndex(deviceIndex);
+			}
+		}
+		catch (const std::exception &e)
+		{
+			// Delete any (partially) constructed objects (deconstructor isn't called):
+			delete[] devices_; // devices_ is either NULL or valid
+
+			// Re-throw exception:
+			throw e;
+		}
+	}
+
+	HostApi::~HostApi()
+	{
+		// Destroy devices array:
+		delete[] devices_;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	PaHostApiTypeId HostApi::typeId() const
+	{
+		return info_->type;
+	}
+
+	PaHostApiIndex HostApi::index() const
+	{
+		PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(typeId());
+
+		if (index < 0)
+			throw PaException(index);
+
+		return index;
+	}
+
+	const char *HostApi::name() const
+	{
+		return info_->name;
+	}
+
+	int HostApi::deviceCount() const
+	{
+		return info_->deviceCount;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	HostApi::DeviceIterator HostApi::devicesBegin()
+	{
+		DeviceIterator tmp;
+		tmp.ptr_ = &devices_[0]; // begin (first element)
+		return tmp;
+	}
+
+	HostApi::DeviceIterator HostApi::devicesEnd()
+	{
+		DeviceIterator tmp;
+		tmp.ptr_ = &devices_[deviceCount()]; // end (one past last element)
+		return tmp;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	Device &HostApi::defaultInputDevice() const
+	{
+		return System::instance().deviceByIndex(info_->defaultInputDevice);
+	}
+
+	Device &HostApi::defaultOutputDevice() const
+	{
+		return System::instance().deviceByIndex(info_->defaultOutputDevice);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	bool HostApi::operator==(const HostApi &rhs) const
+	{
+		return (typeId() == rhs.typeId());
+	}
+
+	bool HostApi::operator!=(const HostApi &rhs) const
+	{
+		return !(*this == rhs);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+} // namespace portaudio

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,45 +1,45 @@
-#include "portaudiocpp/InterfaceCallbackStream.hxx"
-
-#include "portaudiocpp/StreamParameters.hxx"
-#include "portaudiocpp/Exception.hxx"
-#include "portaudiocpp/CallbackInterface.hxx"
-
-namespace portaudio
-{
-
-	// ---------------------------------------------------------------------------------==
-
-	InterfaceCallbackStream::InterfaceCallbackStream()
-	{
-	}
-
-	InterfaceCallbackStream::InterfaceCallbackStream(const StreamParameters &parameters, CallbackInterface &instance)
-	{
-		open(parameters, instance);
-	}
-
-	InterfaceCallbackStream::~InterfaceCallbackStream()
-	{
-		try
-		{
-			close();
-		}
-		catch (...)
-		{
-			// ignore all errors
-		}
-	}
-
-	// ---------------------------------------------------------------------------------==
-
-	void InterfaceCallbackStream::open(const StreamParameters &parameters, CallbackInterface &instance)
-	{
-		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
-			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter, static_cast<void *>(&instance));
-
-		if (err != paNoError)
-		{
-			throw PaException(err);
-		}
-	}
-}
+#include "portaudiocpp/InterfaceCallbackStream.hxx"
+
+#include "portaudiocpp/StreamParameters.hxx"
+#include "portaudiocpp/Exception.hxx"
+#include "portaudiocpp/CallbackInterface.hxx"
+
+namespace portaudio
+{
+
+	// ---------------------------------------------------------------------------------==
+
+	InterfaceCallbackStream::InterfaceCallbackStream()
+	{
+	}
+
+	InterfaceCallbackStream::InterfaceCallbackStream(const StreamParameters &parameters, CallbackInterface &instance)
+	{
+		open(parameters, instance);
+	}
+
+	InterfaceCallbackStream::~InterfaceCallbackStream()
+	{
+		try
+		{
+			close();
+		}
+		catch (...)
+		{
+			// ignore all errors
+		}
+	}
+
+	// ---------------------------------------------------------------------------------==
+
+	void InterfaceCallbackStream::open(const StreamParameters &parameters, CallbackInterface &instance)
+	{
+		PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
+			parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter, static_cast<void *>(&instance));
+
+		if (err != paNoError)
+		{
+			throw PaException(err);
+		}
+	}
+}

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/MemFunCallbackStream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,4 +1,4 @@
-#include "portaudiocpp/MemFunCallbackStream.hxx"
-
-// (... template class ...)
-
+#include "portaudiocpp/MemFunCallbackStream.hxx"
+
+// (... template class ...)
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Stream.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Stream.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/Stream.cxx	Fri Sep 21 14:49:14 2007
@@ -1,195 +1,195 @@
-#include "portaudiocpp/Stream.hxx"
-
-#include <cstddef>
-
-#include "portaudiocpp/Exception.hxx"
-#include "portaudiocpp/System.hxx"
-
-namespace portaudio
-{
-
-	// -----------------------------------------------------------------------------------
-
-	Stream::Stream() : stream_(NULL)
-	{
-	}
-
-	Stream::~Stream()
-	{
-		// (can't call close here, 
-		// the derived class should atleast call 
-		// close() in it's deconstructor)
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Closes the Stream if it's open, else does nothing.
-	//////
-	void Stream::close()
-	{
-		if (isOpen() && System::exists())
-		{
-			PaError err = Pa_CloseStream(stream_);
-			stream_ = NULL;
-
-			if (err != paNoError)
-				throw PaException(err);
-		}
-	}
-
-	//////
-	/// Returns true if the Stream is open.
-	//////
-	bool Stream::isOpen() const
-	{
-		return (stream_ != NULL);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	void Stream::setStreamFinishedCallback(PaStreamFinishedCallback *callback)
-	{
-		PaError err = Pa_SetStreamFinishedCallback(stream_, callback);
-
-		if (err != paNoError)
-			throw PaException(err);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	void Stream::start()
-	{
-		PaError err = Pa_StartStream(stream_);
-
-		if (err != paNoError)
-			throw PaException(err);
-	}
-
-	void Stream::stop()
-	{
-		PaError err = Pa_StopStream(stream_);
-
-		if (err != paNoError)
-			throw PaException(err);
-	}
-
-	void Stream::abort()
-	{
-		PaError err = Pa_AbortStream(stream_);
-
-		if (err != paNoError)
-			throw PaException(err);
-	}
-
-	bool Stream::isStopped() const
-	{
-		PaError ret = Pa_IsStreamStopped(stream_);
-
-		if (ret < 0)
-			throw PaException(ret);
-
-		return (ret == 1);
-	}
-
-	bool Stream::isActive() const
-	{
-		PaError ret = Pa_IsStreamActive(stream_);
-
-		if (ret < 0)
-			throw PaException(ret);
-
-		return (ret == 1);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Returns the best known input latency for the Stream. This value may differ from the 
-	/// suggested input latency set in the StreamParameters. Includes all sources of 
-	/// latency known to PortAudio such as internal buffering, and Host API reported latency. 
-	/// Doesn't include any estimates of unknown latency.
-	//////
-	PaTime Stream::inputLatency() const
-	{
-		const PaStreamInfo *info = Pa_GetStreamInfo(stream_);
-		if (info == NULL)
-		{
-			throw PaException(paInternalError);
-			return PaTime(0.0);
-		}
-
-		return info->inputLatency;
-	}
-
-	//////
-	/// Returns the best known output latency for the Stream. This value may differ from the 
-	/// suggested output latency set in the StreamParameters. Includes all sources of 
-	/// latency known to PortAudio such as internal buffering, and Host API reported latency. 
-	/// Doesn't include any estimates of unknown latency.
-	//////
-	PaTime Stream::outputLatency() const
-	{
-		const PaStreamInfo *info = Pa_GetStreamInfo(stream_);
-		if (info == NULL)
-		{
-			throw PaException(paInternalError);
-			return PaTime(0.0);
-		}
-
-		return info->outputLatency;
-	}
-
-	//////
-	/// Returns the sample rate of the Stream. Usually this will be the 
-	/// best known estimate of the used sample rate. For instance when opening a 
-	/// Stream setting 44100.0 Hz in the StreamParameters, the actual sample 
-	/// rate might be something like 44103.2 Hz (due to imperfections in the 
-	/// sound card hardware).
-	//////
-	double Stream::sampleRate() const
-	{
-		const PaStreamInfo *info = Pa_GetStreamInfo(stream_);
-		if (info == NULL)
-		{
-			throw PaException(paInternalError);
-			return 0.0;
-		}
-
-		return info->sampleRate;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	PaTime Stream::time() const
-	{
-		return Pa_GetStreamTime(stream_);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Accessor (const) for PortAudio PaStream pointer, useful for interfacing with 
-	/// PortAudio add-ons such as PortMixer for instance. Normally accessing this 
-	/// pointer should not be needed as PortAudioCpp aims to provide all of PortAudio's 
-	/// functionality.
-	//////
-	const PaStream *Stream::paStream() const
-	{
-		return stream_;
-	}
-
-	//////
-	/// Accessor (non-const) for PortAudio PaStream pointer, useful for interfacing with 
-	/// PortAudio add-ons such as PortMixer for instance. Normally accessing this 
-	/// pointer should not be needed as PortAudioCpp aims to provide all of PortAudio's 
-	/// functionality.
-	//////
-	PaStream *Stream::paStream()
-	{
-		return stream_;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-} // namespace portaudio
+#include "portaudiocpp/Stream.hxx"
+
+#include <cstddef>
+
+#include "portaudiocpp/Exception.hxx"
+#include "portaudiocpp/System.hxx"
+
+namespace portaudio
+{
+
+	// -----------------------------------------------------------------------------------
+
+	Stream::Stream() : stream_(NULL)
+	{
+	}
+
+	Stream::~Stream()
+	{
+		// (can't call close here, 
+		// the derived class should atleast call 
+		// close() in it's deconstructor)
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Closes the Stream if it's open, else does nothing.
+	//////
+	void Stream::close()
+	{
+		if (isOpen() && System::exists())
+		{
+			PaError err = Pa_CloseStream(stream_);
+			stream_ = NULL;
+
+			if (err != paNoError)
+				throw PaException(err);
+		}
+	}
+
+	//////
+	/// Returns true if the Stream is open.
+	//////
+	bool Stream::isOpen() const
+	{
+		return (stream_ != NULL);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	void Stream::setStreamFinishedCallback(PaStreamFinishedCallback *callback)
+	{
+		PaError err = Pa_SetStreamFinishedCallback(stream_, callback);
+
+		if (err != paNoError)
+			throw PaException(err);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	void Stream::start()
+	{
+		PaError err = Pa_StartStream(stream_);
+
+		if (err != paNoError)
+			throw PaException(err);
+	}
+
+	void Stream::stop()
+	{
+		PaError err = Pa_StopStream(stream_);
+
+		if (err != paNoError)
+			throw PaException(err);
+	}
+
+	void Stream::abort()
+	{
+		PaError err = Pa_AbortStream(stream_);
+
+		if (err != paNoError)
+			throw PaException(err);
+	}
+
+	bool Stream::isStopped() const
+	{
+		PaError ret = Pa_IsStreamStopped(stream_);
+
+		if (ret < 0)
+			throw PaException(ret);
+
+		return (ret == 1);
+	}
+
+	bool Stream::isActive() const
+	{
+		PaError ret = Pa_IsStreamActive(stream_);
+
+		if (ret < 0)
+			throw PaException(ret);
+
+		return (ret == 1);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Returns the best known input latency for the Stream. This value may differ from the 
+	/// suggested input latency set in the StreamParameters. Includes all sources of 
+	/// latency known to PortAudio such as internal buffering, and Host API reported latency. 
+	/// Doesn't include any estimates of unknown latency.
+	//////
+	PaTime Stream::inputLatency() const
+	{
+		const PaStreamInfo *info = Pa_GetStreamInfo(stream_);
+		if (info == NULL)
+		{
+			throw PaException(paInternalError);
+			return PaTime(0.0);
+		}
+
+		return info->inputLatency;
+	}
+
+	//////
+	/// Returns the best known output latency for the Stream. This value may differ from the 
+	/// suggested output latency set in the StreamParameters. Includes all sources of 
+	/// latency known to PortAudio such as internal buffering, and Host API reported latency. 
+	/// Doesn't include any estimates of unknown latency.
+	//////
+	PaTime Stream::outputLatency() const
+	{
+		const PaStreamInfo *info = Pa_GetStreamInfo(stream_);
+		if (info == NULL)
+		{
+			throw PaException(paInternalError);
+			return PaTime(0.0);
+		}
+
+		return info->outputLatency;
+	}
+
+	//////
+	/// Returns the sample rate of the Stream. Usually this will be the 
+	/// best known estimate of the used sample rate. For instance when opening a 
+	/// Stream setting 44100.0 Hz in the StreamParameters, the actual sample 
+	/// rate might be something like 44103.2 Hz (due to imperfections in the 
+	/// sound card hardware).
+	//////
+	double Stream::sampleRate() const
+	{
+		const PaStreamInfo *info = Pa_GetStreamInfo(stream_);
+		if (info == NULL)
+		{
+			throw PaException(paInternalError);
+			return 0.0;
+		}
+
+		return info->sampleRate;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	PaTime Stream::time() const
+	{
+		return Pa_GetStreamTime(stream_);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Accessor (const) for PortAudio PaStream pointer, useful for interfacing with 
+	/// PortAudio add-ons such as PortMixer for instance. Normally accessing this 
+	/// pointer should not be needed as PortAudioCpp aims to provide all of PortAudio's 
+	/// functionality.
+	//////
+	const PaStream *Stream::paStream() const
+	{
+		return stream_;
+	}
+
+	//////
+	/// Accessor (non-const) for PortAudio PaStream pointer, useful for interfacing with 
+	/// PortAudio add-ons such as PortMixer for instance. Normally accessing this 
+	/// pointer should not be needed as PortAudioCpp aims to provide all of PortAudio's 
+	/// functionality.
+	//////
+	PaStream *Stream::paStream()
+	{
+		return stream_;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+} // namespace portaudio

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/StreamParameters.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/StreamParameters.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/StreamParameters.cxx	Fri Sep 21 14:49:14 2007
@@ -1,165 +1,165 @@
-#include "portaudiocpp/StreamParameters.hxx"
-
-#include <cstddef>
-
-#include "portaudiocpp/Device.hxx"
-
-namespace portaudio
-{
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Default constructor; does nothing.
-	//////
-	StreamParameters::StreamParameters()
-	{
-	}
-
-	//////
-	/// Sets up the all parameters needed to open either a half-duplex or full-duplex Stream.
-	///
-	/// @param inputParameters The parameters for the input direction of the to-be opened 
-	/// Stream or DirectionSpecificStreamParameters::null() for an output-only Stream.
-	/// @param outputParameters The parameters for the output direction of the to-be opened
-	/// Stream or DirectionSpecificStreamParameters::null() for an input-only Stream.
-	/// @param sampleRate The to-be opened Stream's sample rate in Hz.
-	/// @param framesPerBuffer The number of frames per buffer for a CallbackStream, or 
-	/// the preferred buffer granularity for a BlockingStream.
-	/// @param flags The flags for the to-be opened Stream; default paNoFlag.
-	//////
-	StreamParameters::StreamParameters(const DirectionSpecificStreamParameters &inputParameters, 
-		const DirectionSpecificStreamParameters &outputParameters, double sampleRate, unsigned long framesPerBuffer, 
-		PaStreamFlags flags) : inputParameters_(inputParameters), outputParameters_(outputParameters), 
-		sampleRate_(sampleRate), framesPerBuffer_(framesPerBuffer), flags_(flags)
-	{
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	//////
-	/// Sets the requested sample rate. If this sample rate isn't supported by the hardware, the 
-	/// Stream will fail to open. The real-life sample rate used might differ slightly due to 
-	/// imperfections in the sound card hardware; use Stream::sampleRate() to retreive the 
-	/// best known estimate for this value.
-	//////
-	void StreamParameters::setSampleRate(double sampleRate)
-	{
-		sampleRate_ = sampleRate;
-	}
-
-	//////
-	/// Either the number of frames per buffer for a CallbackStream, or 
-	/// the preferred buffer granularity for a BlockingStream. See PortAudio 
-	/// documentation.
-	//////
-	void StreamParameters::setFramesPerBuffer(unsigned long framesPerBuffer)
-	{
-		framesPerBuffer_ = framesPerBuffer;
-	}
-
-	//////
-	/// Sets the specified flag or does nothing when the flag is already set. Doesn't 
-	/// `unset' any previously existing flags (use clearFlags() for that).
-	//////
-	void StreamParameters::setFlag(PaStreamFlags flag)
-	{
-		flags_ |= flag;
-	}
-
-	//////
-	/// Unsets the specified flag or does nothing if the flag isn't set. Doesn't affect 
-	/// any other flags.
-	//////
-	void StreamParameters::unsetFlag(PaStreamFlags flag)
-	{
-		flags_ &= ~flag;
-	}
-
-	//////
-	/// Clears or `unsets' all set flags.
-	//////
-	void StreamParameters::clearFlags()
-	{
-		flags_ = paNoFlag;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	void StreamParameters::setInputParameters(const DirectionSpecificStreamParameters &parameters)
-	{
-		inputParameters_ = parameters;
-	}
-
-	void StreamParameters::setOutputParameters(const DirectionSpecificStreamParameters &parameters)
-	{
-		outputParameters_ = parameters;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	bool StreamParameters::isSupported() const
-	{
-		return (Pa_IsFormatSupported(inputParameters_.paStreamParameters(), 
-			outputParameters_.paStreamParameters(), sampleRate_) == paFormatIsSupported);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	double StreamParameters::sampleRate() const
-	{
-		return sampleRate_;
-	}
-
-	unsigned long StreamParameters::framesPerBuffer() const
-	{
-		return framesPerBuffer_;
-	}
-
-	//////
-	/// Returns all currently set flags as a binary combined 
-	/// integer value (PaStreamFlags). Use isFlagSet() to 
-	/// avoid dealing with the bitmasks.
-	//////
-	PaStreamFlags StreamParameters::flags() const
-	{
-		return flags_;
-	}
-
-	//////
-	/// Returns true if the specified flag is currently set 
-	/// or false if it isn't.
-	//////
-	bool StreamParameters::isFlagSet(PaStreamFlags flag) const
-	{
-		return ((flags_ & flag) != 0);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	DirectionSpecificStreamParameters &StreamParameters::inputParameters()
-	{
-		return inputParameters_;
-	}
-
-	const DirectionSpecificStreamParameters &StreamParameters::inputParameters() const
-	{
-		return inputParameters_;
-	}
-
-	DirectionSpecificStreamParameters &StreamParameters::outputParameters()
-	{
-		return outputParameters_;
-	}
-
-	const DirectionSpecificStreamParameters &StreamParameters::outputParameters() const
-	{
-		return outputParameters_;
-	}
-
-	// -----------------------------------------------------------------------------------
-} // namespace portaudio
-
-
-
-
-
+#include "portaudiocpp/StreamParameters.hxx"
+
+#include <cstddef>
+
+#include "portaudiocpp/Device.hxx"
+
+namespace portaudio
+{
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Default constructor; does nothing.
+	//////
+	StreamParameters::StreamParameters()
+	{
+	}
+
+	//////
+	/// Sets up the all parameters needed to open either a half-duplex or full-duplex Stream.
+	///
+	/// @param inputParameters The parameters for the input direction of the to-be opened 
+	/// Stream or DirectionSpecificStreamParameters::null() for an output-only Stream.
+	/// @param outputParameters The parameters for the output direction of the to-be opened
+	/// Stream or DirectionSpecificStreamParameters::null() for an input-only Stream.
+	/// @param sampleRate The to-be opened Stream's sample rate in Hz.
+	/// @param framesPerBuffer The number of frames per buffer for a CallbackStream, or 
+	/// the preferred buffer granularity for a BlockingStream.
+	/// @param flags The flags for the to-be opened Stream; default paNoFlag.
+	//////
+	StreamParameters::StreamParameters(const DirectionSpecificStreamParameters &inputParameters, 
+		const DirectionSpecificStreamParameters &outputParameters, double sampleRate, unsigned long framesPerBuffer, 
+		PaStreamFlags flags) : inputParameters_(inputParameters), outputParameters_(outputParameters), 
+		sampleRate_(sampleRate), framesPerBuffer_(framesPerBuffer), flags_(flags)
+	{
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	//////
+	/// Sets the requested sample rate. If this sample rate isn't supported by the hardware, the 
+	/// Stream will fail to open. The real-life sample rate used might differ slightly due to 
+	/// imperfections in the sound card hardware; use Stream::sampleRate() to retreive the 
+	/// best known estimate for this value.
+	//////
+	void StreamParameters::setSampleRate(double sampleRate)
+	{
+		sampleRate_ = sampleRate;
+	}
+
+	//////
+	/// Either the number of frames per buffer for a CallbackStream, or 
+	/// the preferred buffer granularity for a BlockingStream. See PortAudio 
+	/// documentation.
+	//////
+	void StreamParameters::setFramesPerBuffer(unsigned long framesPerBuffer)
+	{
+		framesPerBuffer_ = framesPerBuffer;
+	}
+
+	//////
+	/// Sets the specified flag or does nothing when the flag is already set. Doesn't 
+	/// `unset' any previously existing flags (use clearFlags() for that).
+	//////
+	void StreamParameters::setFlag(PaStreamFlags flag)
+	{
+		flags_ |= flag;
+	}
+
+	//////
+	/// Unsets the specified flag or does nothing if the flag isn't set. Doesn't affect 
+	/// any other flags.
+	//////
+	void StreamParameters::unsetFlag(PaStreamFlags flag)
+	{
+		flags_ &= ~flag;
+	}
+
+	//////
+	/// Clears or `unsets' all set flags.
+	//////
+	void StreamParameters::clearFlags()
+	{
+		flags_ = paNoFlag;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	void StreamParameters::setInputParameters(const DirectionSpecificStreamParameters &parameters)
+	{
+		inputParameters_ = parameters;
+	}
+
+	void StreamParameters::setOutputParameters(const DirectionSpecificStreamParameters &parameters)
+	{
+		outputParameters_ = parameters;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	bool StreamParameters::isSupported() const
+	{
+		return (Pa_IsFormatSupported(inputParameters_.paStreamParameters(), 
+			outputParameters_.paStreamParameters(), sampleRate_) == paFormatIsSupported);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	double StreamParameters::sampleRate() const
+	{
+		return sampleRate_;
+	}
+
+	unsigned long StreamParameters::framesPerBuffer() const
+	{
+		return framesPerBuffer_;
+	}
+
+	//////
+	/// Returns all currently set flags as a binary combined 
+	/// integer value (PaStreamFlags). Use isFlagSet() to 
+	/// avoid dealing with the bitmasks.
+	//////
+	PaStreamFlags StreamParameters::flags() const
+	{
+		return flags_;
+	}
+
+	//////
+	/// Returns true if the specified flag is currently set 
+	/// or false if it isn't.
+	//////
+	bool StreamParameters::isFlagSet(PaStreamFlags flag) const
+	{
+		return ((flags_ & flag) != 0);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	DirectionSpecificStreamParameters &StreamParameters::inputParameters()
+	{
+		return inputParameters_;
+	}
+
+	const DirectionSpecificStreamParameters &StreamParameters::inputParameters() const
+	{
+		return inputParameters_;
+	}
+
+	DirectionSpecificStreamParameters &StreamParameters::outputParameters()
+	{
+		return outputParameters_;
+	}
+
+	const DirectionSpecificStreamParameters &StreamParameters::outputParameters() const
+	{
+		return outputParameters_;
+	}
+
+	// -----------------------------------------------------------------------------------
+} // namespace portaudio
+
+
+
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/System.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/System.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/System.cxx	Fri Sep 21 14:49:14 2007
@@ -1,308 +1,308 @@
-#include "portaudiocpp/System.hxx"
-
-#include <cstddef>
-#include <cassert>
-
-#include "portaudiocpp/HostApi.hxx"
-#include "portaudiocpp/Device.hxx"
-#include "portaudiocpp/Stream.hxx"
-#include "portaudiocpp/Exception.hxx"
-#include "portaudiocpp/SystemHostApiIterator.hxx"
-#include "portaudiocpp/SystemDeviceIterator.hxx"
-
-namespace portaudio
-{
-	// -----------------------------------------------------------------------------------
-
-	// Static members:
-	System *System::instance_ = NULL;
-	int System::initCount_ = 0;
-	HostApi **System::hostApis_ = NULL;
-	Device **System::devices_ = NULL;
-	Device *System::nullDevice_ = NULL;
-
-	// -----------------------------------------------------------------------------------
-
-	int System::version()
-	{
-		return Pa_GetVersion();
-	}
-
-	const char *System::versionText()
-	{
-		return Pa_GetVersionText();
-	}
-
-	void System::initialize()
-	{
-		++initCount_;
-
-		if (initCount_ == 1)
-		{
-			// Create singleton:
-			assert(instance_ == NULL);
-			instance_ = new System();
-
-			// Initialize the PortAudio system:
-			{
-				PaError err = Pa_Initialize();
-
-				if (err != paNoError)
-					throw PaException(err);
-			}
-
-			// Create and populate device array:
-			{
-				int numDevices = instance().deviceCount();
-
-				devices_ = new Device*[numDevices];
-
-				for (int i = 0; i < numDevices; ++i)
-					devices_[i] = new Device(i);
-			}
-
-			// Create and populate host api array:
-			{
-				int numHostApis = instance().hostApiCount();
-
-				hostApis_ = new HostApi*[numHostApis];
-
-				for (int i = 0; i < numHostApis; ++i)
-					hostApis_[i] = new HostApi(i);
-			}
-			
-			// Create null device:
-			nullDevice_ = new Device(paNoDevice);
-		}
-	}
-
-	void System::terminate()
-	{
-		PaError err = paNoError;
-
-		if (initCount_ == 1)
-		{
-			// Destroy null device:
-			delete nullDevice_;
-
-			// Destroy host api array:
-			{
-				if (hostApis_ != NULL)
-				{
-					int numHostApis = instance().hostApiCount();
-
-					for (int i = 0; i < numHostApis; ++i)
-						delete hostApis_[i];
-
-					delete[] hostApis_;
-					hostApis_ = NULL;
-				}
-			}
-
-			// Destroy device array:
-			{
-				if (devices_ != NULL)
-				{
-					int numDevices = instance().deviceCount();
-
-					for (int i = 0; i < numDevices; ++i)
-						delete devices_[i];
-
-					delete[] devices_;
-					devices_ = NULL;
-				}
-			}
-
-			// Terminate the PortAudio system:
-			assert(instance_ != NULL);
-			err = Pa_Terminate();
-
-			// Destroy singleton:
-			delete instance_;
-			instance_ = NULL;
-		}
-
-		if (initCount_ > 0)
-			--initCount_;
-
-		if (err != paNoError)
-			throw PaException(err);
-	}
-
-
-	System &System::instance()
-	{
-		assert(exists());
-
-		return *instance_;
-	}
-
-	bool System::exists()
-	{
-		return (instance_ != NULL);
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	System::HostApiIterator System::hostApisBegin()
-	{
-		System::HostApiIterator tmp;
-		tmp.ptr_ = &hostApis_[0]; // begin (first element)
-		return tmp;
-	}
-
-	System::HostApiIterator System::hostApisEnd()
-	{
-		int count = hostApiCount();
-
-		System::HostApiIterator tmp;
-		tmp.ptr_ = &hostApis_[count]; // end (one past last element)
-		return tmp;
-	}
-
-	HostApi &System::defaultHostApi()
-	{
-		PaHostApiIndex defaultHostApi = Pa_GetDefaultHostApi();
-
-		if (defaultHostApi < 0)
-			throw PaException(defaultHostApi);
-
-		return *hostApis_[defaultHostApi];
-	}
-
-	HostApi &System::hostApiByTypeId(PaHostApiTypeId type)
-	{
-		PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(type);
-
-		if (index < 0)
-			throw PaException(index);
-
-		return *hostApis_[index];
-	}
-
-	HostApi &System::hostApiByIndex(PaHostApiIndex index)
-	{
-		if (index < 0 || index >= hostApiCount())
-			throw PaException(paInternalError);
-
-		return *hostApis_[index];
-	}
-
-	int System::hostApiCount()
-	{
-		PaHostApiIndex count = Pa_GetHostApiCount();
-
-		if (count < 0)
-			throw PaException(count);
-
-		return count;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	System::DeviceIterator System::devicesBegin()
-	{
-		DeviceIterator tmp;
-		tmp.ptr_ = &devices_[0];
-
-		return tmp;
-	}
-
-	System::DeviceIterator System::devicesEnd()
-	{
-		int count = deviceCount();
-
-		DeviceIterator tmp;
-		tmp.ptr_ = &devices_[count];
-
-		return tmp;
-	}
-
-	//////
-	/// Returns the System's default input Device, or the null Device if none 
-	/// was available.
-	//////
-	Device &System::defaultInputDevice()
-	{
-		PaDeviceIndex index = Pa_GetDefaultInputDevice();
-		return deviceByIndex(index);
-	}
-
-	//////
-	/// Returns the System's default output Device, or the null Device if none 
-	/// was available.
-	//////
-	Device &System::defaultOutputDevice()
-	{
-		PaDeviceIndex index = Pa_GetDefaultOutputDevice();
-		return deviceByIndex(index);
-	}
-
-	//////
-	/// Returns the Device for the given index.
-	/// Will throw a paInternalError equivalent PaException if the given index 
-	/// is out of range.
-	//////
-	Device &System::deviceByIndex(PaDeviceIndex index)
-	{
-		if (index < -1 || index >= deviceCount())
-		{
-			throw PaException(paInternalError);
-		}
-
-		if (index == -1)
-			return System::instance().nullDevice();
-
-		return *devices_[index];
-	}
-
-	int System::deviceCount()
-	{
-		PaDeviceIndex count = Pa_GetDeviceCount();
-
-		if (count < 0)
-			throw PaException(count);
-
-		return count;
-	}
-
-	Device &System::nullDevice()
-	{
-		return *nullDevice_;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	void System::sleep(long msec)
-	{
-		Pa_Sleep(msec);
-	}
-
-	int System::sizeOfSample(PaSampleFormat format)
-	{
-		PaError err = Pa_GetSampleSize(format);
-		if (err < 0)
-		{
-			throw PaException(err);
-			return 0;
-		}
-
-		return err;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	System::System()
-	{
-		// (left blank intentionally)
-	}
-
-	System::~System()
-	{
-		// (left blank intentionally)
-	}
-
-	// -----------------------------------------------------------------------------------
-
-} // namespace portaudio
-
+#include "portaudiocpp/System.hxx"
+
+#include <cstddef>
+#include <cassert>
+
+#include "portaudiocpp/HostApi.hxx"
+#include "portaudiocpp/Device.hxx"
+#include "portaudiocpp/Stream.hxx"
+#include "portaudiocpp/Exception.hxx"
+#include "portaudiocpp/SystemHostApiIterator.hxx"
+#include "portaudiocpp/SystemDeviceIterator.hxx"
+
+namespace portaudio
+{
+	// -----------------------------------------------------------------------------------
+
+	// Static members:
+	System *System::instance_ = NULL;
+	int System::initCount_ = 0;
+	HostApi **System::hostApis_ = NULL;
+	Device **System::devices_ = NULL;
+	Device *System::nullDevice_ = NULL;
+
+	// -----------------------------------------------------------------------------------
+
+	int System::version()
+	{
+		return Pa_GetVersion();
+	}
+
+	const char *System::versionText()
+	{
+		return Pa_GetVersionText();
+	}
+
+	void System::initialize()
+	{
+		++initCount_;
+
+		if (initCount_ == 1)
+		{
+			// Create singleton:
+			assert(instance_ == NULL);
+			instance_ = new System();
+
+			// Initialize the PortAudio system:
+			{
+				PaError err = Pa_Initialize();
+
+				if (err != paNoError)
+					throw PaException(err);
+			}
+
+			// Create and populate device array:
+			{
+				int numDevices = instance().deviceCount();
+
+				devices_ = new Device*[numDevices];
+
+				for (int i = 0; i < numDevices; ++i)
+					devices_[i] = new Device(i);
+			}
+
+			// Create and populate host api array:
+			{
+				int numHostApis = instance().hostApiCount();
+
+				hostApis_ = new HostApi*[numHostApis];
+
+				for (int i = 0; i < numHostApis; ++i)
+					hostApis_[i] = new HostApi(i);
+			}
+			
+			// Create null device:
+			nullDevice_ = new Device(paNoDevice);
+		}
+	}
+
+	void System::terminate()
+	{
+		PaError err = paNoError;
+
+		if (initCount_ == 1)
+		{
+			// Destroy null device:
+			delete nullDevice_;
+
+			// Destroy host api array:
+			{
+				if (hostApis_ != NULL)
+				{
+					int numHostApis = instance().hostApiCount();
+
+					for (int i = 0; i < numHostApis; ++i)
+						delete hostApis_[i];
+
+					delete[] hostApis_;
+					hostApis_ = NULL;
+				}
+			}
+
+			// Destroy device array:
+			{
+				if (devices_ != NULL)
+				{
+					int numDevices = instance().deviceCount();
+
+					for (int i = 0; i < numDevices; ++i)
+						delete devices_[i];
+
+					delete[] devices_;
+					devices_ = NULL;
+				}
+			}
+
+			// Terminate the PortAudio system:
+			assert(instance_ != NULL);
+			err = Pa_Terminate();
+
+			// Destroy singleton:
+			delete instance_;
+			instance_ = NULL;
+		}
+
+		if (initCount_ > 0)
+			--initCount_;
+
+		if (err != paNoError)
+			throw PaException(err);
+	}
+
+
+	System &System::instance()
+	{
+		assert(exists());
+
+		return *instance_;
+	}
+
+	bool System::exists()
+	{
+		return (instance_ != NULL);
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	System::HostApiIterator System::hostApisBegin()
+	{
+		System::HostApiIterator tmp;
+		tmp.ptr_ = &hostApis_[0]; // begin (first element)
+		return tmp;
+	}
+
+	System::HostApiIterator System::hostApisEnd()
+	{
+		int count = hostApiCount();
+
+		System::HostApiIterator tmp;
+		tmp.ptr_ = &hostApis_[count]; // end (one past last element)
+		return tmp;
+	}
+
+	HostApi &System::defaultHostApi()
+	{
+		PaHostApiIndex defaultHostApi = Pa_GetDefaultHostApi();
+
+		if (defaultHostApi < 0)
+			throw PaException(defaultHostApi);
+
+		return *hostApis_[defaultHostApi];
+	}
+
+	HostApi &System::hostApiByTypeId(PaHostApiTypeId type)
+	{
+		PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(type);
+
+		if (index < 0)
+			throw PaException(index);
+
+		return *hostApis_[index];
+	}
+
+	HostApi &System::hostApiByIndex(PaHostApiIndex index)
+	{
+		if (index < 0 || index >= hostApiCount())
+			throw PaException(paInternalError);
+
+		return *hostApis_[index];
+	}
+
+	int System::hostApiCount()
+	{
+		PaHostApiIndex count = Pa_GetHostApiCount();
+
+		if (count < 0)
+			throw PaException(count);
+
+		return count;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	System::DeviceIterator System::devicesBegin()
+	{
+		DeviceIterator tmp;
+		tmp.ptr_ = &devices_[0];
+
+		return tmp;
+	}
+
+	System::DeviceIterator System::devicesEnd()
+	{
+		int count = deviceCount();
+
+		DeviceIterator tmp;
+		tmp.ptr_ = &devices_[count];
+
+		return tmp;
+	}
+
+	//////
+	/// Returns the System's default input Device, or the null Device if none 
+	/// was available.
+	//////
+	Device &System::defaultInputDevice()
+	{
+		PaDeviceIndex index = Pa_GetDefaultInputDevice();
+		return deviceByIndex(index);
+	}
+
+	//////
+	/// Returns the System's default output Device, or the null Device if none 
+	/// was available.
+	//////
+	Device &System::defaultOutputDevice()
+	{
+		PaDeviceIndex index = Pa_GetDefaultOutputDevice();
+		return deviceByIndex(index);
+	}
+
+	//////
+	/// Returns the Device for the given index.
+	/// Will throw a paInternalError equivalent PaException if the given index 
+	/// is out of range.
+	//////
+	Device &System::deviceByIndex(PaDeviceIndex index)
+	{
+		if (index < -1 || index >= deviceCount())
+		{
+			throw PaException(paInternalError);
+		}
+
+		if (index == -1)
+			return System::instance().nullDevice();
+
+		return *devices_[index];
+	}
+
+	int System::deviceCount()
+	{
+		PaDeviceIndex count = Pa_GetDeviceCount();
+
+		if (count < 0)
+			throw PaException(count);
+
+		return count;
+	}
+
+	Device &System::nullDevice()
+	{
+		return *nullDevice_;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	void System::sleep(long msec)
+	{
+		Pa_Sleep(msec);
+	}
+
+	int System::sizeOfSample(PaSampleFormat format)
+	{
+		PaError err = Pa_GetSampleSize(format);
+		if (err < 0)
+		{
+			throw PaException(err);
+			return 0;
+		}
+
+		return err;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	System::System()
+	{
+		// (left blank intentionally)
+	}
+
+	System::~System()
+	{
+		// (left blank intentionally)
+	}
+
+	// -----------------------------------------------------------------------------------
+
+} // namespace portaudio
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx	Fri Sep 21 14:49:14 2007
@@ -1,60 +1,60 @@
-#include "portaudiocpp/SystemDeviceIterator.hxx"
-
-namespace portaudio
-{
-	// -----------------------------------------------------------------------------------
-
-	Device &System::DeviceIterator::operator*() const
-	{
-		return **ptr_;
-	}
-
-	Device *System::DeviceIterator::operator->() const
-	{
-		return &**this;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	System::DeviceIterator &System::DeviceIterator::operator++()
-	{
-		++ptr_;
-		return *this;
-	}
-
-	System::DeviceIterator System::DeviceIterator::operator++(int)
-	{
-		System::DeviceIterator prev = *this;
-		++*this;
-		return prev;
-	}
-
-	System::DeviceIterator &System::DeviceIterator::operator--()
-	{
-		--ptr_;
-		return *this;
-	}
-
-	System::DeviceIterator System::DeviceIterator::operator--(int)
-	{
-		System::DeviceIterator prev = *this;
-		--*this;
-		return prev;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	bool System::DeviceIterator::operator==(const System::DeviceIterator &rhs)
-	{
-		return (ptr_ == rhs.ptr_);
-	}
-
-	bool System::DeviceIterator::operator!=(const System::DeviceIterator &rhs)
-	{
-		return !(*this == rhs);
-	}
-
-	// -----------------------------------------------------------------------------------
-} // namespace portaudio
-
-
+#include "portaudiocpp/SystemDeviceIterator.hxx"
+
+namespace portaudio
+{
+	// -----------------------------------------------------------------------------------
+
+	Device &System::DeviceIterator::operator*() const
+	{
+		return **ptr_;
+	}
+
+	Device *System::DeviceIterator::operator->() const
+	{
+		return &**this;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	System::DeviceIterator &System::DeviceIterator::operator++()
+	{
+		++ptr_;
+		return *this;
+	}
+
+	System::DeviceIterator System::DeviceIterator::operator++(int)
+	{
+		System::DeviceIterator prev = *this;
+		++*this;
+		return prev;
+	}
+
+	System::DeviceIterator &System::DeviceIterator::operator--()
+	{
+		--ptr_;
+		return *this;
+	}
+
+	System::DeviceIterator System::DeviceIterator::operator--(int)
+	{
+		System::DeviceIterator prev = *this;
+		--*this;
+		return prev;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	bool System::DeviceIterator::operator==(const System::DeviceIterator &rhs)
+	{
+		return (ptr_ == rhs.ptr_);
+	}
+
+	bool System::DeviceIterator::operator!=(const System::DeviceIterator &rhs)
+	{
+		return !(*this == rhs);
+	}
+
+	// -----------------------------------------------------------------------------------
+} // namespace portaudio
+
+

Modified: freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx
==============================================================================
--- freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx	(original)
+++ freeswitch/trunk/libs/portaudio/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx	Fri Sep 21 14:49:14 2007
@@ -1,59 +1,59 @@
-#include "portaudiocpp/SystemHostApiIterator.hxx"
-
-namespace portaudio
-{
-	// -----------------------------------------------------------------------------------
-
-	HostApi &System::HostApiIterator::operator*() const
-	{
-		return **ptr_;
-	}
-
-	HostApi *System::HostApiIterator::operator->() const
-	{
-		return &**this;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	System::HostApiIterator &System::HostApiIterator::operator++()
-	{
-		++ptr_;
-		return *this;
-	}
-
-	System::HostApiIterator System::HostApiIterator::operator++(int)
-	{
-		System::HostApiIterator prev = *this;
-		++*this;
-		return prev;
-	}
-
-	System::HostApiIterator &System::HostApiIterator::operator--()
-	{
-		--ptr_;
-		return *this;
-	}
-
-	System::HostApiIterator System::HostApiIterator::operator--(int)
-	{
-		System::HostApiIterator prev = *this;
-		--*this;
-		return prev;
-	}
-
-	// -----------------------------------------------------------------------------------
-
-	bool System::HostApiIterator::operator==(const System::HostApiIterator &rhs)
-	{
-		return (ptr_ == rhs.ptr_);
-	}
-
-	bool System::HostApiIterator::operator!=(const System::HostApiIterator &rhs)
-	{
-		return !(*this == rhs);
-	}
-
-	// -----------------------------------------------------------------------------------
-} // namespace portaudio
-
+#include "portaudiocpp/SystemHostApiIterator.hxx"
+
+namespace portaudio
+{
+	// -----------------------------------------------------------------------------------
+
+	HostApi &System::HostApiIterator::operator*() const
+	{
+		return **ptr_;
+	}
+
+	HostApi *System::HostApiIterator::operator->() const
+	{
+		return &**this;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	System::HostApiIterator &System::HostApiIterator::operator++()
+	{
+		++ptr_;
+		return *this;
+	}
+
+	System::HostApiIterator System::HostApiIterator::operator++(int)
+	{
+		System::HostApiIterator prev = *this;
+		++*this;
+		return prev;
+	}
+
+	System::HostApiIterator &System::HostApiIterator::operator--()
+	{
+		--ptr_;
+		return *this;
+	}
+
+	System::HostApiIterator System::HostApiIterator::operator--(int)
+	{
+		System::HostApiIterator prev = *this;
+		--*this;
+		return prev;
+	}
+
+	// -----------------------------------------------------------------------------------
+
+	bool System::HostApiIterator::operator==(const System::HostApiIterator &rhs)
+	{
+		return (ptr_ == rhs.ptr_);
+	}
+
+	bool System::HostApiIterator::operator!=(const System::HostApiIterator &rhs)
+	{
+		return !(*this == rhs);
+	}
+
+	// -----------------------------------------------------------------------------------
+} // namespace portaudio
+

Modified: freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.c
==============================================================================
--- freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.c	(original)
+++ freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.c	Fri Sep 21 14:49:14 2007
@@ -1,107 +1,107 @@
-/*
- * $Id: pa_log.c $
- * Portable Audio I/O Library Multi-Host API front end
- * Validate function parameters and manage multiple host APIs.
- *
- * Based on the Open Source API proposed by Ross Bencina
- * Copyright (c) 1999-2006 Ross Bencina, Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however,
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
- * license above.
- */
-
-/** @file
- @ingroup common_src
-
- @brief Implements log function.
-
-    PaUtil_SetLogPrintFunction can be user called to replace the provided
-	DefaultLogPrint function, which writes to stderr.
-	One can NOT pass var_args across compiler/dll boundaries as it is not
-	"byte code/abi portable". So the technique used here is to allocate a local
-	a static array, write in it, then callback the user with a pointer to its
-	start.
-
-    @todo Consider allocating strdump using dynamic allocation.
-    @todo Consider reentrancy and possibly corrupted strdump buffer.
-*/
-
-
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "pa_debugprint.h"
-
-
-
-static PaUtilLogCallback userCB=0;
-
-
-void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb)
-{
-    userCB = cb;
-}
-
-/*
- If your platform doesn’t have vsnprintf, you are stuck with a
- VERY dangerous alternative, vsprintf (with no n)
- */
-
-#if (_MSC_VER) && (_MSC_VER < 1400)
-#define VSNPRINTF  _vsnprintf
-#else
-#define VSNPRINTF  vsnprintf
-#endif
-
-#define SIZEDUMP 1024
-
-static char strdump[SIZEDUMP];
-
-void PaUtil_DebugPrint( const char *format, ... )
-{
-
-    if (userCB)
-    {
-        va_list ap;
-        va_start( ap, format );
-        VSNPRINTF( strdump, SIZEDUMP, format, ap );
-        userCB(strdump);
-        va_end( ap ); 
-    }
-    else
-    {
-        va_list ap;
-        va_start( ap, format );
-        vfprintf( stderr, format, ap );
-        va_end( ap );
-        fflush( stderr );
-    }
-
-}
+/*
+ * $Id: pa_log.c $
+ * Portable Audio I/O Library Multi-Host API front end
+ * Validate function parameters and manage multiple host APIs.
+ *
+ * Based on the Open Source API proposed by Ross Bencina
+ * Copyright (c) 1999-2006 Ross Bencina, Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however,
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
+ * license above.
+ */
+
+/** @file
+ @ingroup common_src
+
+ @brief Implements log function.
+
+    PaUtil_SetLogPrintFunction can be user called to replace the provided
+	DefaultLogPrint function, which writes to stderr.
+	One can NOT pass var_args across compiler/dll boundaries as it is not
+	"byte code/abi portable". So the technique used here is to allocate a local
+	a static array, write in it, then callback the user with a pointer to its
+	start.
+
+    @todo Consider allocating strdump using dynamic allocation.
+    @todo Consider reentrancy and possibly corrupted strdump buffer.
+*/
+
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "pa_debugprint.h"
+
+
+
+static PaUtilLogCallback userCB=0;
+
+
+void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb)
+{
+    userCB = cb;
+}
+
+/*
+ If your platform doesn’t have vsnprintf, you are stuck with a
+ VERY dangerous alternative, vsprintf (with no n)
+ */
+
+#if (_MSC_VER) && (_MSC_VER < 1400)
+#define VSNPRINTF  _vsnprintf
+#else
+#define VSNPRINTF  vsnprintf
+#endif
+
+#define SIZEDUMP 1024
+
+static char strdump[SIZEDUMP];
+
+void PaUtil_DebugPrint( const char *format, ... )
+{
+
+    if (userCB)
+    {
+        va_list ap;
+        va_start( ap, format );
+        VSNPRINTF( strdump, SIZEDUMP, format, ap );
+        userCB(strdump);
+        va_end( ap ); 
+    }
+    else
+    {
+        va_list ap;
+        va_start( ap, format );
+        vfprintf( stderr, format, ap );
+        va_end( ap );
+        fflush( stderr );
+    }
+
+}

Modified: freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.h
==============================================================================
--- freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.h	(original)
+++ freeswitch/trunk/libs/portaudio/src/common/pa_debugprint.h	Fri Sep 21 14:49:14 2007
@@ -1,122 +1,122 @@
-#ifndef PA_LOG_H
-#define PA_LOG_H
-/*
- * Log file redirector function
- * Copyright (c) 1999-2006 Ross Bencina, Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however,
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
- * license above.
- */
-
-/** @file
- @ingroup common_src
-*/
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
-
-
-
-void PaUtil_DebugPrint( const char *format, ... );
-
-
-/*
-    The basic format for log messages is described below. If you need to
-    add any log messages, please follow this format.
-
-    Function entry (void function):
-
-        "FunctionName called.\n"
-
-    Function entry (non void function):
-
-        "FunctionName called:\n"
-        "\tParam1Type param1: param1Value\n"
-        "\tParam2Type param2: param2Value\n"      (etc...)
-
-
-    Function exit (no return value):
-
-        "FunctionName returned.\n"
-
-    Function exit (simple return value):
-
-        "FunctionName returned:\n"
-        "\tReturnType: returnValue\n\n"
-
-    If the return type is an error code, the error text is displayed in ()
-
-    If the return type is not an error code, but has taken a special value
-    because an error occurred, then the reason for the error is shown in []
-
-    If the return type is a struct ptr, the struct is dumped.
-
-    See the code below for examples
-*/
-
-/** PA_DEBUG() provides a simple debug message printing facility. The macro
- passes it's argument to a printf-like function called PaUtil_DebugPrint()
- which prints to stderr and always flushes the stream after printing.
- Because preprocessor macros cannot directly accept variable length argument
- lists, calls to the macro must include an additional set of parenthesis, eg:
- PA_DEBUG(("errorno: %d", 1001 ));
-*/
-
-
-#ifdef PA_ENABLE_DEBUG_OUTPUT
-#define PA_DEBUG(x) PaUtil_DebugPrint x ;
-#else
-#define PA_DEBUG(x)
-#endif
-
-
-#ifdef PA_LOG_API_CALLS
-#define PA_LOGAPI(x) PaUtil_DebugPrint x ;
-#else
-#define PA_LOGAPI(x)
-#endif
-
-    
-typedef void (*PaUtilLogCallback ) (const char *log);
-
-/**
-    Install user provided log function
-*/
-void PaUtil_SetDebugPrintFunction(PaUtilLogCallback  cb);
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* PA_LOG_H */
+#ifndef PA_LOG_H
+#define PA_LOG_H
+/*
+ * Log file redirector function
+ * Copyright (c) 1999-2006 Ross Bencina, Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however,
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
+ * license above.
+ */
+
+/** @file
+ @ingroup common_src
+*/
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+
+void PaUtil_DebugPrint( const char *format, ... );
+
+
+/*
+    The basic format for log messages is described below. If you need to
+    add any log messages, please follow this format.
+
+    Function entry (void function):
+
+        "FunctionName called.\n"
+
+    Function entry (non void function):
+
+        "FunctionName called:\n"
+        "\tParam1Type param1: param1Value\n"
+        "\tParam2Type param2: param2Value\n"      (etc...)
+
+
+    Function exit (no return value):
+
+        "FunctionName returned.\n"
+
+    Function exit (simple return value):
+
+        "FunctionName returned:\n"
+        "\tReturnType: returnValue\n\n"
+
+    If the return type is an error code, the error text is displayed in ()
+
+    If the return type is not an error code, but has taken a special value
+    because an error occurred, then the reason for the error is shown in []
+
+    If the return type is a struct ptr, the struct is dumped.
+
+    See the code below for examples
+*/
+
+/** PA_DEBUG() provides a simple debug message printing facility. The macro
+ passes it's argument to a printf-like function called PaUtil_DebugPrint()
+ which prints to stderr and always flushes the stream after printing.
+ Because preprocessor macros cannot directly accept variable length argument
+ lists, calls to the macro must include an additional set of parenthesis, eg:
+ PA_DEBUG(("errorno: %d", 1001 ));
+*/
+
+
+#ifdef PA_ENABLE_DEBUG_OUTPUT
+#define PA_DEBUG(x) PaUtil_DebugPrint x ;
+#else
+#define PA_DEBUG(x)
+#endif
+
+
+#ifdef PA_LOG_API_CALLS
+#define PA_LOGAPI(x) PaUtil_DebugPrint x ;
+#else
+#define PA_LOGAPI(x)
+#endif
+
+    
+typedef void (*PaUtilLogCallback ) (const char *log);
+
+/**
+    Install user provided log function
+*/
+void PaUtil_SetDebugPrintFunction(PaUtilLogCallback  cb);
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* PA_LOG_H */

Modified: freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c
==============================================================================
--- freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c	(original)
+++ freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c	Fri Sep 21 14:49:14 2007
@@ -1,564 +1,564 @@
-/*
- * Implementation of the PortAudio API for Apple AUHAL
- *
- * PortAudio Portable Real-Time Audio Library
- * Latest Version at: http://www.portaudio.com
- *
- * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code.
- * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation)
- *
- * Dominic's code was based on code by Phil Burk, Darren Gibbs,
- * Gord Peters, Stephane Letz, and Greg Pfiel.
- *
- * The following people also deserve acknowledgements:
- *
- * Olivier Tristan for feedback and testing
- * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O
- * interface.
- * 
- *
- * Based on the Open Source API proposed by Ross Bencina
- * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however, 
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
- * license above.
- */
-
-/**
- @file
- @ingroup hostaip_src
-
- This file contains the implementation
- required for blocking I/O. It is separated from pa_mac_core.c simply to ease
- development.
-*/
-
-#include "pa_mac_core_blocking.h"
-#include "pa_mac_core_internal.h"
-#include <assert.h>
-#ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
-# define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
-# define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
-#else
-# include <libkern/OSAtomic.h>
-#endif
-
-/*
- * This fnuction determines the size of a particular sample format.
- * if the format is not recognized, this returns zero.
- */
-static size_t computeSampleSizeFromFormat( PaSampleFormat format )
-{
-   switch( format ) {
-   case paFloat32: return 4;
-   case paInt32: return 4;
-   case paInt24: return 3;
-   case paInt16: return 2;
-   case paInt8: case paUInt8: return 1;
-   default: return 0;
-   }
-}
-
-
-/*
- * Functions for initializing, resetting, and destroying BLIO structures.
- *
- */
-
-/* This should be called with the relevant info when initializing a stream for
-   callback. */
-PaError initializeBlioRingBuffers(
-                                       PaMacBlio *blio,
-                                       PaSampleFormat inputSampleFormat,
-                                       PaSampleFormat outputSampleFormat,
-                                       size_t framesPerBuffer,
-                                       long ringBufferSize,
-                                       int inChan,
-                                       int outChan )
-{
-   void *data;
-   int result;
-
-   /* zeroify things */
-   bzero( blio, sizeof( PaMacBlio ) );
-   /* this is redundant, but the buffers are used to check
-      if the bufffers have been initialized, so we do it explicitly. */
-   blio->inputRingBuffer.buffer = NULL;
-   blio->outputRingBuffer.buffer = NULL;
-
-   /* initialize simple data */
-   blio->inputSampleFormat = inputSampleFormat;
-   blio->inputSampleSize = computeSampleSizeFromFormat(inputSampleFormat);
-   blio->outputSampleFormat = outputSampleFormat;
-   blio->outputSampleSize = computeSampleSizeFromFormat(outputSampleFormat);
-   blio->framesPerBuffer = framesPerBuffer;
-   blio->inChan = inChan;
-   blio->outChan = outChan;
-   blio->statusFlags = 0;
-   blio->errors = paNoError;
-#ifdef PA_MAC_BLIO_MUTEX
-   blio->isInputEmpty = false;
-   blio->isOutputFull = false;
-#endif
-
-   /* setup ring buffers */
-#ifdef PA_MAC_BLIO_MUTEX
-   result = PaMacCore_SetUnixError( pthread_mutex_init(&(blio->inputMutex),NULL), 0 );
-   if( result )
-      goto error;
-   result = UNIX_ERR( pthread_cond_init( &(blio->inputCond), NULL ) );
-   if( result )
-      goto error;
-   result = UNIX_ERR( pthread_mutex_init(&(blio->outputMutex),NULL) );
-   if( result )
-      goto error;
-   result = UNIX_ERR( pthread_cond_init( &(blio->outputCond), NULL ) );
-#endif
-   if( inChan ) {
-      data = calloc( ringBufferSize, blio->inputSampleSize );
-      if( !data )
-      {
-         result = paInsufficientMemory;
-         goto error;
-      }
-
-      assert( 0 == PaUtil_InitializeRingBuffer(
-            &blio->inputRingBuffer,
-            ringBufferSize*blio->inputSampleSize,
-            data ) );
-   }
-   if( outChan ) {
-      data = calloc( ringBufferSize, blio->outputSampleSize );
-      if( !data )
-      {
-         result = paInsufficientMemory;
-         goto error;
-      }
-
-      assert( 0 == PaUtil_InitializeRingBuffer(
-            &blio->outputRingBuffer,
-            ringBufferSize*blio->outputSampleSize,
-            data ) );
-   }
-
-   result = resetBlioRingBuffers( blio );
-   if( result )
-      goto error;
-
-   return 0;
-
- error:
-   destroyBlioRingBuffers( blio );
-   return result;
-}
-
-#ifdef PA_MAC_BLIO_MUTEX
-PaError blioSetIsInputEmpty( PaMacBlio *blio, bool isEmpty )
-{
-   PaError result = paNoError;
-   if( isEmpty == blio->isInputEmpty )
-      goto done;
-
-   /* we need to update the value. Here's what we do:
-    * - Lock the mutex, so noone else can write.
-    * - update the value.
-    * - unlock.
-    * - broadcast to all listeners.
-    */
-   result = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) );
-   if( result )
-      goto done;
-   blio->isInputEmpty = isEmpty;
-   result = UNIX_ERR( pthread_mutex_unlock( &blio->inputMutex ) );
-   if( result )
-      goto done;
-   result = UNIX_ERR( pthread_cond_broadcast( &blio->inputCond ) );
-   if( result )
-      goto done;
-
- done:
-   return result;
-}
-PaError blioSetIsOutputFull( PaMacBlio *blio, bool isFull )
-{
-   PaError result = paNoError;
-   if( isFull == blio->isOutputFull )
-      goto done;
-
-   /* we need to update the value. Here's what we do:
-    * - Lock the mutex, so noone else can write.
-    * - update the value.
-    * - unlock.
-    * - broadcast to all listeners.
-    */
-   result = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) );
-   if( result )
-      goto done;
-   blio->isOutputFull = isFull;
-   result = UNIX_ERR( pthread_mutex_unlock( &blio->outputMutex ) );
-   if( result )
-      goto done;
-   result = UNIX_ERR( pthread_cond_broadcast( &blio->outputCond ) );
-   if( result )
-      goto done;
-
- done:
-   return result;
-}
-#endif
-
-/* This should be called after stopping or aborting the stream, so that on next
-   start, the buffers will be ready. */
-PaError resetBlioRingBuffers( PaMacBlio *blio )
-{
-#ifdef PA_MAC__BLIO_MUTEX
-   int result;
-#endif
-   blio->statusFlags = 0;
-   if( blio->outputRingBuffer.buffer ) {
-      PaUtil_FlushRingBuffer( &blio->outputRingBuffer );
-      bzero( blio->outputRingBuffer.buffer,
-             blio->outputRingBuffer.bufferSize );
-      /* Advance buffer */
-      PaUtil_AdvanceRingBufferWriteIndex( &blio->outputRingBuffer, blio->outputRingBuffer.bufferSize );
-
-      /* Update isOutputFull. */
-#ifdef PA_MAC__BLIO_MUTEX
-      result = blioSetIsOutputFull( blio, toAdvance == blio->outputRingBuffer.bufferSize );
-      if( result )
-         goto error;
-#endif
-/*
-      printf( "------%d\n" ,  blio->framesPerBuffer );
-      printf( "------%d\n" ,  blio->outChan );
-      printf( "------%d\n" ,  blio->outputSampleSize );
-      printf( "------%d\n" ,  blio->framesPerBuffer*blio->outChan*blio->outputSampleSize );
-*/
-   }
-   if( blio->inputRingBuffer.buffer ) {
-      PaUtil_FlushRingBuffer( &blio->inputRingBuffer );
-      bzero( blio->inputRingBuffer.buffer,
-             blio->inputRingBuffer.bufferSize );
-      /* Update isInputEmpty. */
-#ifdef PA_MAC__BLIO_MUTEX
-      result = blioSetIsInputEmpty( blio, true );
-      if( result )
-         goto error;
-#endif
-   }
-   return paNoError;
-#ifdef PA_MAC__BLIO_MUTEX
- error:
-   return result;
-#endif
-}
-
-/*This should be called when you are done with the blio. It can safely be called
-  multiple times if there are no exceptions. */
-PaError destroyBlioRingBuffers( PaMacBlio *blio )
-{
-   PaError result = paNoError;
-   if( blio->inputRingBuffer.buffer ) {
-      free( blio->inputRingBuffer.buffer );
-#ifdef PA_MAC__BLIO_MUTEX
-      result = UNIX_ERR( pthread_mutex_destroy( & blio->inputMutex ) );
-      if( result ) return result;
-      result = UNIX_ERR( pthread_cond_destroy( & blio->inputCond ) );
-      if( result ) return result;
-#endif
-   }
-   blio->inputRingBuffer.buffer = NULL;
-   if( blio->outputRingBuffer.buffer ) {
-      free( blio->outputRingBuffer.buffer );
-#ifdef PA_MAC__BLIO_MUTEX
-      result = UNIX_ERR( pthread_mutex_destroy( & blio->outputMutex ) );
-      if( result ) return result;
-      result = UNIX_ERR( pthread_cond_destroy( & blio->outputCond ) );
-      if( result ) return result;
-#endif
-   }
-   blio->outputRingBuffer.buffer = NULL;
-
-   return result;
-}
-
-/*
- * this is the BlioCallback function. It expects to recieve a PaMacBlio Object
- * pointer as userData.
- *
- */
-int BlioCallback( const void *input, void *output, unsigned long frameCount,
-	const PaStreamCallbackTimeInfo* timeInfo,
-        PaStreamCallbackFlags statusFlags,
-        void *userData )
-{
-   PaMacBlio *blio = (PaMacBlio*)userData;
-   long avail;
-   long toRead;
-   long toWrite;
-
-   /* set flags returned by OS: */
-   OSAtomicOr32( statusFlags, &blio->statusFlags ) ;
-
-   /* --- Handle Input Buffer --- */
-   if( blio->inChan ) {
-      avail = PaUtil_GetRingBufferWriteAvailable( &blio->inputRingBuffer );
-
-      /* check for underflow */
-      if( avail < frameCount * blio->inputSampleSize * blio->inChan )
-         OSAtomicOr32( paInputOverflow, &blio->statusFlags );
-
-      toRead = MIN( avail, frameCount * blio->inputSampleSize * blio->inChan );
-
-      /* copy the data */
-      /*printf( "reading %d\n", toRead );*/
-      assert( toRead == PaUtil_WriteRingBuffer( &blio->inputRingBuffer, input, toRead ) );
-#ifdef PA_MAC__BLIO_MUTEX
-      /* Priority inversion. See notes below. */
-      blioSetIsInputEmpty( blio, false );
-#endif
-   }
-
-
-   /* --- Handle Output Buffer --- */
-   if( blio->outChan ) {
-      avail = PaUtil_GetRingBufferReadAvailable( &blio->outputRingBuffer );
-
-      /* check for underflow */
-      if( avail < frameCount * blio->outputSampleSize * blio->outChan )
-         OSAtomicOr32( paOutputUnderflow, &blio->statusFlags );
-
-      toWrite = MIN( avail, frameCount * blio->outputSampleSize * blio->outChan );
-
-      if( toWrite != frameCount * blio->outputSampleSize * blio->outChan )
-         bzero( ((char *)output)+toWrite,
-                frameCount * blio->outputSampleSize * blio->outChan - toWrite );
-      /* copy the data */
-      /*printf( "writing %d\n", toWrite );*/
-      assert( toWrite == PaUtil_ReadRingBuffer( &blio->outputRingBuffer, output, toWrite ) );
-#ifdef PA_MAC__BLIO_MUTEX
-      /* We have a priority inversion here. However, we will only have to
-         wait if this was true and is now false, which means we've got
-         some room in the buffer.
-         Hopefully problems will be minimized. */
-      blioSetIsOutputFull( blio, false );
-#endif
-   }
-
-   return paContinue;
-}
-
-PaError ReadStream( PaStream* stream,
-                           void *buffer,
-                           unsigned long frames )
-{
-    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
-    char *cbuf = (char *) buffer;
-    PaError ret = paNoError;
-    VVDBUG(("ReadStream()\n"));
-
-    while( frames > 0 ) {
-       long avail;
-       long toRead;
-       do {
-          avail = PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer );
-/*
-          printf( "Read Buffer is %%%g full: %ld of %ld.\n",
-                  100 * (float)avail / (float) blio->inputRingBuffer.bufferSize,
-                  avail, blio->inputRingBuffer.bufferSize );
-*/
-          if( avail == 0 ) {
-#ifdef PA_MAC_BLIO_MUTEX
-             /**block when empty*/
-             ret = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) );
-             if( ret )
-                return ret;
-             while( blio->isInputEmpty ) {
-                ret = UNIX_ERR( pthread_cond_wait( &blio->inputCond, &blio->inputMutex ) );
-                if( ret )
-                   return ret;
-             }
-             ret = UNIX_ERR( pthread_mutex_unlock( &blio->inputMutex ) );
-             if( ret )
-                return ret;
-#else
-             Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
-#endif
-          }
-       } while( avail == 0 );
-       toRead = MIN( avail, frames * blio->inputSampleSize * blio->inChan );
-       toRead -= toRead % blio->inputSampleSize * blio->inChan ;
-       PaUtil_ReadRingBuffer( &blio->inputRingBuffer, (void *)cbuf, toRead );
-       cbuf += toRead;
-       frames -= toRead / ( blio->inputSampleSize * blio->inChan );
-
-       if( toRead == avail ) {
-#ifdef PA_MAC_BLIO_MUTEX
-          /* we just emptied the buffer, so we need to mark it as empty. */
-          ret = blioSetIsInputEmpty( blio, true );
-          if( ret )
-             return ret;
-          /* of course, in the meantime, the callback may have put some sats
-             in, so
-             so check for that, too, to avoid a race condition. */
-          if( PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer ) ) {
-             blioSetIsInputEmpty( blio, false );
-             if( ret )
-                return ret;
-          }
-#endif
-       }
-    }
-
-    /*   Report either paNoError or paInputOverflowed. */
-    /*   may also want to report other errors, but this is non-standard. */
-    ret = blio->statusFlags & paInputOverflow;
-
-    /* report underflow only once: */
-    if( ret ) {
-       OSAtomicAnd32( ~paInputOverflow, &blio->statusFlags );
-       ret = paInputOverflowed;
-    }
-
-    return ret;
-}
-
-
-PaError WriteStream( PaStream* stream,
-                            const void *buffer,
-                            unsigned long frames )
-{
-    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
-    char *cbuf = (char *) buffer;
-    PaError ret = paNoError;
-    VVDBUG(("WriteStream()\n"));
-
-    while( frames > 0 ) {
-       long avail = 0;
-       long toWrite;
-
-       do {
-          avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
-/*
-          printf( "Write Buffer is %%%g full: %ld of %ld.\n",
-                  100 - 100 * (float)avail / (float) blio->outputRingBuffer.bufferSize,
-                  avail, blio->outputRingBuffer.bufferSize );
-*/
-          if( avail == 0 ) {
-#ifdef PA_MAC_BLIO_MUTEX
-             /*block while full*/
-             ret = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) );
-             if( ret )
-                return ret;
-             while( blio->isOutputFull ) {
-                ret = UNIX_ERR( pthread_cond_wait( &blio->outputCond, &blio->outputMutex ) );
-                if( ret )
-                   return ret;
-             }
-             ret = UNIX_ERR( pthread_mutex_unlock( &blio->outputMutex ) );
-             if( ret )
-                return ret;
-#else
-             Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
-#endif
-          }
-       } while( avail == 0 );
-
-       toWrite = MIN( avail, frames * blio->outputSampleSize * blio->outChan );
-       toWrite -= toWrite % blio->outputSampleSize * blio->outChan ;
-       PaUtil_WriteRingBuffer( &blio->outputRingBuffer, (void *)cbuf, toWrite );
-       cbuf += toWrite;
-       frames -= toWrite / ( blio->outputSampleSize * blio->outChan );
-
-#ifdef PA_MAC_BLIO_MUTEX
-       if( toWrite == avail ) {
-          /* we just filled up the buffer, so we need to mark it as filled. */
-          ret = blioSetIsOutputFull( blio, true );
-          if( ret )
-             return ret;
-          /* of course, in the meantime, we may have emptied the buffer, so
-             so check for that, too, to avoid a race condition. */
-          if( PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer ) ) {
-             blioSetIsOutputFull( blio, false );
-             if( ret )
-                return ret;
-          }
-       }
-#endif
-    }
-
-    /*   Report either paNoError or paOutputUnderflowed. */
-    /*   may also want to report other errors, but this is non-standard. */
-    ret = blio->statusFlags & paOutputUnderflow;
-
-    /* report underflow only once: */
-    if( ret ) {
-      OSAtomicAnd32( ~paOutputUnderflow, &blio->statusFlags );
-      ret = paOutputUnderflowed;
-    }
-
-    return ret;
-}
-
-/*
- *
- */
-void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio )
-{
-    if( blio->outputRingBuffer.buffer ) {
-       long avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
-       while( avail != blio->outputRingBuffer.bufferSize ) {
-          if( avail == 0 )
-             Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
-          avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
-       }
-    }
-}
-
-
-signed long GetStreamReadAvailable( PaStream* stream )
-{
-    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
-    VVDBUG(("GetStreamReadAvailable()\n"));
-
-    return PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer )
-                         / ( blio->outputSampleSize * blio->outChan );
-}
-
-
-signed long GetStreamWriteAvailable( PaStream* stream )
-{
-    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
-    VVDBUG(("GetStreamWriteAvailable()\n"));
-
-    return PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer )
-                         / ( blio->outputSampleSize * blio->outChan );
-}
-
+/*
+ * Implementation of the PortAudio API for Apple AUHAL
+ *
+ * PortAudio Portable Real-Time Audio Library
+ * Latest Version at: http://www.portaudio.com
+ *
+ * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code.
+ * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation)
+ *
+ * Dominic's code was based on code by Phil Burk, Darren Gibbs,
+ * Gord Peters, Stephane Letz, and Greg Pfiel.
+ *
+ * The following people also deserve acknowledgements:
+ *
+ * Olivier Tristan for feedback and testing
+ * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O
+ * interface.
+ * 
+ *
+ * Based on the Open Source API proposed by Ross Bencina
+ * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+/**
+ @file
+ @ingroup hostaip_src
+
+ This file contains the implementation
+ required for blocking I/O. It is separated from pa_mac_core.c simply to ease
+ development.
+*/
+
+#include "pa_mac_core_blocking.h"
+#include "pa_mac_core_internal.h"
+#include <assert.h>
+#ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
+# define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
+# define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
+#else
+# include <libkern/OSAtomic.h>
+#endif
+
+/*
+ * This fnuction determines the size of a particular sample format.
+ * if the format is not recognized, this returns zero.
+ */
+static size_t computeSampleSizeFromFormat( PaSampleFormat format )
+{
+   switch( format ) {
+   case paFloat32: return 4;
+   case paInt32: return 4;
+   case paInt24: return 3;
+   case paInt16: return 2;
+   case paInt8: case paUInt8: return 1;
+   default: return 0;
+   }
+}
+
+
+/*
+ * Functions for initializing, resetting, and destroying BLIO structures.
+ *
+ */
+
+/* This should be called with the relevant info when initializing a stream for
+   callback. */
+PaError initializeBlioRingBuffers(
+                                       PaMacBlio *blio,
+                                       PaSampleFormat inputSampleFormat,
+                                       PaSampleFormat outputSampleFormat,
+                                       size_t framesPerBuffer,
+                                       long ringBufferSize,
+                                       int inChan,
+                                       int outChan )
+{
+   void *data;
+   int result;
+
+   /* zeroify things */
+   bzero( blio, sizeof( PaMacBlio ) );
+   /* this is redundant, but the buffers are used to check
+      if the bufffers have been initialized, so we do it explicitly. */
+   blio->inputRingBuffer.buffer = NULL;
+   blio->outputRingBuffer.buffer = NULL;
+
+   /* initialize simple data */
+   blio->inputSampleFormat = inputSampleFormat;
+   blio->inputSampleSize = computeSampleSizeFromFormat(inputSampleFormat);
+   blio->outputSampleFormat = outputSampleFormat;
+   blio->outputSampleSize = computeSampleSizeFromFormat(outputSampleFormat);
+   blio->framesPerBuffer = framesPerBuffer;
+   blio->inChan = inChan;
+   blio->outChan = outChan;
+   blio->statusFlags = 0;
+   blio->errors = paNoError;
+#ifdef PA_MAC_BLIO_MUTEX
+   blio->isInputEmpty = false;
+   blio->isOutputFull = false;
+#endif
+
+   /* setup ring buffers */
+#ifdef PA_MAC_BLIO_MUTEX
+   result = PaMacCore_SetUnixError( pthread_mutex_init(&(blio->inputMutex),NULL), 0 );
+   if( result )
+      goto error;
+   result = UNIX_ERR( pthread_cond_init( &(blio->inputCond), NULL ) );
+   if( result )
+      goto error;
+   result = UNIX_ERR( pthread_mutex_init(&(blio->outputMutex),NULL) );
+   if( result )
+      goto error;
+   result = UNIX_ERR( pthread_cond_init( &(blio->outputCond), NULL ) );
+#endif
+   if( inChan ) {
+      data = calloc( ringBufferSize, blio->inputSampleSize );
+      if( !data )
+      {
+         result = paInsufficientMemory;
+         goto error;
+      }
+
+      assert( 0 == PaUtil_InitializeRingBuffer(
+            &blio->inputRingBuffer,
+            ringBufferSize*blio->inputSampleSize,
+            data ) );
+   }
+   if( outChan ) {
+      data = calloc( ringBufferSize, blio->outputSampleSize );
+      if( !data )
+      {
+         result = paInsufficientMemory;
+         goto error;
+      }
+
+      assert( 0 == PaUtil_InitializeRingBuffer(
+            &blio->outputRingBuffer,
+            ringBufferSize*blio->outputSampleSize,
+            data ) );
+   }
+
+   result = resetBlioRingBuffers( blio );
+   if( result )
+      goto error;
+
+   return 0;
+
+ error:
+   destroyBlioRingBuffers( blio );
+   return result;
+}
+
+#ifdef PA_MAC_BLIO_MUTEX
+PaError blioSetIsInputEmpty( PaMacBlio *blio, bool isEmpty )
+{
+   PaError result = paNoError;
+   if( isEmpty == blio->isInputEmpty )
+      goto done;
+
+   /* we need to update the value. Here's what we do:
+    * - Lock the mutex, so noone else can write.
+    * - update the value.
+    * - unlock.
+    * - broadcast to all listeners.
+    */
+   result = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) );
+   if( result )
+      goto done;
+   blio->isInputEmpty = isEmpty;
+   result = UNIX_ERR( pthread_mutex_unlock( &blio->inputMutex ) );
+   if( result )
+      goto done;
+   result = UNIX_ERR( pthread_cond_broadcast( &blio->inputCond ) );
+   if( result )
+      goto done;
+
+ done:
+   return result;
+}
+PaError blioSetIsOutputFull( PaMacBlio *blio, bool isFull )
+{
+   PaError result = paNoError;
+   if( isFull == blio->isOutputFull )
+      goto done;
+
+   /* we need to update the value. Here's what we do:
+    * - Lock the mutex, so noone else can write.
+    * - update the value.
+    * - unlock.
+    * - broadcast to all listeners.
+    */
+   result = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) );
+   if( result )
+      goto done;
+   blio->isOutputFull = isFull;
+   result = UNIX_ERR( pthread_mutex_unlock( &blio->outputMutex ) );
+   if( result )
+      goto done;
+   result = UNIX_ERR( pthread_cond_broadcast( &blio->outputCond ) );
+   if( result )
+      goto done;
+
+ done:
+   return result;
+}
+#endif
+
+/* This should be called after stopping or aborting the stream, so that on next
+   start, the buffers will be ready. */
+PaError resetBlioRingBuffers( PaMacBlio *blio )
+{
+#ifdef PA_MAC__BLIO_MUTEX
+   int result;
+#endif
+   blio->statusFlags = 0;
+   if( blio->outputRingBuffer.buffer ) {
+      PaUtil_FlushRingBuffer( &blio->outputRingBuffer );
+      bzero( blio->outputRingBuffer.buffer,
+             blio->outputRingBuffer.bufferSize );
+      /* Advance buffer */
+      PaUtil_AdvanceRingBufferWriteIndex( &blio->outputRingBuffer, blio->outputRingBuffer.bufferSize );
+
+      /* Update isOutputFull. */
+#ifdef PA_MAC__BLIO_MUTEX
+      result = blioSetIsOutputFull( blio, toAdvance == blio->outputRingBuffer.bufferSize );
+      if( result )
+         goto error;
+#endif
+/*
+      printf( "------%d\n" ,  blio->framesPerBuffer );
+      printf( "------%d\n" ,  blio->outChan );
+      printf( "------%d\n" ,  blio->outputSampleSize );
+      printf( "------%d\n" ,  blio->framesPerBuffer*blio->outChan*blio->outputSampleSize );
+*/
+   }
+   if( blio->inputRingBuffer.buffer ) {
+      PaUtil_FlushRingBuffer( &blio->inputRingBuffer );
+      bzero( blio->inputRingBuffer.buffer,
+             blio->inputRingBuffer.bufferSize );
+      /* Update isInputEmpty. */
+#ifdef PA_MAC__BLIO_MUTEX
+      result = blioSetIsInputEmpty( blio, true );
+      if( result )
+         goto error;
+#endif
+   }
+   return paNoError;
+#ifdef PA_MAC__BLIO_MUTEX
+ error:
+   return result;
+#endif
+}
+
+/*This should be called when you are done with the blio. It can safely be called
+  multiple times if there are no exceptions. */
+PaError destroyBlioRingBuffers( PaMacBlio *blio )
+{
+   PaError result = paNoError;
+   if( blio->inputRingBuffer.buffer ) {
+      free( blio->inputRingBuffer.buffer );
+#ifdef PA_MAC__BLIO_MUTEX
+      result = UNIX_ERR( pthread_mutex_destroy( & blio->inputMutex ) );
+      if( result ) return result;
+      result = UNIX_ERR( pthread_cond_destroy( & blio->inputCond ) );
+      if( result ) return result;
+#endif
+   }
+   blio->inputRingBuffer.buffer = NULL;
+   if( blio->outputRingBuffer.buffer ) {
+      free( blio->outputRingBuffer.buffer );
+#ifdef PA_MAC__BLIO_MUTEX
+      result = UNIX_ERR( pthread_mutex_destroy( & blio->outputMutex ) );
+      if( result ) return result;
+      result = UNIX_ERR( pthread_cond_destroy( & blio->outputCond ) );
+      if( result ) return result;
+#endif
+   }
+   blio->outputRingBuffer.buffer = NULL;
+
+   return result;
+}
+
+/*
+ * this is the BlioCallback function. It expects to recieve a PaMacBlio Object
+ * pointer as userData.
+ *
+ */
+int BlioCallback( const void *input, void *output, unsigned long frameCount,
+	const PaStreamCallbackTimeInfo* timeInfo,
+        PaStreamCallbackFlags statusFlags,
+        void *userData )
+{
+   PaMacBlio *blio = (PaMacBlio*)userData;
+   long avail;
+   long toRead;
+   long toWrite;
+
+   /* set flags returned by OS: */
+   OSAtomicOr32( statusFlags, &blio->statusFlags ) ;
+
+   /* --- Handle Input Buffer --- */
+   if( blio->inChan ) {
+      avail = PaUtil_GetRingBufferWriteAvailable( &blio->inputRingBuffer );
+
+      /* check for underflow */
+      if( avail < frameCount * blio->inputSampleSize * blio->inChan )
+         OSAtomicOr32( paInputOverflow, &blio->statusFlags );
+
+      toRead = MIN( avail, frameCount * blio->inputSampleSize * blio->inChan );
+
+      /* copy the data */
+      /*printf( "reading %d\n", toRead );*/
+      assert( toRead == PaUtil_WriteRingBuffer( &blio->inputRingBuffer, input, toRead ) );
+#ifdef PA_MAC__BLIO_MUTEX
+      /* Priority inversion. See notes below. */
+      blioSetIsInputEmpty( blio, false );
+#endif
+   }
+
+
+   /* --- Handle Output Buffer --- */
+   if( blio->outChan ) {
+      avail = PaUtil_GetRingBufferReadAvailable( &blio->outputRingBuffer );
+
+      /* check for underflow */
+      if( avail < frameCount * blio->outputSampleSize * blio->outChan )
+         OSAtomicOr32( paOutputUnderflow, &blio->statusFlags );
+
+      toWrite = MIN( avail, frameCount * blio->outputSampleSize * blio->outChan );
+
+      if( toWrite != frameCount * blio->outputSampleSize * blio->outChan )
+         bzero( ((char *)output)+toWrite,
+                frameCount * blio->outputSampleSize * blio->outChan - toWrite );
+      /* copy the data */
+      /*printf( "writing %d\n", toWrite );*/
+      assert( toWrite == PaUtil_ReadRingBuffer( &blio->outputRingBuffer, output, toWrite ) );
+#ifdef PA_MAC__BLIO_MUTEX
+      /* We have a priority inversion here. However, we will only have to
+         wait if this was true and is now false, which means we've got
+         some room in the buffer.
+         Hopefully problems will be minimized. */
+      blioSetIsOutputFull( blio, false );
+#endif
+   }
+
+   return paContinue;
+}
+
+PaError ReadStream( PaStream* stream,
+                           void *buffer,
+                           unsigned long frames )
+{
+    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
+    char *cbuf = (char *) buffer;
+    PaError ret = paNoError;
+    VVDBUG(("ReadStream()\n"));
+
+    while( frames > 0 ) {
+       long avail;
+       long toRead;
+       do {
+          avail = PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer );
+/*
+          printf( "Read Buffer is %%%g full: %ld of %ld.\n",
+                  100 * (float)avail / (float) blio->inputRingBuffer.bufferSize,
+                  avail, blio->inputRingBuffer.bufferSize );
+*/
+          if( avail == 0 ) {
+#ifdef PA_MAC_BLIO_MUTEX
+             /**block when empty*/
+             ret = UNIX_ERR( pthread_mutex_lock( &blio->inputMutex ) );
+             if( ret )
+                return ret;
+             while( blio->isInputEmpty ) {
+                ret = UNIX_ERR( pthread_cond_wait( &blio->inputCond, &blio->inputMutex ) );
+                if( ret )
+                   return ret;
+             }
+             ret = UNIX_ERR( pthread_mutex_unlock( &blio->inputMutex ) );
+             if( ret )
+                return ret;
+#else
+             Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
+#endif
+          }
+       } while( avail == 0 );
+       toRead = MIN( avail, frames * blio->inputSampleSize * blio->inChan );
+       toRead -= toRead % blio->inputSampleSize * blio->inChan ;
+       PaUtil_ReadRingBuffer( &blio->inputRingBuffer, (void *)cbuf, toRead );
+       cbuf += toRead;
+       frames -= toRead / ( blio->inputSampleSize * blio->inChan );
+
+       if( toRead == avail ) {
+#ifdef PA_MAC_BLIO_MUTEX
+          /* we just emptied the buffer, so we need to mark it as empty. */
+          ret = blioSetIsInputEmpty( blio, true );
+          if( ret )
+             return ret;
+          /* of course, in the meantime, the callback may have put some sats
+             in, so
+             so check for that, too, to avoid a race condition. */
+          if( PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer ) ) {
+             blioSetIsInputEmpty( blio, false );
+             if( ret )
+                return ret;
+          }
+#endif
+       }
+    }
+
+    /*   Report either paNoError or paInputOverflowed. */
+    /*   may also want to report other errors, but this is non-standard. */
+    ret = blio->statusFlags & paInputOverflow;
+
+    /* report underflow only once: */
+    if( ret ) {
+       OSAtomicAnd32( ~paInputOverflow, &blio->statusFlags );
+       ret = paInputOverflowed;
+    }
+
+    return ret;
+}
+
+
+PaError WriteStream( PaStream* stream,
+                            const void *buffer,
+                            unsigned long frames )
+{
+    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
+    char *cbuf = (char *) buffer;
+    PaError ret = paNoError;
+    VVDBUG(("WriteStream()\n"));
+
+    while( frames > 0 ) {
+       long avail = 0;
+       long toWrite;
+
+       do {
+          avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
+/*
+          printf( "Write Buffer is %%%g full: %ld of %ld.\n",
+                  100 - 100 * (float)avail / (float) blio->outputRingBuffer.bufferSize,
+                  avail, blio->outputRingBuffer.bufferSize );
+*/
+          if( avail == 0 ) {
+#ifdef PA_MAC_BLIO_MUTEX
+             /*block while full*/
+             ret = UNIX_ERR( pthread_mutex_lock( &blio->outputMutex ) );
+             if( ret )
+                return ret;
+             while( blio->isOutputFull ) {
+                ret = UNIX_ERR( pthread_cond_wait( &blio->outputCond, &blio->outputMutex ) );
+                if( ret )
+                   return ret;
+             }
+             ret = UNIX_ERR( pthread_mutex_unlock( &blio->outputMutex ) );
+             if( ret )
+                return ret;
+#else
+             Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
+#endif
+          }
+       } while( avail == 0 );
+
+       toWrite = MIN( avail, frames * blio->outputSampleSize * blio->outChan );
+       toWrite -= toWrite % blio->outputSampleSize * blio->outChan ;
+       PaUtil_WriteRingBuffer( &blio->outputRingBuffer, (void *)cbuf, toWrite );
+       cbuf += toWrite;
+       frames -= toWrite / ( blio->outputSampleSize * blio->outChan );
+
+#ifdef PA_MAC_BLIO_MUTEX
+       if( toWrite == avail ) {
+          /* we just filled up the buffer, so we need to mark it as filled. */
+          ret = blioSetIsOutputFull( blio, true );
+          if( ret )
+             return ret;
+          /* of course, in the meantime, we may have emptied the buffer, so
+             so check for that, too, to avoid a race condition. */
+          if( PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer ) ) {
+             blioSetIsOutputFull( blio, false );
+             if( ret )
+                return ret;
+          }
+       }
+#endif
+    }
+
+    /*   Report either paNoError or paOutputUnderflowed. */
+    /*   may also want to report other errors, but this is non-standard. */
+    ret = blio->statusFlags & paOutputUnderflow;
+
+    /* report underflow only once: */
+    if( ret ) {
+      OSAtomicAnd32( ~paOutputUnderflow, &blio->statusFlags );
+      ret = paOutputUnderflowed;
+    }
+
+    return ret;
+}
+
+/*
+ *
+ */
+void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio )
+{
+    if( blio->outputRingBuffer.buffer ) {
+       long avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
+       while( avail != blio->outputRingBuffer.bufferSize ) {
+          if( avail == 0 )
+             Pa_Sleep( PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL );
+          avail = PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer );
+       }
+    }
+}
+
+
+signed long GetStreamReadAvailable( PaStream* stream )
+{
+    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
+    VVDBUG(("GetStreamReadAvailable()\n"));
+
+    return PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer )
+                         / ( blio->outputSampleSize * blio->outChan );
+}
+
+
+signed long GetStreamWriteAvailable( PaStream* stream )
+{
+    PaMacBlio *blio = & ((PaMacCoreStream*)stream) -> blio;
+    VVDBUG(("GetStreamWriteAvailable()\n"));
+
+    return PaUtil_GetRingBufferWriteAvailable( &blio->outputRingBuffer )
+                         / ( blio->outputSampleSize * blio->outChan );
+}
+

Modified: freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h
==============================================================================
--- freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h	(original)
+++ freeswitch/trunk/libs/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h	Fri Sep 21 14:49:14 2007
@@ -1,133 +1,133 @@
-/*
- * Internal blocking interfaces for PortAudio Apple AUHAL implementation
- *
- * PortAudio Portable Real-Time Audio Library
- * Latest Version at: http://www.portaudio.com
- *
- * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code.
- * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation)
- *
- * Dominic's code was based on code by Phil Burk, Darren Gibbs,
- * Gord Peters, Stephane Letz, and Greg Pfiel.
- *
- * The following people also deserve acknowledgements:
- *
- * Olivier Tristan for feedback and testing
- * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O
- * interface.
- * 
- *
- * Based on the Open Source API proposed by Ross Bencina
- * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however, 
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
- * license above.
- */
-
-/**
- @file
- @ingroup hostaip_src
-*/
-
-#ifndef PA_MAC_CORE_BLOCKING_H_
-#define PA_MAC_CORE_BLOCKING_H_
-
-#include "pa_ringbuffer.h"
-#include "portaudio.h"
-#include "pa_mac_core_utilities.h"
-
-/*
- * Number of miliseconds to busy wait whil waiting for data in blocking calls.
- */
-#define PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL (5)
-/*
- * Define exactly one of these blocking methods
- * PA_MAC_BLIO_MUTEX is not actively maintained.
- */
-#define PA_MAC_BLIO_BUSY_WAIT
-/*
-#define PA_MAC_BLIO_MUTEX
-*/
-
-typedef struct {
-    PaUtilRingBuffer inputRingBuffer;
-    PaUtilRingBuffer outputRingBuffer;
-    PaSampleFormat inputSampleFormat;
-    size_t inputSampleSize;
-    PaSampleFormat outputSampleFormat;
-    size_t outputSampleSize;
-
-    size_t framesPerBuffer;
-
-    int inChan;
-    int outChan;
-
-    //PaStreamCallbackFlags statusFlags;
-    uint32_t statusFlags;
-    PaError errors;
-
-    /* Here we handle blocking, using condition variables. */
-#ifdef  PA_MAC_BLIO_MUTEX
-    volatile bool isInputEmpty;
-    pthread_mutex_t inputMutex;
-    pthread_cond_t inputCond;
-
-    volatile bool isOutputFull;
-    pthread_mutex_t outputMutex;
-    pthread_cond_t outputCond;
-#endif
-}
-PaMacBlio;
-
-/*
- * These functions operate on condition and related variables.
- */
-
-PaError initializeBlioRingBuffers(
-                                       PaMacBlio *blio,
-                                       PaSampleFormat inputSampleFormat,
-                                       PaSampleFormat outputSampleFormat,
-                                       size_t framesPerBuffer,
-                                       long ringBufferSize,
-                                       int inChan,
-                                       int outChan );
-PaError destroyBlioRingBuffers( PaMacBlio *blio );
-PaError resetBlioRingBuffers( PaMacBlio *blio );
-
-int BlioCallback(
-        const void *input, void *output,
-        unsigned long frameCount,
-        const PaStreamCallbackTimeInfo* timeInfo,
-        PaStreamCallbackFlags statusFlags,
-        void *userData );
-
-void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio );
-
-#endif /*PA_MAC_CORE_BLOCKING_H_*/
+/*
+ * Internal blocking interfaces for PortAudio Apple AUHAL implementation
+ *
+ * PortAudio Portable Real-Time Audio Library
+ * Latest Version at: http://www.portaudio.com
+ *
+ * Written by Bjorn Roche of XO Audio LLC, from PA skeleton code.
+ * Portions copied from code by Dominic Mazzoni (who wrote a HAL implementation)
+ *
+ * Dominic's code was based on code by Phil Burk, Darren Gibbs,
+ * Gord Peters, Stephane Letz, and Greg Pfiel.
+ *
+ * The following people also deserve acknowledgements:
+ *
+ * Olivier Tristan for feedback and testing
+ * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O
+ * interface.
+ * 
+ *
+ * Based on the Open Source API proposed by Ross Bencina
+ * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+/**
+ @file
+ @ingroup hostaip_src
+*/
+
+#ifndef PA_MAC_CORE_BLOCKING_H_
+#define PA_MAC_CORE_BLOCKING_H_
+
+#include "pa_ringbuffer.h"
+#include "portaudio.h"
+#include "pa_mac_core_utilities.h"
+
+/*
+ * Number of miliseconds to busy wait whil waiting for data in blocking calls.
+ */
+#define PA_MAC_BLIO_BUSY_WAIT_SLEEP_INTERVAL (5)
+/*
+ * Define exactly one of these blocking methods
+ * PA_MAC_BLIO_MUTEX is not actively maintained.
+ */
+#define PA_MAC_BLIO_BUSY_WAIT
+/*
+#define PA_MAC_BLIO_MUTEX
+*/
+
+typedef struct {
+    PaUtilRingBuffer inputRingBuffer;
+    PaUtilRingBuffer outputRingBuffer;
+    PaSampleFormat inputSampleFormat;
+    size_t inputSampleSize;
+    PaSampleFormat outputSampleFormat;
+    size_t outputSampleSize;
+
+    size_t framesPerBuffer;
+
+    int inChan;
+    int outChan;
+
+    //PaStreamCallbackFlags statusFlags;
+    uint32_t statusFlags;
+    PaError errors;
+
+    /* Here we handle blocking, using condition variables. */
+#ifdef  PA_MAC_BLIO_MUTEX
+    volatile bool isInputEmpty;
+    pthread_mutex_t inputMutex;
+    pthread_cond_t inputCond;
+
+    volatile bool isOutputFull;
+    pthread_mutex_t outputMutex;
+    pthread_cond_t outputCond;
+#endif
+}
+PaMacBlio;
+
+/*
+ * These functions operate on condition and related variables.
+ */
+
+PaError initializeBlioRingBuffers(
+                                       PaMacBlio *blio,
+                                       PaSampleFormat inputSampleFormat,
+                                       PaSampleFormat outputSampleFormat,
+                                       size_t framesPerBuffer,
+                                       long ringBufferSize,
+                                       int inChan,
+                                       int outChan );
+PaError destroyBlioRingBuffers( PaMacBlio *blio );
+PaError resetBlioRingBuffers( PaMacBlio *blio );
+
+int BlioCallback(
+        const void *input, void *output,
+        unsigned long frameCount,
+        const PaStreamCallbackTimeInfo* timeInfo,
+        PaStreamCallbackFlags statusFlags,
+        void *userData );
+
+void waitUntilBlioWriteBufferIsFlushed( PaMacBlio *blio );
+
+#endif /*PA_MAC_CORE_BLOCKING_H_*/

Modified: freeswitch/trunk/libs/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp
==============================================================================
--- freeswitch/trunk/libs/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp	(original)
+++ freeswitch/trunk/libs/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp	Fri Sep 21 14:49:14 2007
@@ -1,1792 +1,1792 @@
-/*
- * Portable Audio I/O Library WASAPI implementation
- * Copyright (c) 2006 David Viens
- *
- * Based on the Open Source API proposed by Ross Bencina
- * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however, 
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
- * license above.
- */
-
-/** @file
- @ingroup hostaip_src
- @brief WASAPI implementation of support for a host API.
-
- @note This file is provided as a starting point for implementing support for
- a new host API. IMPLEMENT ME comments are used to indicate functionality
- which much be customised for each implementation.
-*/
-
-
-
-//these headers are only in Windows SDK CTP Feb 2006 and only work in VC 2005!
-#if _MSC_VER >= 1400
-#include <windows.h>
-#include <MMReg.h>  //must be before other Wasapi headers
-#include <strsafe.h>
-#include <mmdeviceapi.h>
-#include <Avrt.h>
-#include <audioclient.h>
-#include <KsMedia.h>
-#include <functiondiscoverykeys.h>  // PKEY_Device_FriendlyName
-#endif
-
-
-
-#include "pa_util.h"
-#include "pa_allocation.h"
-#include "pa_hostapi.h"
-#include "pa_stream.h"
-#include "pa_cpuload.h"
-#include "pa_process.h"
-
-
-
-/* prototypes for functions declared in this file */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
-
-PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-
-
-static void Terminate( struct PaUtilHostApiRepresentation *hostApi );
-static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
-                                  const PaStreamParameters *inputParameters,
-                                  const PaStreamParameters *outputParameters,
-                                  double sampleRate );
-static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
-                           PaStream** s,
-                           const PaStreamParameters *inputParameters,
-                           const PaStreamParameters *outputParameters,
-                           double sampleRate,
-                           unsigned long framesPerBuffer,
-                           PaStreamFlags streamFlags,
-                           PaStreamCallback *streamCallback,
-                           void *userData );
-static PaError CloseStream( PaStream* stream );
-static PaError StartStream( PaStream *stream );
-static PaError StopStream( PaStream *stream );
-static PaError AbortStream( PaStream *stream );
-static PaError IsStreamStopped( PaStream *s );
-static PaError IsStreamActive( PaStream *stream );
-static PaTime GetStreamTime( PaStream *stream );
-static double GetStreamCpuLoad( PaStream* stream );
-static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames );
-static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames );
-static signed long GetStreamReadAvailable( PaStream* stream );
-static signed long GetStreamWriteAvailable( PaStream* stream );
-
-
-/* IMPLEMENT ME: a macro like the following one should be used for reporting
- host errors */
-#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \
-    PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText )
-
-/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */
-
-
-
-//dummy entry point for other compilers and sdks
-//currently built using RC1 SDK (5600)
-#if _MSC_VER < 1400
-
-PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){
-    return paNoError;
-}
-
-#else
-
-
-
-
-#define MAX_STR_LEN 512
-
-/*
- These are fields that can be gathered from IDevice
- and IAudioDevice PRIOR to Initialize, and done in first pass
- i assume that neither of these will cause the Driver to "load",
- but again, who knows how they implement their stuff
- */
-typedef struct PaWinWasapiDeviceInfo
-{
-    //hmm is it wise to keep a reference until Terminate?
-    //TODO Check if that interface requires the driver to be loaded!
-    IMMDevice * device;
-
-    //Fields filled from IDevice
-    //from GetId
-    WCHAR szDeviceID[MAX_STR_LEN];
-    //from GetState
-    DWORD state;
-
-    //Fields filled from IMMEndpoint'sGetDataFlow
-    EDataFlow  flow;
-
-    //Fields filled from IAudioDevice (_prior_ to Initialize)
-    //from GetDevicePeriod(
-    REFERENCE_TIME  DefaultDevicePeriod;
-    REFERENCE_TIME  MinimumDevicePeriod;
-    //from GetMixFormat
-    WAVEFORMATEX   *MixFormat;//needs to be CoTaskMemFree'd after use!
-
-} PaWinWasapiDeviceInfo;
-
-
-typedef struct
-{
-    PaUtilHostApiRepresentation inheritedHostApiRep;
-    PaUtilStreamInterface callbackStreamInterface;
-    PaUtilStreamInterface blockingStreamInterface;
-
-    PaUtilAllocationGroup *allocations;
-
-    /* implementation specific data goes here */
-
-    //in case we later need the synch
-    IMMDeviceEnumerator * enumerator;
-
-    //this is the REAL number of devices, whether they are usefull to PA or not!
-    UINT deviceCount;
-
-    WCHAR defaultRenderer [MAX_STR_LEN];
-    WCHAR defaultCapturer [MAX_STR_LEN];
-
-    PaWinWasapiDeviceInfo   *devInfo;
-}PaWinWasapiHostApiRepresentation;
-
-
-/* PaWinWasapiStream - a stream data structure specifically for this implementation */
-
-typedef struct PaWinWasapiSubStream{
-    IAudioClient        *client;
-    WAVEFORMATEXTENSIBLE wavex;
-    UINT32               bufferSize;
-    REFERENCE_TIME       latency;
-    REFERENCE_TIME       period;
-    unsigned long framesPerHostCallback; /* just an example */
-}PaWinWasapiSubStream;
-
-typedef struct PaWinWasapiStream
-{ /* IMPLEMENT ME: rename this */
-    PaUtilStreamRepresentation streamRepresentation;
-    PaUtilCpuLoadMeasurer cpuLoadMeasurer;
-    PaUtilBufferProcessor bufferProcessor;
-
-    /* IMPLEMENT ME:
-            - implementation specific data goes here
-    */
-
-
-    //input
-	PaWinWasapiSubStream in;
-    IAudioCaptureClient *cclient;
-    
-	//output
-	PaWinWasapiSubStream out;
-    IAudioRenderClient  *rclient;
-
-
-    bool running;
-    bool closeRequest;
-
-    DWORD dwThreadId;
-    HANDLE hThread;
-
-    GUID  session;
-
-}PaWinWasapiStream;
-
-#define PRINT(x) PA_DEBUG(x);
-
-void
-logAUDCLNT_E(HRESULT res){
-
-    char *text = 0;
-    switch(res){
-        case S_OK: return; break;
-        case E_POINTER                              :text ="E_POINTER"; break;
-        case E_INVALIDARG                           :text ="E_INVALIDARG"; break;
-
-        case AUDCLNT_E_NOT_INITIALIZED              :text ="AUDCLNT_E_NOT_INITIALIZED"; break;
-        case AUDCLNT_E_ALREADY_INITIALIZED          :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break;
-        case AUDCLNT_E_WRONG_ENDPOINT_TYPE          :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break;
-        case AUDCLNT_E_DEVICE_INVALIDATED           :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break;
-        case AUDCLNT_E_NOT_STOPPED                  :text ="AUDCLNT_E_NOT_STOPPED"; break;
-        case AUDCLNT_E_BUFFER_TOO_LARGE             :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break;
-        case AUDCLNT_E_OUT_OF_ORDER                 :text ="AUDCLNT_E_OUT_OF_ORDER"; break;
-        case AUDCLNT_E_UNSUPPORTED_FORMAT           :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break;
-        case AUDCLNT_E_INVALID_SIZE                 :text ="AUDCLNT_E_INVALID_SIZE"; break;
-        case AUDCLNT_E_DEVICE_IN_USE                :text ="AUDCLNT_E_DEVICE_IN_USE"; break;
-        case AUDCLNT_E_BUFFER_OPERATION_PENDING     :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break;
-        case AUDCLNT_E_THREAD_NOT_REGISTERED        :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break;      
-		case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED   :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break;
-        case AUDCLNT_E_ENDPOINT_CREATE_FAILED       :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break;
-        case AUDCLNT_E_SERVICE_NOT_RUNNING          :text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; break;
-     //  case AUDCLNT_E_CPUUSAGE_EXCEEDED            :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break;
-     //Header error?
-        case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED     :text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; break;
-        case AUDCLNT_E_EXCLUSIVE_MODE_ONLY          :text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; break;
-        case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; break;
-        case AUDCLNT_E_EVENTHANDLE_NOT_SET          :text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; break;
-        case AUDCLNT_E_INCORRECT_BUFFER_SIZE        :text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; break;
-        case AUDCLNT_E_BUFFER_SIZE_ERROR            :text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; break;
-        case AUDCLNT_S_BUFFER_EMPTY                 :text ="AUDCLNT_S_BUFFER_EMPTY"; break;
-        case AUDCLNT_S_THREAD_ALREADY_REGISTERED    :text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; break;
-        default:
-            text =" dunno!";
-            return ;
-        break;
-
-    }
-    PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text));
-}
-
-inline double
-nano100ToMillis(const REFERENCE_TIME &ref){
-    //  1 nano = 0.000000001 seconds
-    //100 nano = 0.0000001   seconds
-    //100 nano = 0.0001   milliseconds
-    return ((double)ref)*0.0001;
-}
-
-inline double
-nano100ToSeconds(const REFERENCE_TIME &ref){
-    //  1 nano = 0.000000001 seconds
-    //100 nano = 0.0000001   seconds
-    //100 nano = 0.0001   milliseconds
-    return ((double)ref)*0.0000001;
-}
-
-#ifndef IF_FAILED_JUMP
-#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label;
-#endif
-
-
-
-//AVRT is the new "multimedia schedulling stuff"
-
-typedef BOOL   (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER);
-typedef BOOL   (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE);
-typedef BOOL   (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE);
-typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics)  (LPCTSTR,LPDWORD);
-typedef BOOL   (WINAPI *FAvSetMmThreadPriority)         (HANDLE,AVRT_PRIORITY);
-
-HMODULE  hDInputDLL = 0;
-FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0;
-FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0;
-FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0;
-FAvSetMmThreadCharacteristics  pAvSetMmThreadCharacteristics=0;
-FAvSetMmThreadPriority         pAvSetMmThreadPriority=0;
-
-#define setupPTR(fun, type, name)  {                                                        \
-                                        fun = (type) GetProcAddress(hDInputDLL,name);       \
-                                        if(fun == NULL) {                                   \
-                                            PRINT(("GetProcAddr failed for %s" ,name));     \
-                                            return false;                                   \
-                                        }                                                   \
-                                    }                                                       \
-
-bool
-setupAVRT(){
-
-    hDInputDLL = LoadLibraryA("avrt.dll");
-    if(hDInputDLL == NULL)
-        return false;
-
-    setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup");
-    setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup");
-    setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup");
-    setupPTR(pAvSetMmThreadCharacteristics,  FAvSetMmThreadCharacteristics,  "AvSetMmThreadCharacteristicsA");
-    setupPTR(pAvSetMmThreadPriority,         FAvSetMmThreadPriority,         "AvSetMmThreadPriority");
-
-    return true;
-}
-
-
-
-PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
-{
-    if (!setupAVRT()){
-        PRINT(("Windows WASAPI : No AVRT! (not VISTA?)"));
-        return paNoError;
-    }
-
-    CoInitialize(NULL);
-
-    PaError result = paNoError;
-    PaWinWasapiHostApiRepresentation *paWasapi;
-    PaDeviceInfo *deviceInfoArray;
-
-    paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) );
-    if( !paWasapi ){
-        result = paInsufficientMemory;
-        goto error;
-    }
-
-    paWasapi->allocations = PaUtil_CreateAllocationGroup();
-    if( !paWasapi->allocations ){
-        result = paInsufficientMemory;
-        goto error;
-    }
-
-    *hostApi = &paWasapi->inheritedHostApiRep;
-    (*hostApi)->info.structVersion = 1;
-    (*hostApi)->info.type = paWASAPI;
-    (*hostApi)->info.name = "Windows WASAPI";
-    (*hostApi)->info.deviceCount = 0;   //so far, we must investigate each
-    (*hostApi)->info.defaultInputDevice  = paNoDevice;  /* IMPLEMENT ME */
-    (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */
-
-
-    HRESULT hResult = S_OK;
-    IMMDeviceCollection* spEndpoints=0;
-    paWasapi->enumerator = 0;
-
-    if (!setupAVRT()){
-        PRINT(("Windows WASAPI : No AVRT! (not VISTA?)"));
-        goto error;
-    }
-
-    hResult = CoCreateInstance(
-             __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER,
-             __uuidof(IMMDeviceEnumerator),
-             (void**)&paWasapi->enumerator);
-
-    IF_FAILED_JUMP(hResult, error);
-
-    //getting default device ids in the eMultimedia "role"
-    {
-        {
-            IMMDevice* defaultRenderer=0;
-            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer);
-            IF_FAILED_JUMP(hResult, error);
-            WCHAR* pszDeviceId = NULL;
-            hResult = defaultRenderer->GetId(&pszDeviceId);
-            IF_FAILED_JUMP(hResult, error);
-            StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId);
-            CoTaskMemFree(pszDeviceId);
-            defaultRenderer->Release();
-        }
-
-        {
-            IMMDevice* defaultCapturer=0;
-            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer);
-            IF_FAILED_JUMP(hResult, error);
-            WCHAR* pszDeviceId = NULL;
-            hResult = defaultCapturer->GetId(&pszDeviceId);
-            IF_FAILED_JUMP(hResult, error);
-            StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId);
-            CoTaskMemFree(pszDeviceId);
-            defaultCapturer->Release();
-        }
-    }
-
-
-    hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints);
-    IF_FAILED_JUMP(hResult, error);
-
-    hResult = spEndpoints->GetCount(&paWasapi->deviceCount);
-    IF_FAILED_JUMP(hResult, error);
-
-    paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount];
-    {
-        for (size_t step=0;step<paWasapi->deviceCount;++step)
-            memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo));
-    }
-
-
-
-    if( paWasapi->deviceCount > 0 )
-    {
-        (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory(
-                paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount );
-        if( !(*hostApi)->deviceInfos ){
-            result = paInsufficientMemory;
-            goto error;
-        }
-
-        /* allocate all device info structs in a contiguous block */
-        deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory(
-                paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount );
-        if( !deviceInfoArray ){
-            result = paInsufficientMemory;
-            goto error;
-        }
-
-        for( UINT i=0; i < paWasapi->deviceCount; ++i ){
-
-            PaDeviceInfo *deviceInfo = &deviceInfoArray[i];
-            deviceInfo->structVersion = 2;
-            deviceInfo->hostApi = hostApiIndex;
-
-            hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device);
-            IF_FAILED_JUMP(hResult, error);
-
-            //getting ID
-            {
-                WCHAR* pszDeviceId = NULL;
-                hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId);
-                IF_FAILED_JUMP(hResult, error);
-                StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId);
-                CoTaskMemFree(pszDeviceId);
-
-                if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){
-                    //we found the default input!
-                    (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount;
-                }
-                if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){
-                    //we found the default output!
-                    (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount;
-                }
-            }
-
-            DWORD state=0;
-            hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state);
-            IF_FAILED_JUMP(hResult, error);
-
-            if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){
-                PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state));
-                //spDevice->Release();
-                //continue;
-            }
-
-            {
-                IPropertyStore* spProperties;
-                hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties);
-                IF_FAILED_JUMP(hResult, error);
-
-                //getting "Friendly" Name
-                {
-                    PROPVARIANT value;
-                    PropVariantInit(&value);
-                    hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value);
-                    IF_FAILED_JUMP(hResult, error);
-                    deviceInfo->name = 0;
-                    char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 );
-                    if( !deviceName ){
-                        result = paInsufficientMemory;
-                        goto error;
-                    }
-					if (value.pwszVal)
-						wcstombs(deviceName,   value.pwszVal,MAX_STR_LEN-1); //todo proper size	
-					else{
-						sprintf(deviceName,"baddev%d",i);
-					}
-
-                    deviceInfo->name = deviceName;
-                    PropVariantClear(&value);
-                }
-
-#if 0
-                DWORD numProps = 0;
-                hResult = spProperties->GetCount(&numProps);
-                IF_FAILED_JUMP(hResult, error);
-                {
-                    for (DWORD i=0;i<numProps;++i){
-                        PROPERTYKEY pkey;
-                        hResult = spProperties->GetAt(i,&pkey);
-
-                        PROPVARIANT value;
-                        PropVariantInit(&value);
-                        hResult = spProperties->GetValue(pkey, &value);
-
-                        switch(value.vt){
-                            case 11:
-                                PRINT(("property*%u*\n",value.ulVal));
-                            break;
-                            case 19:
-                                PRINT(("property*%d*\n",value.boolVal));
-                            break;
-                            case 31:
-                            {
-                                char temp[512];
-                                wcstombs(temp,    value.pwszVal,MAX_STR_LEN-1);
-                                PRINT(("property*%s*\n",temp));
-                            }
-                            break;
-                            default:break;
-                        }
-
-                        PropVariantClear(&value);
-                    }
-                }
-#endif
-
-                /*  These look interresting... but they are undocumented
-                PKEY_AudioEndpoint_FormFactor
-                PKEY_AudioEndpoint_ControlPanelPageProvider
-                PKEY_AudioEndpoint_Association
-                PKEY_AudioEndpoint_PhysicalSpeakerConfig
-                PKEY_AudioEngine_DeviceFormat
-                */
-                spProperties->Release();
-            }
-
-
-            //getting the Endpoint data
-            {
-                IMMEndpoint *endpoint=0;
-                hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint);
-                if (SUCCEEDED(hResult)){
-                    hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow);
-                    endpoint->Release();
-                }
-            }
-
-            //Getting a temporary IAudioDevice for more fields
-            //we make sure NOT to call Initialize yet!
-            {
-                IAudioClient *myClient=0;
-
-                hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
-                IF_FAILED_JUMP(hResult, error);
-
-                hResult = myClient->GetDevicePeriod(
-                    &paWasapi->devInfo[i].DefaultDevicePeriod,
-                    &paWasapi->devInfo[i].MinimumDevicePeriod);
-                IF_FAILED_JUMP(hResult, error);
-
-                hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat);
-
-                IF_FAILED_JUMP(hResult, error);
-                myClient->Release();
-            }
-
-            //we can now fill in portaudio device data
-            deviceInfo->maxInputChannels  = 0;  //for now
-            deviceInfo->maxOutputChannels = 0;  //for now
-
-            switch(paWasapi->devInfo[i].flow){
-                case eRender:
-                    //hum not exaclty maximum, more like "default"
-                    deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels;
-
-                    deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod);
-                    deviceInfo->defaultLowOutputLatency  = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod);
-                break;
-                case eCapture:
-                    //hum not exaclty maximum, more like "default"
-                    deviceInfo->maxInputChannels  = paWasapi->devInfo[i].MixFormat->nChannels;
-
-                    deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod);
-                    deviceInfo->defaultLowInputLatency  = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod);
-                break;
-                default:
-                    PRINT(("WASAPI device:%d bad Data FLow! \n",i));
-                    goto error;
-                break;
-            }
-
-            deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec;
-
-            (*hostApi)->deviceInfos[i] = deviceInfo;
-            ++(*hostApi)->info.deviceCount;
-        }
-    }
-
-    spEndpoints->Release();
-
-    (*hostApi)->Terminate = Terminate;
-    (*hostApi)->OpenStream = OpenStream;
-    (*hostApi)->IsFormatSupported = IsFormatSupported;
-
-    PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream,
-                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
-                                      GetStreamTime, GetStreamCpuLoad,
-                                      PaUtil_DummyRead, PaUtil_DummyWrite,
-                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable );
-
-    PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream,
-                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
-                                      GetStreamTime, PaUtil_DummyGetCpuLoad,
-                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable );
-
-    return result;
-
-error:
-
-    if (spEndpoints)
-        spEndpoints->Release();
-
-    if (paWasapi->enumerator)
-        paWasapi->enumerator->Release();
-
-    if( paWasapi )
-    {
-        if( paWasapi->allocations )
-        {
-            PaUtil_FreeAllAllocations( paWasapi->allocations );
-            PaUtil_DestroyAllocationGroup( paWasapi->allocations );
-        }
-
-        PaUtil_FreeMemory( paWasapi );
-    }
-    return result;
-}
-
-
-static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
-{
-    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
-
-    paWasapi->enumerator->Release();
-
-    for (UINT i=0;i<paWasapi->deviceCount;++i){
-        PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i];
-
-        if (info->device)
-            info->device->Release();
-
-        if (info->MixFormat)
-            CoTaskMemFree(info->MixFormat);
-    }
-    delete [] paWasapi->devInfo;
-
-    CoUninitialize();
-
-    if( paWasapi->allocations ){
-        PaUtil_FreeAllAllocations( paWasapi->allocations );
-        PaUtil_DestroyAllocationGroup( paWasapi->allocations );
-    }
-
-    PaUtil_FreeMemory( paWasapi );
-}
-
-static void
-LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE &in){
-
-    const WAVEFORMATEX *old = (WAVEFORMATEX *)&in;
-
-	switch (old->wFormatTag){
-		case WAVE_FORMAT_EXTENSIBLE:{
-
-			PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n"));
-
-			if (in.SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){
-				PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n"));
-			}
-			else if (in.SubFormat == KSDATAFORMAT_SUBTYPE_PCM){
-				PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n"));
-			}
-			else{
-				PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n",	
-											in.SubFormat.Data1,
-											in.SubFormat.Data2,
-											in.SubFormat.Data3,
-											(int)in.SubFormat.Data4[0],
-											(int)in.SubFormat.Data4[1],
-											(int)in.SubFormat.Data4[2],
-											(int)in.SubFormat.Data4[3],
-											(int)in.SubFormat.Data4[4],
-											(int)in.SubFormat.Data4[5],
-											(int)in.SubFormat.Data4[6],
-											(int)in.SubFormat.Data4[7]));
-			}
-			PRINT(("Samples.wValidBitsPerSample=%d\n",  in.Samples.wValidBitsPerSample));
-			PRINT(("dwChannelMask=0x%X\n",in.dwChannelMask));
-		}break;
-		
-		case WAVE_FORMAT_PCM:        PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break;
-		case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break;
-		default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break;
-	}
-
-	PRINT(("nChannels      =%d\n",old->nChannels)); 
-	PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec));  
-	PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec));  
-	PRINT(("nBlockAlign    =%d\n",old->nBlockAlign));  
-	PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample));  
-	PRINT(("cbSize         =%d\n",old->cbSize));  
-}
-
-
-
-/*
- WAVEFORMATXXX is always interleaved
- */
-static PaSampleFormat
-waveformatToPaFormat(const WAVEFORMATEXTENSIBLE &in){
-
-    const WAVEFORMATEX *old = (WAVEFORMATEX *)&in;
-
-    switch (old->wFormatTag){
-
-        case WAVE_FORMAT_EXTENSIBLE:
-        {
-            if (in.SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){
-                if (in.Samples.wValidBitsPerSample == 32)
-                    return paFloat32;
-                else
-                    return paCustomFormat;
-            }
-            else if (in.SubFormat == KSDATAFORMAT_SUBTYPE_PCM){
-                switch (old->wBitsPerSample){
-                    case 32: return paInt32; break;
-                    case 24: return paInt24;break;
-                    case  8: return paUInt8;break;
-                    case 16: return paInt16;break;
-                    default: return paCustomFormat;break;
-                }
-            }
-            else
-                return paCustomFormat;
-        }
-        break;
-
-        case WAVE_FORMAT_IEEE_FLOAT:
-            return paFloat32;
-        break;
-
-        case WAVE_FORMAT_PCM:
-        {
-            switch (old->wBitsPerSample){
-                case 32: return paInt32; break;
-                case 24: return paInt24;break;
-                case  8: return paUInt8;break;
-                case 16: return paInt16;break;
-                default: return paCustomFormat;break;
-            }
-        }
-        break;
-
-        default:
-            return paCustomFormat;
-        break;
-    }
-
-    return paCustomFormat;
-}
-
-
-
-static PaError
-waveformatFromParams(WAVEFORMATEXTENSIBLE &wav,
-                          const PaStreamParameters * params,
-                          double sampleRate){
-
-    size_t bytesPerSample = 0;
-    switch( params->sampleFormat & ~paNonInterleaved ){
-        case paFloat32:
-        case paInt32: bytesPerSample=4;break;
-        case paInt16: bytesPerSample=2;break;
-        case paInt24: bytesPerSample=3;break;
-        case paInt8:
-        case paUInt8: bytesPerSample=1;break;
-        case paCustomFormat:
-        default: return paSampleFormatNotSupported;break;
-    }
-
-    memset(&wav,0,sizeof(WAVEFORMATEXTENSIBLE));
-
-    WAVEFORMATEX *old    = (WAVEFORMATEX *)&wav;
-    old->nChannels       = (WORD)params->channelCount;
-    old->nSamplesPerSec  = (DWORD)sampleRate;
-    old->wBitsPerSample  = bytesPerSample*8;
-    old->nAvgBytesPerSec = old->nSamplesPerSec * old->nChannels * bytesPerSample;
-    old->nBlockAlign     = (WORD)(old->nChannels * bytesPerSample);
-
-    //WAVEFORMATEX
-    if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){
-        old->cbSize          = 0;
-        old->wFormatTag      = WAVE_FORMAT_PCM;
-    }
-    //WAVEFORMATEXTENSIBLE
-    else{
-        old->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
-
-        old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX);
-
-        if ((params->sampleFormat & ~paNonInterleaved) == paFloat32)
-            wav.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
-        else
-            wav.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
-
-        wav.Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding!
-
-        switch(params->channelCount){
-            case 1:  wav.dwChannelMask = SPEAKER_FRONT_CENTER; break;
-            case 2:  wav.dwChannelMask = 0x1 | 0x2; break;
-            case 4:  wav.dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break;
-            case 6:  wav.dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break;
-            case 8:  wav.dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break;
-            default: wav.dwChannelMask = 0; break;
-        }
-    }
-
-    return paNoError;
-}
-
-
-enum PaWasapiFormatAnswer {PWFA_OK,PWFA_NO,PWFA_SUGGESTED};
-
-
-static PaWasapiFormatAnswer 
-IsFormatSupportedInternal(IAudioClient * myClient, WAVEFORMATEXTENSIBLE &wavex){
-
-	PaWasapiFormatAnswer answer = PWFA_OK;
-
-    WAVEFORMATEX *closestMatch=0;
-    HRESULT hResult = myClient->IsFormatSupported(
-        //AUDCLNT_SHAREMODE_EXCLUSIVE,
-        AUDCLNT_SHAREMODE_SHARED,
-        (WAVEFORMATEX*)&wavex,&closestMatch);
-
-	if (hResult == S_OK)
-		answer = PWFA_OK;
-    else if (closestMatch){
-        WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)closestMatch;
-		
-		if (closestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
-			memcpy(&wavex,closestMatch,sizeof(WAVEFORMATEXTENSIBLE));
-		else
-			memcpy(&wavex,closestMatch,sizeof(WAVEFORMATEX));
-
-        CoTaskMemFree(closestMatch);
-		answer = PWFA_SUGGESTED;
-	
-	}else if (hResult != S_OK){
-		logAUDCLNT_E(hResult);
-		answer = PWFA_NO;
-	}
-
-	return answer;
-}
-
-
-static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
-                                  const PaStreamParameters *inputParameters,
-                                  const PaStreamParameters *outputParameters,
-                                  double sampleRate )
-{
-    int inputChannelCount, outputChannelCount;
-    PaSampleFormat inputSampleFormat, outputSampleFormat;
-
-    if( inputParameters )
-    {
-        inputChannelCount = inputParameters->channelCount;
-        inputSampleFormat = inputParameters->sampleFormat;
-
-        /* all standard sample formats are supported by the buffer adapter,
-            this implementation doesn't support any custom sample formats */
-        if( inputSampleFormat & paCustomFormat )
-            return paSampleFormatNotSupported;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
-            return paInvalidDevice;
-
-        /* check that input device can support inputChannelCount */
-        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )
-            return paInvalidChannelCount;
-
-        /* validate inputStreamInfo */
-        if( inputParameters->hostApiSpecificStreamInfo )
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
-
-        WAVEFORMATEXTENSIBLE wavex;
-        waveformatFromParams(wavex,inputParameters,sampleRate);
-	
-		IAudioClient *myClient=0;
-		HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate(
-			__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
-		if (hResult != S_OK){
-			logAUDCLNT_E(hResult);
-			return paInvalidDevice;
-		}
-
-		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(myClient,wavex);
-		myClient->Release();
-
-		switch (answer){
-			case PWFA_OK: break;
-			case PWFA_NO: return paSampleFormatNotSupported;
-			case PWFA_SUGGESTED:
-			{
-				PRINT(("Suggested format:"));
-				LogWAVEFORMATEXTENSIBLE(wavex);
-				if (wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
-					//no problem its a format issue only
-				}
-				else{
-					return paInvalidSampleRate;
-				}
-			}
-		}
-
-
-    }
-    else
-    {
-        inputChannelCount = 0;
-    }
-
-    if( outputParameters )
-    {
-        outputChannelCount = outputParameters->channelCount;
-        outputSampleFormat = outputParameters->sampleFormat;
-
-        /* all standard sample formats are supported by the buffer adapter,
-            this implementation doesn't support any custom sample formats */
-        if( outputSampleFormat & paCustomFormat )
-            return paSampleFormatNotSupported;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
-            return paInvalidDevice;
-
-        /* check that output device can support outputChannelCount */
-        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )
-            return paInvalidChannelCount;
-
-        /* validate outputStreamInfo */
-        if( outputParameters->hostApiSpecificStreamInfo )
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
-
-        WAVEFORMATEXTENSIBLE wavex;
-        waveformatFromParams(wavex,outputParameters,sampleRate);
-	
-		IAudioClient *myClient=0;
-		HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate(
-			__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
-		if (hResult != S_OK){
-			logAUDCLNT_E(hResult);
-			return paInvalidDevice;
-		}
-
-		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(myClient,wavex);
-		myClient->Release();
-
-		switch (answer){
-			case PWFA_OK: break;
-			case PWFA_NO: return paSampleFormatNotSupported;
-			case PWFA_SUGGESTED:
-			{
-				PRINT(("Suggested format:"));
-				LogWAVEFORMATEXTENSIBLE(wavex);
-				if (wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
-					//no problem its a format issue only
-				}
-				else{
-					return paInvalidSampleRate;
-				}
-			}
-		}
-
-
-    }
-    else
-    {
-        outputChannelCount = 0;
-    }
-
-
-    return paFormatIsSupported;
-}
-
-
-
-/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */
-
-static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
-                           PaStream** s,
-                           const PaStreamParameters *inputParameters,
-                           const PaStreamParameters *outputParameters,
-                           double sampleRate,
-                           unsigned long framesPerBuffer,
-                           PaStreamFlags streamFlags,
-                           PaStreamCallback *streamCallback,
-                           void *userData )
-{
-    PaError result = paNoError;
-    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
-    PaWinWasapiStream *stream = 0;
-    int inputChannelCount, outputChannelCount;
-    PaSampleFormat inputSampleFormat, outputSampleFormat;
-    PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
-
-
-    stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) );
-    if( !stream ){
-        result = paInsufficientMemory;
-        goto error;
-    }
-
-    if( inputParameters )
-    {
-        inputChannelCount = inputParameters->channelCount;
-        inputSampleFormat = inputParameters->sampleFormat;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
-            return paInvalidDevice;
-
-        /* check that input device can support inputChannelCount */
-        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )
-            return paInvalidChannelCount;
-
-        /* validate inputStreamInfo */
-        if( inputParameters->hostApiSpecificStreamInfo )
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device];
-
-        HRESULT hResult = info.device->Activate(
-            __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL,
-            (void**)&stream->in.client);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        waveformatFromParams(stream->in.wavex,outputParameters,sampleRate);
-		
-		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(stream->in.client,
-			                                                    stream->in.wavex);
-
-		switch (answer){
-			case PWFA_OK: break;
-			case PWFA_NO: return paSampleFormatNotSupported;
-			case PWFA_SUGGESTED:
-			{
-				PRINT(("Suggested format:"));
-				LogWAVEFORMATEXTENSIBLE(stream->in.wavex);
-				if (stream->in.wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
-					//no problem its a format issue only
-				}
-				else{
-					return paInvalidSampleRate;
-				}
-			}
-		}
-
-        //stream->out.period = info.DefaultDevicePeriod;
-        stream->in.period = info.MinimumDevicePeriod;
-
-        hResult = stream->in.client->Initialize(
-            AUDCLNT_SHAREMODE_SHARED,
-            //AUDCLNT_SHAREMODE_EXCLUSIVE,
-            0,  //no flags
-            stream->in.period*3, //tripple buffer
-            0,//stream->out.period,
-            (WAVEFORMATEX*)&stream->in.wavex,
-            &stream->session
-            );
-
-        if (hResult != S_OK){
-            logAUDCLNT_E(hResult);
-            return paInvalidDevice;
-        }
-
-        hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize);
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        hResult = stream->in.client->GetStreamLatency(&stream->in.latency);
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period);
-        double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond;
-
-        //this is the number of samples that are required at each period
-        stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels
-
-        /* IMPLEMENT ME - establish which  host formats are available */
-        hostInputSampleFormat =
-            PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(stream->in.wavex), inputSampleFormat );
-	}
-    else
-    {
-        inputChannelCount = 0;
-        inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */
-    }
-
-    if( outputParameters )
-    {
-        outputChannelCount = outputParameters->channelCount;
-        outputSampleFormat = outputParameters->sampleFormat;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
-            return paInvalidDevice;
-
-        /* check that output device can support inputChannelCount */
-        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )
-            return paInvalidChannelCount;
-
-        /* validate outputStreamInfo */
-        if( outputParameters->hostApiSpecificStreamInfo )
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device];
-
-        HRESULT hResult = info.device->Activate(
-            __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL,
-            (void**)&stream->out.client);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        waveformatFromParams(stream->out.wavex,outputParameters,sampleRate);
-		
-		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(stream->out.client,
-			                                                    stream->out.wavex);
-
-		switch (answer){
-			case PWFA_OK: break;
-			case PWFA_NO: return paSampleFormatNotSupported;
-			case PWFA_SUGGESTED:
-			{
-				PRINT(("Suggested format:"));
-				LogWAVEFORMATEXTENSIBLE(stream->out.wavex);
-				if (stream->out.wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
-					//no problem its a format issue only
-				}
-				else{
-					return paInvalidSampleRate;
-				}
-			}
-		}
-
-        //stream->out.period = info.DefaultDevicePeriod;
-        stream->out.period = info.MinimumDevicePeriod;
-
-        hResult = stream->out.client->Initialize(
-            AUDCLNT_SHAREMODE_SHARED,
-            //AUDCLNT_SHAREMODE_EXCLUSIVE,
-            0,  //no flags
-            stream->out.period*3, //tripple buffer
-            0,//stream->out.period,
-            (WAVEFORMATEX*)&stream->out.wavex,
-            &stream->session
-            );
-
-        if (hResult != S_OK){
-            logAUDCLNT_E(hResult);
-            return paInvalidDevice;
-        }
-
-        hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize);
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        hResult = stream->out.client->GetStreamLatency(&stream->out.latency);
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period);
-        double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond;
-
-        //this is the number of samples that are required at each period
-        stream->out.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels
-
-        /* IMPLEMENT ME - establish which  host formats are available */
-        hostOutputSampleFormat =
-            PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(stream->out.wavex), outputSampleFormat );
-    }
-    else
-    {
-        outputChannelCount = 0;
-        outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */
-    }
-
-
-
-    /*
-        IMPLEMENT ME:
-
-        ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? )
-
-            - check that input device can support inputSampleFormat, or that
-                we have the capability to convert from outputSampleFormat to
-                a native format
-
-            - check that output device can support outputSampleFormat, or that
-                we have the capability to convert from outputSampleFormat to
-                a native format
-
-            - if a full duplex stream is requested, check that the combination
-                of input and output parameters is supported
-
-            - check that the device supports sampleRate
-
-            - alter sampleRate to a close allowable rate if possible / necessary
-
-            - validate suggestedInputLatency and suggestedOutputLatency parameters,
-                use default values where necessary
-    */
-
-
-
-    /* validate platform specific flags */
-    if( (streamFlags & paPlatformSpecificFlags) != 0 )
-        return paInvalidFlag; /* unexpected platform specific flag */
-
-
-
-    if( streamCallback )
-    {
-        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
-                                               &paWasapi->callbackStreamInterface, streamCallback, userData );
-    }
-    else
-    {
-        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
-                                               &paWasapi->blockingStreamInterface, streamCallback, userData );
-    }
-
-    PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate );
-
-
-	if (outputParameters && inputParameters){
-
-		//serious problem #1
-		if (stream->in.period != stream->out.period){
-			PRINT(("OpenStream: period discrepancy\n"));
-			goto error;
-		}
-
-		//serious problem #2
-		if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){
-			PRINT(("OpenStream: framesPerHostCallback discrepancy\n"));
-			goto error;
-		}
-	}
-
-	unsigned long framesPerHostCallback = (outputParameters)?
-		stream->out.framesPerHostCallback: 
-		stream->in.framesPerHostCallback;
-
-    /* we assume a fixed host buffer size in this example, but the buffer processor
-        can also support bounded and unknown host buffer sizes by passing
-        paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of
-        paUtilFixedHostBufferSize below. */
-
-    result =  PaUtil_InitializeBufferProcessor( &stream->bufferProcessor,
-              inputChannelCount, inputSampleFormat, hostInputSampleFormat,
-              outputChannelCount, outputSampleFormat, hostOutputSampleFormat,
-              sampleRate, streamFlags, framesPerBuffer,
-              framesPerHostCallback, paUtilFixedHostBufferSize,
-              streamCallback, userData );
-    if( result != paNoError )
-        goto error;
-
-
-    /*
-        IMPLEMENT ME: initialise the following fields with estimated or actual
-        values.
-    */
-    stream->streamRepresentation.streamInfo.inputLatency =
-            PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)
-			+ ((inputParameters)?nano100ToSeconds(stream->in.latency) :0);
-
-    stream->streamRepresentation.streamInfo.outputLatency =
-            PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)
-			+ ((outputParameters)?nano100ToSeconds(stream->out.latency) :0);
-
-    stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
-
-
-    *s = (PaStream*)stream;
-
-
-    return result;
-
-error:
-    if( stream )
-        PaUtil_FreeMemory( stream );
-
-    return result;
-}
-
-
-
-/*
-    When CloseStream() is called, the multi-api layer ensures that
-    the stream has already been stopped or aborted.
-*/
-
-#define SAFE_RELEASE(punk)  \
-              if ((punk) != NULL)  \
-                { (punk)->Release(); (punk) = NULL; }
-
-static PaError CloseStream( PaStream* s )
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /*
-        IMPLEMENT ME:
-            - additional stream closing + cleanup
-    */
-
-    SAFE_RELEASE(stream->out.client);
-    SAFE_RELEASE(stream->in.client);
-    SAFE_RELEASE(stream->cclient);
-    SAFE_RELEASE(stream->rclient);
-    CloseHandle(stream->hThread);
-
-    PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
-    PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
-    PaUtil_FreeMemory( stream );
-
-    return result;
-}
-
-VOID ProcThread(void *client);
-
-static PaError StartStream( PaStream *s )
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    PaUtil_ResetBufferProcessor( &stream->bufferProcessor );
-	
-	HRESULT hResult=S_OK;
-
-	if (stream->out.client){
-		hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient);
-		logAUDCLNT_E(hResult);
-		if (hResult!=S_OK)
-			return paUnanticipatedHostError;
-	}
-	
-	if (stream->in.client){
-	 hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient);
-		logAUDCLNT_E(hResult);
-		if (hResult!=S_OK)
-			return paUnanticipatedHostError;
-	}
-
-    // Create a thread for this client.
-    stream->hThread = CreateThread(
-        NULL,              // no security attribute
-        0,                 // default stack size
-        (LPTHREAD_START_ROUTINE) ProcThread,
-        (LPVOID) stream,    // thread parameter
-        0,                 // not suspended
-        &stream->dwThreadId);      // returns thread ID
-
-    if (stream->hThread == NULL)
-        return paUnanticipatedHostError;
-
-    return paNoError;
-}
-
-
-static PaError StopStream( PaStream *s )
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    stream->closeRequest = true;
-    //todo something MUCH better than this
-    while(stream->closeRequest)
-        Sleep(100);
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior */
-
-    stream->running = false;
-
-    return result;
-}
-
-
-static PaError AbortStream( PaStream *s )
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    stream->closeRequest = true;
-    //todo something MUCH better than this
-    while(stream->closeRequest)
-        Sleep(100);
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior */
-
-    return result;
-}
-
-
-static PaError IsStreamStopped( PaStream *s )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    return !stream->running;
-}
-
-
-static PaError IsStreamActive( PaStream *s )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-    return stream->running;
-}
-
-
-static PaTime GetStreamTime( PaStream *s )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-	//this is lame ds and mme does the same thing, quite useless method imho
-	//why dont we fetch the time in the pa callbacks?
-	//at least its doing to be clocked to something
-    return PaUtil_GetTime();
-}
-
-
-static double GetStreamCpuLoad( PaStream* s )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer );
-}
-
-
-/*
-    As separate stream interfaces are used for blocking and callback
-    streams, the following functions can be guaranteed to only be called
-    for blocking streams.
-*/
-
-static PaError ReadStream( PaStream* s,
-                           void *buffer,
-                           unsigned long frames )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    (void) buffer;
-    (void) frames;
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return paNoError;
-}
-
-
-static PaError WriteStream( PaStream* s,
-                            const void *buffer,
-                            unsigned long frames )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    (void) buffer;
-    (void) frames;
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return paNoError;
-}
-
-
-static signed long GetStreamReadAvailable( PaStream* s )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return 0;
-}
-
-
-static signed long GetStreamWriteAvailable( PaStream* s )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
-
-    /* suppress unused variable warnings */
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return 0;
-}
-
-
-
-/*
-    ExampleHostProcessingLoop() illustrates the kind of processing which may
-    occur in a host implementation.
-
-*/
-static void WaspiHostProcessingLoop( void *inputBuffer,  long inputFrames,
-                                     void *outputBuffer, long outputFrames,
-                                     void *userData )
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)userData;
-    PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */
-    int callbackResult;
-    unsigned long framesProcessed;
-
-    PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer );
-
-
-    /*
-        IMPLEMENT ME:
-            - generate timing information
-            - handle buffer slips
-    */
-
-    /*
-        If you need to byte swap or shift inputBuffer to convert it into a
-        portaudio format, do it here.
-    */
-
-
-
-    PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ );
-
-    /*
-        depending on whether the host buffers are interleaved, non-interleaved
-        or a mixture, you will want to call PaUtil_SetInterleaved*Channels(),
-        PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here.
-    */
-
-    if( stream->bufferProcessor.inputChannelCount > 0 )
-    {
-        PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames );
-        PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor,
-            0, /* first channel of inputBuffer is channel 0 */
-            inputBuffer,
-            0 ); /* 0 - use inputChannelCount passed to init buffer processor */
-    }
-
-    if( stream->bufferProcessor.outputChannelCount > 0 )
-    {
-        PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames);
-        PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor,
-            0, /* first channel of outputBuffer is channel 0 */
-            outputBuffer,
-            0 ); /* 0 - use outputChannelCount passed to init buffer processor */
-    }
-
-    /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing()
-        in general you would pass paContinue for normal operation, and
-        paComplete to drain the buffer processor's internal output buffer.
-        You can check whether the buffer processor's output buffer is empty
-        using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor )
-    */
-    callbackResult = paContinue;
-    framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult );
-
-
-    /*
-        If you need to byte swap or shift outputBuffer to convert it to
-        host format, do it here.
-    */
-
-    PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
-
-
-    if( callbackResult == paContinue )
-    {
-        /* nothing special to do */
-    }
-    else if( callbackResult == paAbort )
-    {
-        /* IMPLEMENT ME - finish playback immediately  */
-
-        /* once finished, call the finished callback */
-        if( stream->streamRepresentation.streamFinishedCallback != 0 )
-            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
-    }
-    else
-    {
-        /* User callback has asked us to stop with paComplete or other non-zero value */
-
-        /* IMPLEMENT ME - finish playback once currently queued audio has completed  */
-
-        /* once finished, call the finished callback */
-        if( stream->streamRepresentation.streamFinishedCallback != 0 )
-            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
-    }
-}
-
-
-
-VOID
-ProcThread(void *param){
-
-	HRESULT hResult;
-
-    DWORD stuff=0;
-    HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff);
-    if (!thCarac){
-        PRINT(("AvSetMmThreadCharacteristics failed!\n"));
-    }
-
-    BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL);
-    if (!prio){
-        PRINT(("AvSetMmThreadPriority failed!\n"));
-    }
-
-
-    PaWinWasapiStream *stream = (PaWinWasapiStream*)param;
-
-    HANDLE context;
-    GUID threadOrderGUID;
-    memset(&threadOrderGUID,0,sizeof(GUID));
-    LARGE_INTEGER large;
-
-    large.QuadPart = stream->out.period;
-
-    BOOL ok = pAvRtCreateThreadOrderingGroup(&context,
-        &large,
-        &threadOrderGUID,
-#ifdef _DEBUG
-        0 //THREAD_ORDER_GROUP_INFINITE_TIMEOUT
-#else
-        0 //default is 5 times the 2nd param
-#endif
-        //TEXT("Audio")
-        );
-
-    if (!ok){
-        PRINT(("AvRtCreateThreadOrderingGroup failed!\n"));
-    }
-
-	//debug
-    {
-        HANDLE hh       = GetCurrentThread();
-        int  currprio   = GetThreadPriority(hh);
-        DWORD currclass = GetPriorityClass(GetCurrentProcess());
-        PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass));
-    }
-
-
-    //fill up initial buffer latency??
-
-	if (stream->out.client){
-		hResult = stream->out.client->Start();
-		if (hResult != S_OK)
-			logAUDCLNT_E(hResult);
-	}
-
-    stream->running = true;
-
-    while(!stream->closeRequest){
-        BOOL answer = pAvRtWaitOnThreadOrderingGroup(context);
-        if (!answer){
-            PRINT(("AvRtWaitOnThreadOrderingGroup failed\n"));
-        }
-
-        unsigned long usingBS = stream->out.framesPerHostCallback;
-
-        UINT32 padding=0;
-        hResult = stream->out.client->GetCurrentPadding(&padding);
-        logAUDCLNT_E(hResult);
-
-        //buffer full dont pursue
-        if (padding == stream->out.bufferSize)
-            continue;
-
-        //if something is already inside
-        if (padding > 0){
-            usingBS = stream->out.bufferSize-padding;
-            if (usingBS > stream->out.framesPerHostCallback){
-                //PRINT(("underflow! %d\n",usingBS));
-            }
-            else if (usingBS < stream->out.framesPerHostCallback){
-                //PRINT(("overflow! %d\n",usingBS));
-            }
-        }
-        else
-            usingBS = stream->out.framesPerHostCallback;
-
-
-        BYTE*indata =0;
-        BYTE*outdata=0;
-
-        hResult = stream->rclient->GetBuffer(usingBS,&outdata);
-
-        if (hResult != S_OK || !outdata) {
-            logAUDCLNT_E(hResult);
-			continue;
-        }
-
-        WaspiHostProcessingLoop(indata, usingBS
-			                   ,outdata,usingBS,stream);
-
-        hResult = stream->rclient->ReleaseBuffer(usingBS,0);
-        if (hResult != S_OK)
-            logAUDCLNT_E(hResult);
-
-    }
-
-
-    BOOL bRes = pAvRtDeleteThreadOrderingGroup(context);
-    if (!bRes){
-        PRINT(("AvRtDeleteThreadOrderingGroup failure\n"));
-    }
-
-    stream->closeRequest = false;
-}
-
-
-
-
+/*
+ * Portable Audio I/O Library WASAPI implementation
+ * Copyright (c) 2006 David Viens
+ *
+ * Based on the Open Source API proposed by Ross Bencina
+ * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+/** @file
+ @ingroup hostaip_src
+ @brief WASAPI implementation of support for a host API.
+
+ @note This file is provided as a starting point for implementing support for
+ a new host API. IMPLEMENT ME comments are used to indicate functionality
+ which much be customised for each implementation.
+*/
+
+
+
+//these headers are only in Windows SDK CTP Feb 2006 and only work in VC 2005!
+#if _MSC_VER >= 1400
+#include <windows.h>
+#include <MMReg.h>  //must be before other Wasapi headers
+#include <strsafe.h>
+#include <mmdeviceapi.h>
+#include <Avrt.h>
+#include <audioclient.h>
+#include <KsMedia.h>
+#include <functiondiscoverykeys.h>  // PKEY_Device_FriendlyName
+#endif
+
+
+
+#include "pa_util.h"
+#include "pa_allocation.h"
+#include "pa_hostapi.h"
+#include "pa_stream.h"
+#include "pa_cpuload.h"
+#include "pa_process.h"
+
+
+
+/* prototypes for functions declared in this file */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+
+
+static void Terminate( struct PaUtilHostApiRepresentation *hostApi );
+static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
+                                  const PaStreamParameters *inputParameters,
+                                  const PaStreamParameters *outputParameters,
+                                  double sampleRate );
+static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
+                           PaStream** s,
+                           const PaStreamParameters *inputParameters,
+                           const PaStreamParameters *outputParameters,
+                           double sampleRate,
+                           unsigned long framesPerBuffer,
+                           PaStreamFlags streamFlags,
+                           PaStreamCallback *streamCallback,
+                           void *userData );
+static PaError CloseStream( PaStream* stream );
+static PaError StartStream( PaStream *stream );
+static PaError StopStream( PaStream *stream );
+static PaError AbortStream( PaStream *stream );
+static PaError IsStreamStopped( PaStream *s );
+static PaError IsStreamActive( PaStream *stream );
+static PaTime GetStreamTime( PaStream *stream );
+static double GetStreamCpuLoad( PaStream* stream );
+static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames );
+static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames );
+static signed long GetStreamReadAvailable( PaStream* stream );
+static signed long GetStreamWriteAvailable( PaStream* stream );
+
+
+/* IMPLEMENT ME: a macro like the following one should be used for reporting
+ host errors */
+#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \
+    PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText )
+
+/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */
+
+
+
+//dummy entry point for other compilers and sdks
+//currently built using RC1 SDK (5600)
+#if _MSC_VER < 1400
+
+PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){
+    return paNoError;
+}
+
+#else
+
+
+
+
+#define MAX_STR_LEN 512
+
+/*
+ These are fields that can be gathered from IDevice
+ and IAudioDevice PRIOR to Initialize, and done in first pass
+ i assume that neither of these will cause the Driver to "load",
+ but again, who knows how they implement their stuff
+ */
+typedef struct PaWinWasapiDeviceInfo
+{
+    //hmm is it wise to keep a reference until Terminate?
+    //TODO Check if that interface requires the driver to be loaded!
+    IMMDevice * device;
+
+    //Fields filled from IDevice
+    //from GetId
+    WCHAR szDeviceID[MAX_STR_LEN];
+    //from GetState
+    DWORD state;
+
+    //Fields filled from IMMEndpoint'sGetDataFlow
+    EDataFlow  flow;
+
+    //Fields filled from IAudioDevice (_prior_ to Initialize)
+    //from GetDevicePeriod(
+    REFERENCE_TIME  DefaultDevicePeriod;
+    REFERENCE_TIME  MinimumDevicePeriod;
+    //from GetMixFormat
+    WAVEFORMATEX   *MixFormat;//needs to be CoTaskMemFree'd after use!
+
+} PaWinWasapiDeviceInfo;
+
+
+typedef struct
+{
+    PaUtilHostApiRepresentation inheritedHostApiRep;
+    PaUtilStreamInterface callbackStreamInterface;
+    PaUtilStreamInterface blockingStreamInterface;
+
+    PaUtilAllocationGroup *allocations;
+
+    /* implementation specific data goes here */
+
+    //in case we later need the synch
+    IMMDeviceEnumerator * enumerator;
+
+    //this is the REAL number of devices, whether they are usefull to PA or not!
+    UINT deviceCount;
+
+    WCHAR defaultRenderer [MAX_STR_LEN];
+    WCHAR defaultCapturer [MAX_STR_LEN];
+
+    PaWinWasapiDeviceInfo   *devInfo;
+}PaWinWasapiHostApiRepresentation;
+
+
+/* PaWinWasapiStream - a stream data structure specifically for this implementation */
+
+typedef struct PaWinWasapiSubStream{
+    IAudioClient        *client;
+    WAVEFORMATEXTENSIBLE wavex;
+    UINT32               bufferSize;
+    REFERENCE_TIME       latency;
+    REFERENCE_TIME       period;
+    unsigned long framesPerHostCallback; /* just an example */
+}PaWinWasapiSubStream;
+
+typedef struct PaWinWasapiStream
+{ /* IMPLEMENT ME: rename this */
+    PaUtilStreamRepresentation streamRepresentation;
+    PaUtilCpuLoadMeasurer cpuLoadMeasurer;
+    PaUtilBufferProcessor bufferProcessor;
+
+    /* IMPLEMENT ME:
+            - implementation specific data goes here
+    */
+
+
+    //input
+	PaWinWasapiSubStream in;
+    IAudioCaptureClient *cclient;
+    
+	//output
+	PaWinWasapiSubStream out;
+    IAudioRenderClient  *rclient;
+
+
+    bool running;
+    bool closeRequest;
+
+    DWORD dwThreadId;
+    HANDLE hThread;
+
+    GUID  session;
+
+}PaWinWasapiStream;
+
+#define PRINT(x) PA_DEBUG(x);
+
+void
+logAUDCLNT_E(HRESULT res){
+
+    char *text = 0;
+    switch(res){
+        case S_OK: return; break;
+        case E_POINTER                              :text ="E_POINTER"; break;
+        case E_INVALIDARG                           :text ="E_INVALIDARG"; break;
+
+        case AUDCLNT_E_NOT_INITIALIZED              :text ="AUDCLNT_E_NOT_INITIALIZED"; break;
+        case AUDCLNT_E_ALREADY_INITIALIZED          :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break;
+        case AUDCLNT_E_WRONG_ENDPOINT_TYPE          :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break;
+        case AUDCLNT_E_DEVICE_INVALIDATED           :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break;
+        case AUDCLNT_E_NOT_STOPPED                  :text ="AUDCLNT_E_NOT_STOPPED"; break;
+        case AUDCLNT_E_BUFFER_TOO_LARGE             :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break;
+        case AUDCLNT_E_OUT_OF_ORDER                 :text ="AUDCLNT_E_OUT_OF_ORDER"; break;
+        case AUDCLNT_E_UNSUPPORTED_FORMAT           :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break;
+        case AUDCLNT_E_INVALID_SIZE                 :text ="AUDCLNT_E_INVALID_SIZE"; break;
+        case AUDCLNT_E_DEVICE_IN_USE                :text ="AUDCLNT_E_DEVICE_IN_USE"; break;
+        case AUDCLNT_E_BUFFER_OPERATION_PENDING     :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break;
+        case AUDCLNT_E_THREAD_NOT_REGISTERED        :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break;      
+		case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED   :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break;
+        case AUDCLNT_E_ENDPOINT_CREATE_FAILED       :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break;
+        case AUDCLNT_E_SERVICE_NOT_RUNNING          :text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; break;
+     //  case AUDCLNT_E_CPUUSAGE_EXCEEDED            :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break;
+     //Header error?
+        case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED     :text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; break;
+        case AUDCLNT_E_EXCLUSIVE_MODE_ONLY          :text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; break;
+        case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; break;
+        case AUDCLNT_E_EVENTHANDLE_NOT_SET          :text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; break;
+        case AUDCLNT_E_INCORRECT_BUFFER_SIZE        :text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; break;
+        case AUDCLNT_E_BUFFER_SIZE_ERROR            :text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; break;
+        case AUDCLNT_S_BUFFER_EMPTY                 :text ="AUDCLNT_S_BUFFER_EMPTY"; break;
+        case AUDCLNT_S_THREAD_ALREADY_REGISTERED    :text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; break;
+        default:
+            text =" dunno!";
+            return ;
+        break;
+
+    }
+    PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text));
+}
+
+inline double
+nano100ToMillis(const REFERENCE_TIME &ref){
+    //  1 nano = 0.000000001 seconds
+    //100 nano = 0.0000001   seconds
+    //100 nano = 0.0001   milliseconds
+    return ((double)ref)*0.0001;
+}
+
+inline double
+nano100ToSeconds(const REFERENCE_TIME &ref){
+    //  1 nano = 0.000000001 seconds
+    //100 nano = 0.0000001   seconds
+    //100 nano = 0.0001   milliseconds
+    return ((double)ref)*0.0000001;
+}
+
+#ifndef IF_FAILED_JUMP
+#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label;
+#endif
+
+
+
+//AVRT is the new "multimedia schedulling stuff"
+
+typedef BOOL   (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER);
+typedef BOOL   (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE);
+typedef BOOL   (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE);
+typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics)  (LPCTSTR,LPDWORD);
+typedef BOOL   (WINAPI *FAvSetMmThreadPriority)         (HANDLE,AVRT_PRIORITY);
+
+HMODULE  hDInputDLL = 0;
+FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0;
+FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0;
+FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0;
+FAvSetMmThreadCharacteristics  pAvSetMmThreadCharacteristics=0;
+FAvSetMmThreadPriority         pAvSetMmThreadPriority=0;
+
+#define setupPTR(fun, type, name)  {                                                        \
+                                        fun = (type) GetProcAddress(hDInputDLL,name);       \
+                                        if(fun == NULL) {                                   \
+                                            PRINT(("GetProcAddr failed for %s" ,name));     \
+                                            return false;                                   \
+                                        }                                                   \
+                                    }                                                       \
+
+bool
+setupAVRT(){
+
+    hDInputDLL = LoadLibraryA("avrt.dll");
+    if(hDInputDLL == NULL)
+        return false;
+
+    setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup");
+    setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup");
+    setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup");
+    setupPTR(pAvSetMmThreadCharacteristics,  FAvSetMmThreadCharacteristics,  "AvSetMmThreadCharacteristicsA");
+    setupPTR(pAvSetMmThreadPriority,         FAvSetMmThreadPriority,         "AvSetMmThreadPriority");
+
+    return true;
+}
+
+
+
+PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
+{
+    if (!setupAVRT()){
+        PRINT(("Windows WASAPI : No AVRT! (not VISTA?)"));
+        return paNoError;
+    }
+
+    CoInitialize(NULL);
+
+    PaError result = paNoError;
+    PaWinWasapiHostApiRepresentation *paWasapi;
+    PaDeviceInfo *deviceInfoArray;
+
+    paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) );
+    if( !paWasapi ){
+        result = paInsufficientMemory;
+        goto error;
+    }
+
+    paWasapi->allocations = PaUtil_CreateAllocationGroup();
+    if( !paWasapi->allocations ){
+        result = paInsufficientMemory;
+        goto error;
+    }
+
+    *hostApi = &paWasapi->inheritedHostApiRep;
+    (*hostApi)->info.structVersion = 1;
+    (*hostApi)->info.type = paWASAPI;
+    (*hostApi)->info.name = "Windows WASAPI";
+    (*hostApi)->info.deviceCount = 0;   //so far, we must investigate each
+    (*hostApi)->info.defaultInputDevice  = paNoDevice;  /* IMPLEMENT ME */
+    (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */
+
+
+    HRESULT hResult = S_OK;
+    IMMDeviceCollection* spEndpoints=0;
+    paWasapi->enumerator = 0;
+
+    if (!setupAVRT()){
+        PRINT(("Windows WASAPI : No AVRT! (not VISTA?)"));
+        goto error;
+    }
+
+    hResult = CoCreateInstance(
+             __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER,
+             __uuidof(IMMDeviceEnumerator),
+             (void**)&paWasapi->enumerator);
+
+    IF_FAILED_JUMP(hResult, error);
+
+    //getting default device ids in the eMultimedia "role"
+    {
+        {
+            IMMDevice* defaultRenderer=0;
+            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer);
+            IF_FAILED_JUMP(hResult, error);
+            WCHAR* pszDeviceId = NULL;
+            hResult = defaultRenderer->GetId(&pszDeviceId);
+            IF_FAILED_JUMP(hResult, error);
+            StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId);
+            CoTaskMemFree(pszDeviceId);
+            defaultRenderer->Release();
+        }
+
+        {
+            IMMDevice* defaultCapturer=0;
+            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer);
+            IF_FAILED_JUMP(hResult, error);
+            WCHAR* pszDeviceId = NULL;
+            hResult = defaultCapturer->GetId(&pszDeviceId);
+            IF_FAILED_JUMP(hResult, error);
+            StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId);
+            CoTaskMemFree(pszDeviceId);
+            defaultCapturer->Release();
+        }
+    }
+
+
+    hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints);
+    IF_FAILED_JUMP(hResult, error);
+
+    hResult = spEndpoints->GetCount(&paWasapi->deviceCount);
+    IF_FAILED_JUMP(hResult, error);
+
+    paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount];
+    {
+        for (size_t step=0;step<paWasapi->deviceCount;++step)
+            memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo));
+    }
+
+
+
+    if( paWasapi->deviceCount > 0 )
+    {
+        (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory(
+                paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount );
+        if( !(*hostApi)->deviceInfos ){
+            result = paInsufficientMemory;
+            goto error;
+        }
+
+        /* allocate all device info structs in a contiguous block */
+        deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory(
+                paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount );
+        if( !deviceInfoArray ){
+            result = paInsufficientMemory;
+            goto error;
+        }
+
+        for( UINT i=0; i < paWasapi->deviceCount; ++i ){
+
+            PaDeviceInfo *deviceInfo = &deviceInfoArray[i];
+            deviceInfo->structVersion = 2;
+            deviceInfo->hostApi = hostApiIndex;
+
+            hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device);
+            IF_FAILED_JUMP(hResult, error);
+
+            //getting ID
+            {
+                WCHAR* pszDeviceId = NULL;
+                hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId);
+                IF_FAILED_JUMP(hResult, error);
+                StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId);
+                CoTaskMemFree(pszDeviceId);
+
+                if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){
+                    //we found the default input!
+                    (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount;
+                }
+                if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){
+                    //we found the default output!
+                    (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount;
+                }
+            }
+
+            DWORD state=0;
+            hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state);
+            IF_FAILED_JUMP(hResult, error);
+
+            if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){
+                PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state));
+                //spDevice->Release();
+                //continue;
+            }
+
+            {
+                IPropertyStore* spProperties;
+                hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties);
+                IF_FAILED_JUMP(hResult, error);
+
+                //getting "Friendly" Name
+                {
+                    PROPVARIANT value;
+                    PropVariantInit(&value);
+                    hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value);
+                    IF_FAILED_JUMP(hResult, error);
+                    deviceInfo->name = 0;
+                    char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 );
+                    if( !deviceName ){
+                        result = paInsufficientMemory;
+                        goto error;
+                    }
+					if (value.pwszVal)
+						wcstombs(deviceName,   value.pwszVal,MAX_STR_LEN-1); //todo proper size	
+					else{
+						sprintf(deviceName,"baddev%d",i);
+					}
+
+                    deviceInfo->name = deviceName;
+                    PropVariantClear(&value);
+                }
+
+#if 0
+                DWORD numProps = 0;
+                hResult = spProperties->GetCount(&numProps);
+                IF_FAILED_JUMP(hResult, error);
+                {
+                    for (DWORD i=0;i<numProps;++i){
+                        PROPERTYKEY pkey;
+                        hResult = spProperties->GetAt(i,&pkey);
+
+                        PROPVARIANT value;
+                        PropVariantInit(&value);
+                        hResult = spProperties->GetValue(pkey, &value);
+
+                        switch(value.vt){
+                            case 11:
+                                PRINT(("property*%u*\n",value.ulVal));
+                            break;
+                            case 19:
+                                PRINT(("property*%d*\n",value.boolVal));
+                            break;
+                            case 31:
+                            {
+                                char temp[512];
+                                wcstombs(temp,    value.pwszVal,MAX_STR_LEN-1);
+                                PRINT(("property*%s*\n",temp));
+                            }
+                            break;
+                            default:break;
+                        }
+
+                        PropVariantClear(&value);
+                    }
+                }
+#endif
+
+                /*  These look interresting... but they are undocumented
+                PKEY_AudioEndpoint_FormFactor
+                PKEY_AudioEndpoint_ControlPanelPageProvider
+                PKEY_AudioEndpoint_Association
+                PKEY_AudioEndpoint_PhysicalSpeakerConfig
+                PKEY_AudioEngine_DeviceFormat
+                */
+                spProperties->Release();
+            }
+
+
+            //getting the Endpoint data
+            {
+                IMMEndpoint *endpoint=0;
+                hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint);
+                if (SUCCEEDED(hResult)){
+                    hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow);
+                    endpoint->Release();
+                }
+            }
+
+            //Getting a temporary IAudioDevice for more fields
+            //we make sure NOT to call Initialize yet!
+            {
+                IAudioClient *myClient=0;
+
+                hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
+                IF_FAILED_JUMP(hResult, error);
+
+                hResult = myClient->GetDevicePeriod(
+                    &paWasapi->devInfo[i].DefaultDevicePeriod,
+                    &paWasapi->devInfo[i].MinimumDevicePeriod);
+                IF_FAILED_JUMP(hResult, error);
+
+                hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat);
+
+                IF_FAILED_JUMP(hResult, error);
+                myClient->Release();
+            }
+
+            //we can now fill in portaudio device data
+            deviceInfo->maxInputChannels  = 0;  //for now
+            deviceInfo->maxOutputChannels = 0;  //for now
+
+            switch(paWasapi->devInfo[i].flow){
+                case eRender:
+                    //hum not exaclty maximum, more like "default"
+                    deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels;
+
+                    deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod);
+                    deviceInfo->defaultLowOutputLatency  = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod);
+                break;
+                case eCapture:
+                    //hum not exaclty maximum, more like "default"
+                    deviceInfo->maxInputChannels  = paWasapi->devInfo[i].MixFormat->nChannels;
+
+                    deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod);
+                    deviceInfo->defaultLowInputLatency  = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod);
+                break;
+                default:
+                    PRINT(("WASAPI device:%d bad Data FLow! \n",i));
+                    goto error;
+                break;
+            }
+
+            deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec;
+
+            (*hostApi)->deviceInfos[i] = deviceInfo;
+            ++(*hostApi)->info.deviceCount;
+        }
+    }
+
+    spEndpoints->Release();
+
+    (*hostApi)->Terminate = Terminate;
+    (*hostApi)->OpenStream = OpenStream;
+    (*hostApi)->IsFormatSupported = IsFormatSupported;
+
+    PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream,
+                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
+                                      GetStreamTime, GetStreamCpuLoad,
+                                      PaUtil_DummyRead, PaUtil_DummyWrite,
+                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable );
+
+    PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream,
+                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
+                                      GetStreamTime, PaUtil_DummyGetCpuLoad,
+                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable );
+
+    return result;
+
+error:
+
+    if (spEndpoints)
+        spEndpoints->Release();
+
+    if (paWasapi->enumerator)
+        paWasapi->enumerator->Release();
+
+    if( paWasapi )
+    {
+        if( paWasapi->allocations )
+        {
+            PaUtil_FreeAllAllocations( paWasapi->allocations );
+            PaUtil_DestroyAllocationGroup( paWasapi->allocations );
+        }
+
+        PaUtil_FreeMemory( paWasapi );
+    }
+    return result;
+}
+
+
+static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
+{
+    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+
+    paWasapi->enumerator->Release();
+
+    for (UINT i=0;i<paWasapi->deviceCount;++i){
+        PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i];
+
+        if (info->device)
+            info->device->Release();
+
+        if (info->MixFormat)
+            CoTaskMemFree(info->MixFormat);
+    }
+    delete [] paWasapi->devInfo;
+
+    CoUninitialize();
+
+    if( paWasapi->allocations ){
+        PaUtil_FreeAllAllocations( paWasapi->allocations );
+        PaUtil_DestroyAllocationGroup( paWasapi->allocations );
+    }
+
+    PaUtil_FreeMemory( paWasapi );
+}
+
+static void
+LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE &in){
+
+    const WAVEFORMATEX *old = (WAVEFORMATEX *)&in;
+
+	switch (old->wFormatTag){
+		case WAVE_FORMAT_EXTENSIBLE:{
+
+			PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n"));
+
+			if (in.SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){
+				PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n"));
+			}
+			else if (in.SubFormat == KSDATAFORMAT_SUBTYPE_PCM){
+				PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n"));
+			}
+			else{
+				PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n",	
+											in.SubFormat.Data1,
+											in.SubFormat.Data2,
+											in.SubFormat.Data3,
+											(int)in.SubFormat.Data4[0],
+											(int)in.SubFormat.Data4[1],
+											(int)in.SubFormat.Data4[2],
+											(int)in.SubFormat.Data4[3],
+											(int)in.SubFormat.Data4[4],
+											(int)in.SubFormat.Data4[5],
+											(int)in.SubFormat.Data4[6],
+											(int)in.SubFormat.Data4[7]));
+			}
+			PRINT(("Samples.wValidBitsPerSample=%d\n",  in.Samples.wValidBitsPerSample));
+			PRINT(("dwChannelMask=0x%X\n",in.dwChannelMask));
+		}break;
+		
+		case WAVE_FORMAT_PCM:        PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break;
+		case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break;
+		default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break;
+	}
+
+	PRINT(("nChannels      =%d\n",old->nChannels)); 
+	PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec));  
+	PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec));  
+	PRINT(("nBlockAlign    =%d\n",old->nBlockAlign));  
+	PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample));  
+	PRINT(("cbSize         =%d\n",old->cbSize));  
+}
+
+
+
+/*
+ WAVEFORMATXXX is always interleaved
+ */
+static PaSampleFormat
+waveformatToPaFormat(const WAVEFORMATEXTENSIBLE &in){
+
+    const WAVEFORMATEX *old = (WAVEFORMATEX *)&in;
+
+    switch (old->wFormatTag){
+
+        case WAVE_FORMAT_EXTENSIBLE:
+        {
+            if (in.SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){
+                if (in.Samples.wValidBitsPerSample == 32)
+                    return paFloat32;
+                else
+                    return paCustomFormat;
+            }
+            else if (in.SubFormat == KSDATAFORMAT_SUBTYPE_PCM){
+                switch (old->wBitsPerSample){
+                    case 32: return paInt32; break;
+                    case 24: return paInt24;break;
+                    case  8: return paUInt8;break;
+                    case 16: return paInt16;break;
+                    default: return paCustomFormat;break;
+                }
+            }
+            else
+                return paCustomFormat;
+        }
+        break;
+
+        case WAVE_FORMAT_IEEE_FLOAT:
+            return paFloat32;
+        break;
+
+        case WAVE_FORMAT_PCM:
+        {
+            switch (old->wBitsPerSample){
+                case 32: return paInt32; break;
+                case 24: return paInt24;break;
+                case  8: return paUInt8;break;
+                case 16: return paInt16;break;
+                default: return paCustomFormat;break;
+            }
+        }
+        break;
+
+        default:
+            return paCustomFormat;
+        break;
+    }
+
+    return paCustomFormat;
+}
+
+
+
+static PaError
+waveformatFromParams(WAVEFORMATEXTENSIBLE &wav,
+                          const PaStreamParameters * params,
+                          double sampleRate){
+
+    size_t bytesPerSample = 0;
+    switch( params->sampleFormat & ~paNonInterleaved ){
+        case paFloat32:
+        case paInt32: bytesPerSample=4;break;
+        case paInt16: bytesPerSample=2;break;
+        case paInt24: bytesPerSample=3;break;
+        case paInt8:
+        case paUInt8: bytesPerSample=1;break;
+        case paCustomFormat:
+        default: return paSampleFormatNotSupported;break;
+    }
+
+    memset(&wav,0,sizeof(WAVEFORMATEXTENSIBLE));
+
+    WAVEFORMATEX *old    = (WAVEFORMATEX *)&wav;
+    old->nChannels       = (WORD)params->channelCount;
+    old->nSamplesPerSec  = (DWORD)sampleRate;
+    old->wBitsPerSample  = bytesPerSample*8;
+    old->nAvgBytesPerSec = old->nSamplesPerSec * old->nChannels * bytesPerSample;
+    old->nBlockAlign     = (WORD)(old->nChannels * bytesPerSample);
+
+    //WAVEFORMATEX
+    if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){
+        old->cbSize          = 0;
+        old->wFormatTag      = WAVE_FORMAT_PCM;
+    }
+    //WAVEFORMATEXTENSIBLE
+    else{
+        old->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
+
+        old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX);
+
+        if ((params->sampleFormat & ~paNonInterleaved) == paFloat32)
+            wav.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
+        else
+            wav.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+
+        wav.Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding!
+
+        switch(params->channelCount){
+            case 1:  wav.dwChannelMask = SPEAKER_FRONT_CENTER; break;
+            case 2:  wav.dwChannelMask = 0x1 | 0x2; break;
+            case 4:  wav.dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break;
+            case 6:  wav.dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break;
+            case 8:  wav.dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break;
+            default: wav.dwChannelMask = 0; break;
+        }
+    }
+
+    return paNoError;
+}
+
+
+enum PaWasapiFormatAnswer {PWFA_OK,PWFA_NO,PWFA_SUGGESTED};
+
+
+static PaWasapiFormatAnswer 
+IsFormatSupportedInternal(IAudioClient * myClient, WAVEFORMATEXTENSIBLE &wavex){
+
+	PaWasapiFormatAnswer answer = PWFA_OK;
+
+    WAVEFORMATEX *closestMatch=0;
+    HRESULT hResult = myClient->IsFormatSupported(
+        //AUDCLNT_SHAREMODE_EXCLUSIVE,
+        AUDCLNT_SHAREMODE_SHARED,
+        (WAVEFORMATEX*)&wavex,&closestMatch);
+
+	if (hResult == S_OK)
+		answer = PWFA_OK;
+    else if (closestMatch){
+        WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)closestMatch;
+		
+		if (closestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
+			memcpy(&wavex,closestMatch,sizeof(WAVEFORMATEXTENSIBLE));
+		else
+			memcpy(&wavex,closestMatch,sizeof(WAVEFORMATEX));
+
+        CoTaskMemFree(closestMatch);
+		answer = PWFA_SUGGESTED;
+	
+	}else if (hResult != S_OK){
+		logAUDCLNT_E(hResult);
+		answer = PWFA_NO;
+	}
+
+	return answer;
+}
+
+
+static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
+                                  const PaStreamParameters *inputParameters,
+                                  const PaStreamParameters *outputParameters,
+                                  double sampleRate )
+{
+    int inputChannelCount, outputChannelCount;
+    PaSampleFormat inputSampleFormat, outputSampleFormat;
+
+    if( inputParameters )
+    {
+        inputChannelCount = inputParameters->channelCount;
+        inputSampleFormat = inputParameters->sampleFormat;
+
+        /* all standard sample formats are supported by the buffer adapter,
+            this implementation doesn't support any custom sample formats */
+        if( inputSampleFormat & paCustomFormat )
+            return paSampleFormatNotSupported;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that input device can support inputChannelCount */
+        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )
+            return paInvalidChannelCount;
+
+        /* validate inputStreamInfo */
+        if( inputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+
+        WAVEFORMATEXTENSIBLE wavex;
+        waveformatFromParams(wavex,inputParameters,sampleRate);
+	
+		IAudioClient *myClient=0;
+		HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate(
+			__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
+		if (hResult != S_OK){
+			logAUDCLNT_E(hResult);
+			return paInvalidDevice;
+		}
+
+		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(myClient,wavex);
+		myClient->Release();
+
+		switch (answer){
+			case PWFA_OK: break;
+			case PWFA_NO: return paSampleFormatNotSupported;
+			case PWFA_SUGGESTED:
+			{
+				PRINT(("Suggested format:"));
+				LogWAVEFORMATEXTENSIBLE(wavex);
+				if (wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
+					//no problem its a format issue only
+				}
+				else{
+					return paInvalidSampleRate;
+				}
+			}
+		}
+
+
+    }
+    else
+    {
+        inputChannelCount = 0;
+    }
+
+    if( outputParameters )
+    {
+        outputChannelCount = outputParameters->channelCount;
+        outputSampleFormat = outputParameters->sampleFormat;
+
+        /* all standard sample formats are supported by the buffer adapter,
+            this implementation doesn't support any custom sample formats */
+        if( outputSampleFormat & paCustomFormat )
+            return paSampleFormatNotSupported;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that output device can support outputChannelCount */
+        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )
+            return paInvalidChannelCount;
+
+        /* validate outputStreamInfo */
+        if( outputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+
+        WAVEFORMATEXTENSIBLE wavex;
+        waveformatFromParams(wavex,outputParameters,sampleRate);
+	
+		IAudioClient *myClient=0;
+		HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate(
+			__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
+		if (hResult != S_OK){
+			logAUDCLNT_E(hResult);
+			return paInvalidDevice;
+		}
+
+		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(myClient,wavex);
+		myClient->Release();
+
+		switch (answer){
+			case PWFA_OK: break;
+			case PWFA_NO: return paSampleFormatNotSupported;
+			case PWFA_SUGGESTED:
+			{
+				PRINT(("Suggested format:"));
+				LogWAVEFORMATEXTENSIBLE(wavex);
+				if (wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
+					//no problem its a format issue only
+				}
+				else{
+					return paInvalidSampleRate;
+				}
+			}
+		}
+
+
+    }
+    else
+    {
+        outputChannelCount = 0;
+    }
+
+
+    return paFormatIsSupported;
+}
+
+
+
+/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */
+
+static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
+                           PaStream** s,
+                           const PaStreamParameters *inputParameters,
+                           const PaStreamParameters *outputParameters,
+                           double sampleRate,
+                           unsigned long framesPerBuffer,
+                           PaStreamFlags streamFlags,
+                           PaStreamCallback *streamCallback,
+                           void *userData )
+{
+    PaError result = paNoError;
+    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+    PaWinWasapiStream *stream = 0;
+    int inputChannelCount, outputChannelCount;
+    PaSampleFormat inputSampleFormat, outputSampleFormat;
+    PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
+
+
+    stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) );
+    if( !stream ){
+        result = paInsufficientMemory;
+        goto error;
+    }
+
+    if( inputParameters )
+    {
+        inputChannelCount = inputParameters->channelCount;
+        inputSampleFormat = inputParameters->sampleFormat;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that input device can support inputChannelCount */
+        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )
+            return paInvalidChannelCount;
+
+        /* validate inputStreamInfo */
+        if( inputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device];
+
+        HRESULT hResult = info.device->Activate(
+            __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL,
+            (void**)&stream->in.client);
+
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        waveformatFromParams(stream->in.wavex,outputParameters,sampleRate);
+		
+		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(stream->in.client,
+			                                                    stream->in.wavex);
+
+		switch (answer){
+			case PWFA_OK: break;
+			case PWFA_NO: return paSampleFormatNotSupported;
+			case PWFA_SUGGESTED:
+			{
+				PRINT(("Suggested format:"));
+				LogWAVEFORMATEXTENSIBLE(stream->in.wavex);
+				if (stream->in.wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
+					//no problem its a format issue only
+				}
+				else{
+					return paInvalidSampleRate;
+				}
+			}
+		}
+
+        //stream->out.period = info.DefaultDevicePeriod;
+        stream->in.period = info.MinimumDevicePeriod;
+
+        hResult = stream->in.client->Initialize(
+            AUDCLNT_SHAREMODE_SHARED,
+            //AUDCLNT_SHAREMODE_EXCLUSIVE,
+            0,  //no flags
+            stream->in.period*3, //tripple buffer
+            0,//stream->out.period,
+            (WAVEFORMATEX*)&stream->in.wavex,
+            &stream->session
+            );
+
+        if (hResult != S_OK){
+            logAUDCLNT_E(hResult);
+            return paInvalidDevice;
+        }
+
+        hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        hResult = stream->in.client->GetStreamLatency(&stream->in.latency);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period);
+        double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond;
+
+        //this is the number of samples that are required at each period
+        stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels
+
+        /* IMPLEMENT ME - establish which  host formats are available */
+        hostInputSampleFormat =
+            PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(stream->in.wavex), inputSampleFormat );
+	}
+    else
+    {
+        inputChannelCount = 0;
+        inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */
+    }
+
+    if( outputParameters )
+    {
+        outputChannelCount = outputParameters->channelCount;
+        outputSampleFormat = outputParameters->sampleFormat;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that output device can support inputChannelCount */
+        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )
+            return paInvalidChannelCount;
+
+        /* validate outputStreamInfo */
+        if( outputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device];
+
+        HRESULT hResult = info.device->Activate(
+            __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL,
+            (void**)&stream->out.client);
+
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        waveformatFromParams(stream->out.wavex,outputParameters,sampleRate);
+		
+		PaWasapiFormatAnswer answer = IsFormatSupportedInternal(stream->out.client,
+			                                                    stream->out.wavex);
+
+		switch (answer){
+			case PWFA_OK: break;
+			case PWFA_NO: return paSampleFormatNotSupported;
+			case PWFA_SUGGESTED:
+			{
+				PRINT(("Suggested format:"));
+				LogWAVEFORMATEXTENSIBLE(stream->out.wavex);
+				if (stream->out.wavex.Format.nSamplesPerSec == (DWORD)sampleRate){
+					//no problem its a format issue only
+				}
+				else{
+					return paInvalidSampleRate;
+				}
+			}
+		}
+
+        //stream->out.period = info.DefaultDevicePeriod;
+        stream->out.period = info.MinimumDevicePeriod;
+
+        hResult = stream->out.client->Initialize(
+            AUDCLNT_SHAREMODE_SHARED,
+            //AUDCLNT_SHAREMODE_EXCLUSIVE,
+            0,  //no flags
+            stream->out.period*3, //tripple buffer
+            0,//stream->out.period,
+            (WAVEFORMATEX*)&stream->out.wavex,
+            &stream->session
+            );
+
+        if (hResult != S_OK){
+            logAUDCLNT_E(hResult);
+            return paInvalidDevice;
+        }
+
+        hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        hResult = stream->out.client->GetStreamLatency(&stream->out.latency);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period);
+        double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond;
+
+        //this is the number of samples that are required at each period
+        stream->out.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels
+
+        /* IMPLEMENT ME - establish which  host formats are available */
+        hostOutputSampleFormat =
+            PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(stream->out.wavex), outputSampleFormat );
+    }
+    else
+    {
+        outputChannelCount = 0;
+        outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */
+    }
+
+
+
+    /*
+        IMPLEMENT ME:
+
+        ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? )
+
+            - check that input device can support inputSampleFormat, or that
+                we have the capability to convert from outputSampleFormat to
+                a native format
+
+            - check that output device can support outputSampleFormat, or that
+                we have the capability to convert from outputSampleFormat to
+                a native format
+
+            - if a full duplex stream is requested, check that the combination
+                of input and output parameters is supported
+
+            - check that the device supports sampleRate
+
+            - alter sampleRate to a close allowable rate if possible / necessary
+
+            - validate suggestedInputLatency and suggestedOutputLatency parameters,
+                use default values where necessary
+    */
+
+
+
+    /* validate platform specific flags */
+    if( (streamFlags & paPlatformSpecificFlags) != 0 )
+        return paInvalidFlag; /* unexpected platform specific flag */
+
+
+
+    if( streamCallback )
+    {
+        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
+                                               &paWasapi->callbackStreamInterface, streamCallback, userData );
+    }
+    else
+    {
+        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
+                                               &paWasapi->blockingStreamInterface, streamCallback, userData );
+    }
+
+    PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate );
+
+
+	if (outputParameters && inputParameters){
+
+		//serious problem #1
+		if (stream->in.period != stream->out.period){
+			PRINT(("OpenStream: period discrepancy\n"));
+			goto error;
+		}
+
+		//serious problem #2
+		if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){
+			PRINT(("OpenStream: framesPerHostCallback discrepancy\n"));
+			goto error;
+		}
+	}
+
+	unsigned long framesPerHostCallback = (outputParameters)?
+		stream->out.framesPerHostCallback: 
+		stream->in.framesPerHostCallback;
+
+    /* we assume a fixed host buffer size in this example, but the buffer processor
+        can also support bounded and unknown host buffer sizes by passing
+        paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of
+        paUtilFixedHostBufferSize below. */
+
+    result =  PaUtil_InitializeBufferProcessor( &stream->bufferProcessor,
+              inputChannelCount, inputSampleFormat, hostInputSampleFormat,
+              outputChannelCount, outputSampleFormat, hostOutputSampleFormat,
+              sampleRate, streamFlags, framesPerBuffer,
+              framesPerHostCallback, paUtilFixedHostBufferSize,
+              streamCallback, userData );
+    if( result != paNoError )
+        goto error;
+
+
+    /*
+        IMPLEMENT ME: initialise the following fields with estimated or actual
+        values.
+    */
+    stream->streamRepresentation.streamInfo.inputLatency =
+            PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)
+			+ ((inputParameters)?nano100ToSeconds(stream->in.latency) :0);
+
+    stream->streamRepresentation.streamInfo.outputLatency =
+            PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)
+			+ ((outputParameters)?nano100ToSeconds(stream->out.latency) :0);
+
+    stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
+
+
+    *s = (PaStream*)stream;
+
+
+    return result;
+
+error:
+    if( stream )
+        PaUtil_FreeMemory( stream );
+
+    return result;
+}
+
+
+
+/*
+    When CloseStream() is called, the multi-api layer ensures that
+    the stream has already been stopped or aborted.
+*/
+
+#define SAFE_RELEASE(punk)  \
+              if ((punk) != NULL)  \
+                { (punk)->Release(); (punk) = NULL; }
+
+static PaError CloseStream( PaStream* s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /*
+        IMPLEMENT ME:
+            - additional stream closing + cleanup
+    */
+
+    SAFE_RELEASE(stream->out.client);
+    SAFE_RELEASE(stream->in.client);
+    SAFE_RELEASE(stream->cclient);
+    SAFE_RELEASE(stream->rclient);
+    CloseHandle(stream->hThread);
+
+    PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
+    PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
+    PaUtil_FreeMemory( stream );
+
+    return result;
+}
+
+VOID ProcThread(void *client);
+
+static PaError StartStream( PaStream *s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    PaUtil_ResetBufferProcessor( &stream->bufferProcessor );
+	
+	HRESULT hResult=S_OK;
+
+	if (stream->out.client){
+		hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient);
+		logAUDCLNT_E(hResult);
+		if (hResult!=S_OK)
+			return paUnanticipatedHostError;
+	}
+	
+	if (stream->in.client){
+	 hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient);
+		logAUDCLNT_E(hResult);
+		if (hResult!=S_OK)
+			return paUnanticipatedHostError;
+	}
+
+    // Create a thread for this client.
+    stream->hThread = CreateThread(
+        NULL,              // no security attribute
+        0,                 // default stack size
+        (LPTHREAD_START_ROUTINE) ProcThread,
+        (LPVOID) stream,    // thread parameter
+        0,                 // not suspended
+        &stream->dwThreadId);      // returns thread ID
+
+    if (stream->hThread == NULL)
+        return paUnanticipatedHostError;
+
+    return paNoError;
+}
+
+
+static PaError StopStream( PaStream *s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    stream->closeRequest = true;
+    //todo something MUCH better than this
+    while(stream->closeRequest)
+        Sleep(100);
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior */
+
+    stream->running = false;
+
+    return result;
+}
+
+
+static PaError AbortStream( PaStream *s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    stream->closeRequest = true;
+    //todo something MUCH better than this
+    while(stream->closeRequest)
+        Sleep(100);
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior */
+
+    return result;
+}
+
+
+static PaError IsStreamStopped( PaStream *s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    return !stream->running;
+}
+
+
+static PaError IsStreamActive( PaStream *s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+    return stream->running;
+}
+
+
+static PaTime GetStreamTime( PaStream *s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+	//this is lame ds and mme does the same thing, quite useless method imho
+	//why dont we fetch the time in the pa callbacks?
+	//at least its doing to be clocked to something
+    return PaUtil_GetTime();
+}
+
+
+static double GetStreamCpuLoad( PaStream* s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer );
+}
+
+
+/*
+    As separate stream interfaces are used for blocking and callback
+    streams, the following functions can be guaranteed to only be called
+    for blocking streams.
+*/
+
+static PaError ReadStream( PaStream* s,
+                           void *buffer,
+                           unsigned long frames )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) buffer;
+    (void) frames;
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return paNoError;
+}
+
+
+static PaError WriteStream( PaStream* s,
+                            const void *buffer,
+                            unsigned long frames )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) buffer;
+    (void) frames;
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return paNoError;
+}
+
+
+static signed long GetStreamReadAvailable( PaStream* s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return 0;
+}
+
+
+static signed long GetStreamWriteAvailable( PaStream* s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return 0;
+}
+
+
+
+/*
+    ExampleHostProcessingLoop() illustrates the kind of processing which may
+    occur in a host implementation.
+
+*/
+static void WaspiHostProcessingLoop( void *inputBuffer,  long inputFrames,
+                                     void *outputBuffer, long outputFrames,
+                                     void *userData )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)userData;
+    PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */
+    int callbackResult;
+    unsigned long framesProcessed;
+
+    PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer );
+
+
+    /*
+        IMPLEMENT ME:
+            - generate timing information
+            - handle buffer slips
+    */
+
+    /*
+        If you need to byte swap or shift inputBuffer to convert it into a
+        portaudio format, do it here.
+    */
+
+
+
+    PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ );
+
+    /*
+        depending on whether the host buffers are interleaved, non-interleaved
+        or a mixture, you will want to call PaUtil_SetInterleaved*Channels(),
+        PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here.
+    */
+
+    if( stream->bufferProcessor.inputChannelCount > 0 )
+    {
+        PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames );
+        PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor,
+            0, /* first channel of inputBuffer is channel 0 */
+            inputBuffer,
+            0 ); /* 0 - use inputChannelCount passed to init buffer processor */
+    }
+
+    if( stream->bufferProcessor.outputChannelCount > 0 )
+    {
+        PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames);
+        PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor,
+            0, /* first channel of outputBuffer is channel 0 */
+            outputBuffer,
+            0 ); /* 0 - use outputChannelCount passed to init buffer processor */
+    }
+
+    /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing()
+        in general you would pass paContinue for normal operation, and
+        paComplete to drain the buffer processor's internal output buffer.
+        You can check whether the buffer processor's output buffer is empty
+        using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor )
+    */
+    callbackResult = paContinue;
+    framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult );
+
+
+    /*
+        If you need to byte swap or shift outputBuffer to convert it to
+        host format, do it here.
+    */
+
+    PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
+
+
+    if( callbackResult == paContinue )
+    {
+        /* nothing special to do */
+    }
+    else if( callbackResult == paAbort )
+    {
+        /* IMPLEMENT ME - finish playback immediately  */
+
+        /* once finished, call the finished callback */
+        if( stream->streamRepresentation.streamFinishedCallback != 0 )
+            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
+    }
+    else
+    {
+        /* User callback has asked us to stop with paComplete or other non-zero value */
+
+        /* IMPLEMENT ME - finish playback once currently queued audio has completed  */
+
+        /* once finished, call the finished callback */
+        if( stream->streamRepresentation.streamFinishedCallback != 0 )
+            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
+    }
+}
+
+
+
+VOID
+ProcThread(void *param){
+
+	HRESULT hResult;
+
+    DWORD stuff=0;
+    HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff);
+    if (!thCarac){
+        PRINT(("AvSetMmThreadCharacteristics failed!\n"));
+    }
+
+    BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL);
+    if (!prio){
+        PRINT(("AvSetMmThreadPriority failed!\n"));
+    }
+
+
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)param;
+
+    HANDLE context;
+    GUID threadOrderGUID;
+    memset(&threadOrderGUID,0,sizeof(GUID));
+    LARGE_INTEGER large;
+
+    large.QuadPart = stream->out.period;
+
+    BOOL ok = pAvRtCreateThreadOrderingGroup(&context,
+        &large,
+        &threadOrderGUID,
+#ifdef _DEBUG
+        0 //THREAD_ORDER_GROUP_INFINITE_TIMEOUT
+#else
+        0 //default is 5 times the 2nd param
+#endif
+        //TEXT("Audio")
+        );
+
+    if (!ok){
+        PRINT(("AvRtCreateThreadOrderingGroup failed!\n"));
+    }
+
+	//debug
+    {
+        HANDLE hh       = GetCurrentThread();
+        int  currprio   = GetThreadPriority(hh);
+        DWORD currclass = GetPriorityClass(GetCurrentProcess());
+        PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass));
+    }
+
+
+    //fill up initial buffer latency??
+
+	if (stream->out.client){
+		hResult = stream->out.client->Start();
+		if (hResult != S_OK)
+			logAUDCLNT_E(hResult);
+	}
+
+    stream->running = true;
+
+    while(!stream->closeRequest){
+        BOOL answer = pAvRtWaitOnThreadOrderingGroup(context);
+        if (!answer){
+            PRINT(("AvRtWaitOnThreadOrderingGroup failed\n"));
+        }
+
+        unsigned long usingBS = stream->out.framesPerHostCallback;
+
+        UINT32 padding=0;
+        hResult = stream->out.client->GetCurrentPadding(&padding);
+        logAUDCLNT_E(hResult);
+
+        //buffer full dont pursue
+        if (padding == stream->out.bufferSize)
+            continue;
+
+        //if something is already inside
+        if (padding > 0){
+            usingBS = stream->out.bufferSize-padding;
+            if (usingBS > stream->out.framesPerHostCallback){
+                //PRINT(("underflow! %d\n",usingBS));
+            }
+            else if (usingBS < stream->out.framesPerHostCallback){
+                //PRINT(("overflow! %d\n",usingBS));
+            }
+        }
+        else
+            usingBS = stream->out.framesPerHostCallback;
+
+
+        BYTE*indata =0;
+        BYTE*outdata=0;
+
+        hResult = stream->rclient->GetBuffer(usingBS,&outdata);
+
+        if (hResult != S_OK || !outdata) {
+            logAUDCLNT_E(hResult);
+			continue;
+        }
+
+        WaspiHostProcessingLoop(indata, usingBS
+			                   ,outdata,usingBS,stream);
+
+        hResult = stream->rclient->ReleaseBuffer(usingBS,0);
+        if (hResult != S_OK)
+            logAUDCLNT_E(hResult);
+
+    }
+
+
+    BOOL bRes = pAvRtDeleteThreadOrderingGroup(context);
+    if (!bRes){
+        PRINT(("AvRtDeleteThreadOrderingGroup failure\n"));
+    }
+
+    stream->closeRequest = false;
+}
+
+
+
+
 #endif //VC 2005
\ No newline at end of file

Modified: freeswitch/trunk/libs/portaudio/test/patest_read_write_wire.c
==============================================================================
--- freeswitch/trunk/libs/portaudio/test/patest_read_write_wire.c	(original)
+++ freeswitch/trunk/libs/portaudio/test/patest_read_write_wire.c	Fri Sep 21 14:49:14 2007
@@ -1,202 +1,202 @@
-/** @file patest_read_write_wire.c
-	@ingroup test_src
-	@brief Tests full duplex blocking I/O by passing input straight to output.
-	@author Bjorn Roche. XO Audio LLC for Z-Systems Engineering.
-    @author based on code by: Phil Burk  http://www.softsynth.com
-    @author based on code by: Ross Bencina rossb at audiomulch.com
-*/
-/*
- * $Id: patest_read_record.c 757 2004-02-13 07:48:10Z rossbencina $
- *
- * This program uses the PortAudio Portable Audio Library.
- * For more information see: http://www.portaudio.com
- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however, 
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
- * license above.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "portaudio.h"
-
-/* #define SAMPLE_RATE  (17932) // Test failure to open with this value. */
-#define SAMPLE_RATE  (44100)
-#define FRAMES_PER_BUFFER (1024)
-#define NUM_CHANNELS    (2)
-/* #define DITHER_FLAG     (paDitherOff)  */
-#define DITHER_FLAG     (0) /**/
-
-/* Select sample format. */
-#if 1
-#define PA_SAMPLE_TYPE  paFloat32
-typedef float SAMPLE;
-#define SAMPLE_SILENCE  (0.0f)
-#define PRINTF_S_FORMAT "%.8f"
-#elif 1
-#define PA_SAMPLE_TYPE  paInt16
-typedef short SAMPLE;
-#define SAMPLE_SILENCE  (0)
-#define PRINTF_S_FORMAT "%d"
-#elif 0
-#define PA_SAMPLE_TYPE  paInt8
-typedef char SAMPLE;
-#define SAMPLE_SILENCE  (0)
-#define PRINTF_S_FORMAT "%d"
-#else
-#define PA_SAMPLE_TYPE  paUInt8
-typedef unsigned char SAMPLE;
-#define SAMPLE_SILENCE  (128)
-#define PRINTF_S_FORMAT "%d"
-#endif
-
-
-/*******************************************************************/
-int main(void);
-int main(void)
-{
-    PaStreamParameters inputParameters, outputParameters;
-    PaStream *stream = NULL;
-    PaError err;
-    SAMPLE *sampleBlock;
-    int i;
-    int numBytes;
-    
-    
-    printf("patest_read_write_wire.c\n"); fflush(stdout);
-
-    numBytes = FRAMES_PER_BUFFER * NUM_CHANNELS * sizeof(SAMPLE);
-    sampleBlock = (SAMPLE *) malloc( numBytes );
-    if( sampleBlock == NULL )
-    {
-        printf("Could not allocate record array.\n");
-        exit(1);
-    }
-    for( i=0; i<FRAMES_PER_BUFFER*NUM_CHANNELS; i++ )
-        sampleBlock[i] = (SAMPLE_SILENCE);
-
-    err = Pa_Initialize();
-    if( err != paNoError ) goto error;
-
-    inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */
-    printf( "Input device # %d.\n", inputParameters.device );
-    printf( "Input LL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency );
-    printf( "Input HL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency );
-    inputParameters.channelCount = NUM_CHANNELS;
-    inputParameters.sampleFormat = PA_SAMPLE_TYPE;
-    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency ;
-    inputParameters.hostApiSpecificStreamInfo = NULL;
-
-    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
-    printf( "Output device # %d.\n", outputParameters.device );
-    printf( "Output LL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency );
-    printf( "Output HL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency );
-    outputParameters.channelCount = NUM_CHANNELS;
-    outputParameters.sampleFormat = PA_SAMPLE_TYPE;
-    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-
-    /* -- setup -- */
-
-   err = Pa_OpenStream(
-              &stream,
-              &inputParameters,
-              &outputParameters,
-              SAMPLE_RATE,
-              FRAMES_PER_BUFFER,
-              paClipOff,      /* we won't output out of range samples so don't bother clipping them */
-              NULL, /* no callback, use blocking API */
-              NULL ); /* no callback, so no callback userData */
-    if( err != paNoError ) goto error;
-
-    err = Pa_StartStream( stream );
-    if( err != paNoError ) goto error;
-    printf("Wire on. Will run one minute.\n"); fflush(stdout);
-
-    for( i=0; i<(60*SAMPLE_RATE)/FRAMES_PER_BUFFER; ++i )
-    {
-       err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
-       if( err ) goto xrun;
-       err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
-       if( err ) goto xrun;
-    }
-    err = Pa_StopStream( stream );
-    if( err != paNoError ) goto error;
-
-    for( i=0; i<FRAMES_PER_BUFFER*NUM_CHANNELS; i++ )
-        sampleBlock[i] = (SAMPLE_SILENCE);
-
-    err = Pa_StartStream( stream );
-    if( err != paNoError ) goto error;
-    printf("Wire on. Interrupt to stop.\n"); fflush(stdout);
-
-    while( 1 )
-    {
-       err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
-       if( err ) goto xrun;
-       err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
-       if( err ) goto xrun;
-    }
-    err = Pa_StopStream( stream );
-    if( err != paNoError ) goto error;
-
-    Pa_CloseStream( stream );
-
-    free( sampleBlock );
-
-    Pa_Terminate();
-    return 0;
-
-xrun:
-    if( stream ) {
-       Pa_AbortStream( stream );
-       Pa_CloseStream( stream );
-    }
-    free( sampleBlock );
-    Pa_Terminate();
-    if( err & paInputOverflow )
-       fprintf( stderr, "Input Overflow.\n" );
-    if( err & paOutputUnderflow )
-       fprintf( stderr, "Output Underflow.\n" );
-    return -2;
-
-error:
-    if( stream ) {
-       Pa_AbortStream( stream );
-       Pa_CloseStream( stream );
-    }
-    free( sampleBlock );
-    Pa_Terminate();
-    fprintf( stderr, "An error occured while using the portaudio stream\n" );
-    fprintf( stderr, "Error number: %d\n", err );
-    fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
-    return -1;
-}
-
+/** @file patest_read_write_wire.c
+	@ingroup test_src
+	@brief Tests full duplex blocking I/O by passing input straight to output.
+	@author Bjorn Roche. XO Audio LLC for Z-Systems Engineering.
+    @author based on code by: Phil Burk  http://www.softsynth.com
+    @author based on code by: Ross Bencina rossb at audiomulch.com
+*/
+/*
+ * $Id: patest_read_record.c 757 2004-02-13 07:48:10Z rossbencina $
+ *
+ * This program uses the PortAudio Portable Audio Library.
+ * For more information see: http://www.portaudio.com
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "portaudio.h"
+
+/* #define SAMPLE_RATE  (17932) // Test failure to open with this value. */
+#define SAMPLE_RATE  (44100)
+#define FRAMES_PER_BUFFER (1024)
+#define NUM_CHANNELS    (2)
+/* #define DITHER_FLAG     (paDitherOff)  */
+#define DITHER_FLAG     (0) /**/
+
+/* Select sample format. */
+#if 1
+#define PA_SAMPLE_TYPE  paFloat32
+typedef float SAMPLE;
+#define SAMPLE_SILENCE  (0.0f)
+#define PRINTF_S_FORMAT "%.8f"
+#elif 1
+#define PA_SAMPLE_TYPE  paInt16
+typedef short SAMPLE;
+#define SAMPLE_SILENCE  (0)
+#define PRINTF_S_FORMAT "%d"
+#elif 0
+#define PA_SAMPLE_TYPE  paInt8
+typedef char SAMPLE;
+#define SAMPLE_SILENCE  (0)
+#define PRINTF_S_FORMAT "%d"
+#else
+#define PA_SAMPLE_TYPE  paUInt8
+typedef unsigned char SAMPLE;
+#define SAMPLE_SILENCE  (128)
+#define PRINTF_S_FORMAT "%d"
+#endif
+
+
+/*******************************************************************/
+int main(void);
+int main(void)
+{
+    PaStreamParameters inputParameters, outputParameters;
+    PaStream *stream = NULL;
+    PaError err;
+    SAMPLE *sampleBlock;
+    int i;
+    int numBytes;
+    
+    
+    printf("patest_read_write_wire.c\n"); fflush(stdout);
+
+    numBytes = FRAMES_PER_BUFFER * NUM_CHANNELS * sizeof(SAMPLE);
+    sampleBlock = (SAMPLE *) malloc( numBytes );
+    if( sampleBlock == NULL )
+    {
+        printf("Could not allocate record array.\n");
+        exit(1);
+    }
+    for( i=0; i<FRAMES_PER_BUFFER*NUM_CHANNELS; i++ )
+        sampleBlock[i] = (SAMPLE_SILENCE);
+
+    err = Pa_Initialize();
+    if( err != paNoError ) goto error;
+
+    inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */
+    printf( "Input device # %d.\n", inputParameters.device );
+    printf( "Input LL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency );
+    printf( "Input HL: %g s\n", Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency );
+    inputParameters.channelCount = NUM_CHANNELS;
+    inputParameters.sampleFormat = PA_SAMPLE_TYPE;
+    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultHighInputLatency ;
+    inputParameters.hostApiSpecificStreamInfo = NULL;
+
+    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
+    printf( "Output device # %d.\n", outputParameters.device );
+    printf( "Output LL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency );
+    printf( "Output HL: %g s\n", Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency );
+    outputParameters.channelCount = NUM_CHANNELS;
+    outputParameters.sampleFormat = PA_SAMPLE_TYPE;
+    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+
+    /* -- setup -- */
+
+   err = Pa_OpenStream(
+              &stream,
+              &inputParameters,
+              &outputParameters,
+              SAMPLE_RATE,
+              FRAMES_PER_BUFFER,
+              paClipOff,      /* we won't output out of range samples so don't bother clipping them */
+              NULL, /* no callback, use blocking API */
+              NULL ); /* no callback, so no callback userData */
+    if( err != paNoError ) goto error;
+
+    err = Pa_StartStream( stream );
+    if( err != paNoError ) goto error;
+    printf("Wire on. Will run one minute.\n"); fflush(stdout);
+
+    for( i=0; i<(60*SAMPLE_RATE)/FRAMES_PER_BUFFER; ++i )
+    {
+       err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
+       if( err ) goto xrun;
+       err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
+       if( err ) goto xrun;
+    }
+    err = Pa_StopStream( stream );
+    if( err != paNoError ) goto error;
+
+    for( i=0; i<FRAMES_PER_BUFFER*NUM_CHANNELS; i++ )
+        sampleBlock[i] = (SAMPLE_SILENCE);
+
+    err = Pa_StartStream( stream );
+    if( err != paNoError ) goto error;
+    printf("Wire on. Interrupt to stop.\n"); fflush(stdout);
+
+    while( 1 )
+    {
+       err = Pa_WriteStream( stream, sampleBlock, FRAMES_PER_BUFFER );
+       if( err ) goto xrun;
+       err = Pa_ReadStream( stream, sampleBlock, FRAMES_PER_BUFFER );
+       if( err ) goto xrun;
+    }
+    err = Pa_StopStream( stream );
+    if( err != paNoError ) goto error;
+
+    Pa_CloseStream( stream );
+
+    free( sampleBlock );
+
+    Pa_Terminate();
+    return 0;
+
+xrun:
+    if( stream ) {
+       Pa_AbortStream( stream );
+       Pa_CloseStream( stream );
+    }
+    free( sampleBlock );
+    Pa_Terminate();
+    if( err & paInputOverflow )
+       fprintf( stderr, "Input Overflow.\n" );
+    if( err & paOutputUnderflow )
+       fprintf( stderr, "Output Underflow.\n" );
+    return -2;
+
+error:
+    if( stream ) {
+       Pa_AbortStream( stream );
+       Pa_CloseStream( stream );
+    }
+    free( sampleBlock );
+    Pa_Terminate();
+    fprintf( stderr, "An error occured while using the portaudio stream\n" );
+    fprintf( stderr, "Error number: %d\n", err );
+    fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
+    return -1;
+}
+

Modified: freeswitch/trunk/libs/portaudio/test/patest_timing.c
==============================================================================
--- freeswitch/trunk/libs/portaudio/test/patest_timing.c	(original)
+++ freeswitch/trunk/libs/portaudio/test/patest_timing.c	Fri Sep 21 14:49:14 2007
@@ -1,173 +1,173 @@
-/** @file patest_timing.c
-	@ingroup test_src
-	@brief Play a sine wave for several seconds, and spits out a ton of timing info while it's at it. Based on patet_sine.c
-	@author Bjorn Roche
-	@author Ross Bencina <rossb at audiomulch.com>
-    @author Phil Burk <philburk at softsynth.com>
-*/
-/*
- * $Id: patest_sine.c 578 2003-09-02 04:17:38Z rossbencina $
- *
- * This program uses the PortAudio Portable Audio Library.
- * For more information see: http://www.portaudio.com/
- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however, 
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
- * license above.
- */
-
-#include <stdio.h>
-#include <math.h>
-#include "portaudio.h"
-
-#define NUM_SECONDS   (5)
-#define SAMPLE_RATE   (44100)
-#define FRAMES_PER_BUFFER  (64)
-
-#ifndef M_PI
-#define M_PI  (3.14159265)
-#endif
-
-#define TABLE_SIZE   (200)
-typedef struct
-{
-    PaStream *stream;
-    PaTime start;
-    float sine[TABLE_SIZE];
-    int left_phase;
-    int right_phase;
-}
-paTestData;
-
-/* This routine will be called by the PortAudio engine when audio is needed.
-** It may called at interrupt level on some machines so don't do anything
-** that could mess up the system like calling malloc() or free().
-*/
-static int patestCallback( const void *inputBuffer, void *outputBuffer,
-                            unsigned long framesPerBuffer,
-                            const PaStreamCallbackTimeInfo* timeInfo,
-                            PaStreamCallbackFlags statusFlags,
-                            void *userData )
-{
-    paTestData *data = (paTestData*)userData;
-    float *out = (float*)outputBuffer;
-    unsigned long i;
-
-    (void) timeInfo; /* Prevent unused variable warnings. */
-    (void) statusFlags;
-    (void) inputBuffer;
-
-    printf( "Timing info given to callback: Adc: %g, Current: %g, Dac: %g\n",
-            timeInfo->inputBufferAdcTime,
-            timeInfo->currentTime,
-            timeInfo->outputBufferDacTime );
-
-    printf( "getStreamTime() returns: %g\n", Pa_GetStreamTime(data->stream)-data->start );
-    
-    for( i=0; i<framesPerBuffer; i++ )
-    {
-        *out++ = data->sine[data->left_phase];  /* left */
-        *out++ = data->sine[data->right_phase];  /* right */
-        data->left_phase += 1;
-        if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE;
-        data->right_phase += 3; /* higher pitch so we can distinguish left and right. */
-        if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE;
-    }
-    
-    return paContinue;
-}
-
-/*******************************************************************/
-int main(void);
-int main(void)
-{
-    PaStreamParameters outputParameters;
-    PaStream *stream;
-    PaError err;
-    paTestData data;
-    int i;
-
-    
-    printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER);
-    
-    /* initialise sinusoidal wavetable */
-    for( i=0; i<TABLE_SIZE; i++ )
-    {
-        data.sine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. );
-    }
-    data.left_phase = data.right_phase = 0;
-    
-    err = Pa_Initialize();
-    if( err != paNoError ) goto error;
-
-    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
-    outputParameters.channelCount = 2;       /* stereo output */
-    outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */
-    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency;
-    outputParameters.hostApiSpecificStreamInfo = NULL;
-
-    err = Pa_OpenStream(
-              &stream,
-              NULL, /* no input */
-              &outputParameters,
-              SAMPLE_RATE,
-              FRAMES_PER_BUFFER,
-              paClipOff,      /* we won't output out of range samples so don't bother clipping them */
-              patestCallback,
-              &data );
-    data.stream = stream;
-    data.start = Pa_GetStreamTime(stream);
-    if( err != paNoError ) goto error;
-
-    err = Pa_StartStream( stream );
-    data.start = Pa_GetStreamTime(stream);
-    if( err != paNoError ) goto error;
-
-    printf("Play for %d seconds.\n", NUM_SECONDS );
-    Pa_Sleep( NUM_SECONDS * 1000 );
-
-    err = Pa_StopStream( stream );
-    if( err != paNoError ) goto error;
-
-    err = Pa_CloseStream( stream );
-    if( err != paNoError ) goto error;
-
-    Pa_Terminate();
-    printf("Test finished.\n");
-    printf("The tone should have been heard for about 5 seconds and all the timing info above should report that about 5 seconds elapsed (except Adc, which is undefined since there was no input device opened).\n");
-    
-    return err;
-error:
-    Pa_Terminate();
-    fprintf( stderr, "An error occured while using the portaudio stream\n" );
-    fprintf( stderr, "Error number: %d\n", err );
-    fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
-    return err;
-}
+/** @file patest_timing.c
+	@ingroup test_src
+	@brief Play a sine wave for several seconds, and spits out a ton of timing info while it's at it. Based on patet_sine.c
+	@author Bjorn Roche
+	@author Ross Bencina <rossb at audiomulch.com>
+    @author Phil Burk <philburk at softsynth.com>
+*/
+/*
+ * $Id: patest_sine.c 578 2003-09-02 04:17:38Z rossbencina $
+ *
+ * This program uses the PortAudio Portable Audio Library.
+ * For more information see: http://www.portaudio.com/
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include "portaudio.h"
+
+#define NUM_SECONDS   (5)
+#define SAMPLE_RATE   (44100)
+#define FRAMES_PER_BUFFER  (64)
+
+#ifndef M_PI
+#define M_PI  (3.14159265)
+#endif
+
+#define TABLE_SIZE   (200)
+typedef struct
+{
+    PaStream *stream;
+    PaTime start;
+    float sine[TABLE_SIZE];
+    int left_phase;
+    int right_phase;
+}
+paTestData;
+
+/* This routine will be called by the PortAudio engine when audio is needed.
+** It may called at interrupt level on some machines so don't do anything
+** that could mess up the system like calling malloc() or free().
+*/
+static int patestCallback( const void *inputBuffer, void *outputBuffer,
+                            unsigned long framesPerBuffer,
+                            const PaStreamCallbackTimeInfo* timeInfo,
+                            PaStreamCallbackFlags statusFlags,
+                            void *userData )
+{
+    paTestData *data = (paTestData*)userData;
+    float *out = (float*)outputBuffer;
+    unsigned long i;
+
+    (void) timeInfo; /* Prevent unused variable warnings. */
+    (void) statusFlags;
+    (void) inputBuffer;
+
+    printf( "Timing info given to callback: Adc: %g, Current: %g, Dac: %g\n",
+            timeInfo->inputBufferAdcTime,
+            timeInfo->currentTime,
+            timeInfo->outputBufferDacTime );
+
+    printf( "getStreamTime() returns: %g\n", Pa_GetStreamTime(data->stream)-data->start );
+    
+    for( i=0; i<framesPerBuffer; i++ )
+    {
+        *out++ = data->sine[data->left_phase];  /* left */
+        *out++ = data->sine[data->right_phase];  /* right */
+        data->left_phase += 1;
+        if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE;
+        data->right_phase += 3; /* higher pitch so we can distinguish left and right. */
+        if( data->right_phase >= TABLE_SIZE ) data->right_phase -= TABLE_SIZE;
+    }
+    
+    return paContinue;
+}
+
+/*******************************************************************/
+int main(void);
+int main(void)
+{
+    PaStreamParameters outputParameters;
+    PaStream *stream;
+    PaError err;
+    paTestData data;
+    int i;
+
+    
+    printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER);
+    
+    /* initialise sinusoidal wavetable */
+    for( i=0; i<TABLE_SIZE; i++ )
+    {
+        data.sine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. );
+    }
+    data.left_phase = data.right_phase = 0;
+    
+    err = Pa_Initialize();
+    if( err != paNoError ) goto error;
+
+    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
+    outputParameters.channelCount = 2;       /* stereo output */
+    outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */
+    outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency;
+    outputParameters.hostApiSpecificStreamInfo = NULL;
+
+    err = Pa_OpenStream(
+              &stream,
+              NULL, /* no input */
+              &outputParameters,
+              SAMPLE_RATE,
+              FRAMES_PER_BUFFER,
+              paClipOff,      /* we won't output out of range samples so don't bother clipping them */
+              patestCallback,
+              &data );
+    data.stream = stream;
+    data.start = Pa_GetStreamTime(stream);
+    if( err != paNoError ) goto error;
+
+    err = Pa_StartStream( stream );
+    data.start = Pa_GetStreamTime(stream);
+    if( err != paNoError ) goto error;
+
+    printf("Play for %d seconds.\n", NUM_SECONDS );
+    Pa_Sleep( NUM_SECONDS * 1000 );
+
+    err = Pa_StopStream( stream );
+    if( err != paNoError ) goto error;
+
+    err = Pa_CloseStream( stream );
+    if( err != paNoError ) goto error;
+
+    Pa_Terminate();
+    printf("Test finished.\n");
+    printf("The tone should have been heard for about 5 seconds and all the timing info above should report that about 5 seconds elapsed (except Adc, which is undefined since there was no input device opened).\n");
+    
+    return err;
+error:
+    Pa_Terminate();
+    fprintf( stderr, "An error occured while using the portaudio stream\n" );
+    fprintf( stderr, "Error number: %d\n", err );
+    fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
+    return err;
+}

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c	Fri Sep 21 14:49:14 2007
@@ -79,7 +79,7 @@
 	static const char fmt[] = "%u.%u.%u.%u";
 	char tmp[sizeof "255.255.255.255"];
 
-	if (snprintf(tmp, sizeof tmp, fmt,
+	if (snprintf(tmp, sizeof tmp, fmt,
 		     src[0], src[1], src[2], src[3]) >= size) {
 		su_seterrno(ENOSPC);
 		return NULL;

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_open_c_localinfo.cpp	Fri Sep 21 14:49:14 2007
@@ -1,147 +1,147 @@
-/*
- * This file is part of the Sofia-SIP package
- *
- * Copyright (C) 2005 Nokia Corporation.
- *
- * Contact: Pekka Pessi <pekka.pessi at nokia.com>
- *
- * 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
- *
- */
-
-/**@ingroup su_open_c_localinfo.cpp
- *
- * @CFILE su_open_c_localinfo.cpp
- * Functionality for choosing an access point for sockets on Symbian.
- *
- * @author Martti Mela <Martti.Mela at nokia.com>
- * @date Created: Fri May 18 14:31:41 2007 mela
- *
- */
-
-#include "config.h"
-
-#include <unistd.h>
-#include <in_sock.h> 
-#include <es_sock.h>
-#include <e32base.h>
-#include <s32mem.h>
-#include <s32strm.h>
-#include <commdbconnpref.h>
-
-#include <sofia-sip/su.h>
-
-
-su_sockaddr_t sa_global[1];
-
-/* Copy IP address for the sockaddr structure.
- *
- * @param su pointer to allocated su_sockaddr_t structure
- *
- * @return 0 if successful.
- */
-extern "C" int su_get_local_ip_addr(su_sockaddr_t *su)
-{
-	su->su_sin.sin_addr.s_addr = sa_global->su_sin.sin_addr.s_addr;
-	su->su_family = sa_global->su_family;
-	su->su_len = sa_global->su_len;
-	
-	return 0;
-}
-
-
-/* Set up the access point for the stack. Code adapted from Forum Nokia,
- * http://wiki.forum.nokia.com/index.php/LocalDeviceIpAddress.
- *
- * @param su su_sockaddr_t structure
- * @param ifindex pointer to interface index
- *
- * @return Connection object
- */
-extern "C" void *su_localinfo_ap_set(su_sockaddr_t *su, int *ifindex)
-{
-  TCommDbConnPref iPref;
-  RSocketServ aSocketServ;
-  RSocket sock;
-  
-  /* Get the IAP id of the underlying interface of this RConnection */
-  TUint32 iapId;
-  
-  iPref.SetDirection(ECommDbConnectionDirectionOutgoing);
-  iPref.SetDialogPreference(ECommDbDialogPrefPrompt);
-  iPref.SetBearerSet(KCommDbBearerUnknown /*PSD*/);
-  
-  aSocketServ = RSocketServ();
-  aSocketServ.Connect();
-  RConnection *aConnection = new RConnection();
-  aConnection->Open(aSocketServ);
-  aConnection->Start(iPref);
-  
-  User::LeaveIfError(sock.Open(aSocketServ, KAfInet, KSockStream,
-			       KProtocolInetTcp));
-  
-  User::LeaveIfError(aConnection->GetIntSetting(_L("IAP\\Id"), iapId));
-  
-  /* Get IP information from the socket */
-  TSoInetInterfaceInfo ifinfo;
-  TPckg<TSoInetInterfaceInfo> ifinfopkg(ifinfo);
-  
-  TSoInetIfQuery ifquery;
-  TPckg<TSoInetIfQuery> ifquerypkg(ifquery);
-  
-  /* To find out which interfaces are using our current IAP, we
-   * must enumerate and go through all of them and make a query
-   * by name for each. */
-  User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl));
-  while(sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifinfopkg) == KErrNone) {
-    ifquery.iName = ifinfo.iName;
-    TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, ifquerypkg);
-    
-    /* IAP ID is index 1 of iZone */
-    if(err == KErrNone && ifquery.iZone[1] == iapId) {
-      /* We have found an interface using the IAP we are interested in. */
-      if(ifinfo.iAddress.Address() > 0) {
-	/* found a IPv4 address */
-	su->su_sin.sin_addr.s_addr = htonl(ifinfo.iAddress.Address());
-	sa_global->su_sin.sin_addr.s_addr = su->su_sin.sin_addr.s_addr;
-	sa_global->su_family = su->su_family = AF_INET;
-	sa_global->su_len = su->su_len = 28;
-	*ifindex = iapId;
-	return (void *) aConnection;
-      }
-    }
-    else if(err != KErrNone)
-      break;
-  }
-  
-  sock.Close();
-}
-
-
-/* Deinitialize the access point in use.
- *
- * @param aconn Pointer to connection object
- *
- * @return 0 if successful.
- */
-extern "C" int su_localinfo_ap_deinit(void *aconn)
-{
-  RConnection *aConnection = (RConnection *) aconn;
-  aConnection->Stop();
-  aConnection->Close();
-  delete aConnection;
-  return 0;
-}
+/*
+ * This file is part of the Sofia-SIP package
+ *
+ * Copyright (C) 2005 Nokia Corporation.
+ *
+ * Contact: Pekka Pessi <pekka.pessi at nokia.com>
+ *
+ * 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
+ *
+ */
+
+/**@ingroup su_open_c_localinfo.cpp
+ *
+ * @CFILE su_open_c_localinfo.cpp
+ * Functionality for choosing an access point for sockets on Symbian.
+ *
+ * @author Martti Mela <Martti.Mela at nokia.com>
+ * @date Created: Fri May 18 14:31:41 2007 mela
+ *
+ */
+
+#include "config.h"
+
+#include <unistd.h>
+#include <in_sock.h> 
+#include <es_sock.h>
+#include <e32base.h>
+#include <s32mem.h>
+#include <s32strm.h>
+#include <commdbconnpref.h>
+
+#include <sofia-sip/su.h>
+
+
+su_sockaddr_t sa_global[1];
+
+/* Copy IP address for the sockaddr structure.
+ *
+ * @param su pointer to allocated su_sockaddr_t structure
+ *
+ * @return 0 if successful.
+ */
+extern "C" int su_get_local_ip_addr(su_sockaddr_t *su)
+{
+	su->su_sin.sin_addr.s_addr = sa_global->su_sin.sin_addr.s_addr;
+	su->su_family = sa_global->su_family;
+	su->su_len = sa_global->su_len;
+	
+	return 0;
+}
+
+
+/* Set up the access point for the stack. Code adapted from Forum Nokia,
+ * http://wiki.forum.nokia.com/index.php/LocalDeviceIpAddress.
+ *
+ * @param su su_sockaddr_t structure
+ * @param ifindex pointer to interface index
+ *
+ * @return Connection object
+ */
+extern "C" void *su_localinfo_ap_set(su_sockaddr_t *su, int *ifindex)
+{
+  TCommDbConnPref iPref;
+  RSocketServ aSocketServ;
+  RSocket sock;
+  
+  /* Get the IAP id of the underlying interface of this RConnection */
+  TUint32 iapId;
+  
+  iPref.SetDirection(ECommDbConnectionDirectionOutgoing);
+  iPref.SetDialogPreference(ECommDbDialogPrefPrompt);
+  iPref.SetBearerSet(KCommDbBearerUnknown /*PSD*/);
+  
+  aSocketServ = RSocketServ();
+  aSocketServ.Connect();
+  RConnection *aConnection = new RConnection();
+  aConnection->Open(aSocketServ);
+  aConnection->Start(iPref);
+  
+  User::LeaveIfError(sock.Open(aSocketServ, KAfInet, KSockStream,
+			       KProtocolInetTcp));
+  
+  User::LeaveIfError(aConnection->GetIntSetting(_L("IAP\\Id"), iapId));
+  
+  /* Get IP information from the socket */
+  TSoInetInterfaceInfo ifinfo;
+  TPckg<TSoInetInterfaceInfo> ifinfopkg(ifinfo);
+  
+  TSoInetIfQuery ifquery;
+  TPckg<TSoInetIfQuery> ifquerypkg(ifquery);
+  
+  /* To find out which interfaces are using our current IAP, we
+   * must enumerate and go through all of them and make a query
+   * by name for each. */
+  User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl));
+  while(sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifinfopkg) == KErrNone) {
+    ifquery.iName = ifinfo.iName;
+    TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, ifquerypkg);
+    
+    /* IAP ID is index 1 of iZone */
+    if(err == KErrNone && ifquery.iZone[1] == iapId) {
+      /* We have found an interface using the IAP we are interested in. */
+      if(ifinfo.iAddress.Address() > 0) {
+	/* found a IPv4 address */
+	su->su_sin.sin_addr.s_addr = htonl(ifinfo.iAddress.Address());
+	sa_global->su_sin.sin_addr.s_addr = su->su_sin.sin_addr.s_addr;
+	sa_global->su_family = su->su_family = AF_INET;
+	sa_global->su_len = su->su_len = 28;
+	*ifindex = iapId;
+	return (void *) aConnection;
+      }
+    }
+    else if(err != KErrNone)
+      break;
+  }
+  
+  sock.Close();
+}
+
+
+/* Deinitialize the access point in use.
+ *
+ * @param aconn Pointer to connection object
+ *
+ * @return 0 if successful.
+ */
+extern "C" int su_localinfo_ap_deinit(void *aconn)
+{
+  RConnection *aConnection = (RConnection *) aconn;
+  aConnection->Stop();
+  aConnection->Close();
+  delete aConnection;
+  return 0;
+}

Modified: freeswitch/trunk/libs/speex/libspeex/lsp.h
==============================================================================
--- freeswitch/trunk/libs/speex/libspeex/lsp.h	(original)
+++ freeswitch/trunk/libs/speex/libspeex/lsp.h	Fri Sep 21 14:49:14 2007
@@ -1,64 +1,64 @@
-/*---------------------------------------------------------------------------*\
-Original Copyright
-	FILE........: AK2LSPD.H
-	TYPE........: Turbo C header file
-	COMPANY.....: Voicetronix
-	AUTHOR......: James Whitehall
-	DATE CREATED: 21/11/95
-
-Modified by Jean-Marc Valin
-
-    This file contains functions for converting Linear Prediction
-    Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the
-    LSP coefficients are not in radians format but in the x domain of the
-    unit circle.
-
-\*---------------------------------------------------------------------------*/
-/**
-   @file lsp.h
-   @brief Line Spectral Pair (LSP) functions.
-*/
-/* Speex License:
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-   
-   - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-   
-   - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-   
-   - Neither the name of the Xiph.org Foundation nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-   
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef __AK2LSPD__
-#define __AK2LSPD__
-
-#include "misc.h"
-
-int lpc_to_lsp (spx_coef_t *a, int lpcrdr, spx_lsp_t *freq, int nb, spx_word16_t delta, char *stack);
-void lsp_to_lpc(spx_lsp_t *freq, spx_coef_t *ak, int lpcrdr, char *stack);
-
-/*Added by JMV*/
-void lsp_enforce_margin(spx_lsp_t *lsp, int len, spx_word16_t margin);
-
-void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *interp_lsp, int len, int subframe, int nb_subframes);
-
-#endif	/* __AK2LSPD__ */
+/*---------------------------------------------------------------------------*\
+Original Copyright
+	FILE........: AK2LSPD.H
+	TYPE........: Turbo C header file
+	COMPANY.....: Voicetronix
+	AUTHOR......: James Whitehall
+	DATE CREATED: 21/11/95
+
+Modified by Jean-Marc Valin
+
+    This file contains functions for converting Linear Prediction
+    Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the
+    LSP coefficients are not in radians format but in the x domain of the
+    unit circle.
+
+\*---------------------------------------------------------------------------*/
+/**
+   @file lsp.h
+   @brief Line Spectral Pair (LSP) functions.
+*/
+/* Speex License:
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+   
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+   
+   - Neither the name of the Xiph.org Foundation nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+   
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __AK2LSPD__
+#define __AK2LSPD__
+
+#include "misc.h"
+
+int lpc_to_lsp (spx_coef_t *a, int lpcrdr, spx_lsp_t *freq, int nb, spx_word16_t delta, char *stack);
+void lsp_to_lpc(spx_lsp_t *freq, spx_coef_t *ak, int lpcrdr, char *stack);
+
+/*Added by JMV*/
+void lsp_enforce_margin(spx_lsp_t *lsp, int len, spx_word16_t margin);
+
+void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *interp_lsp, int len, int subframe, int nb_subframes);
+
+#endif	/* __AK2LSPD__ */

Modified: freeswitch/trunk/libs/speex/src/getopt.c
==============================================================================
--- freeswitch/trunk/libs/speex/src/getopt.c	(original)
+++ freeswitch/trunk/libs/speex/src/getopt.c	Fri Sep 21 14:49:14 2007
@@ -1,1047 +1,1047 @@
-/* Getopt for GNU.
-   NOTE: getopt is now part of the C library, so if you don't know what
-   "Keep this file name-space clean" means, talk to drepper at gnu.org
-   before changing it!
-
-   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
-   	Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
-   Ditto for AIX 3.2 and <stdlib.h>.  */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
-   reject `defined (const)'.  */
-# ifndef const
-#  define const
-# endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
-   actually compiling the library itself.  This code is part of the GNU C
-   Library, but also included in many other GNU distributions.  Compiling
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#  define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef	__GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
-   contain conflicting prototypes for getopt.  */
-# include <stdlib.h>
-# include <unistd.h>
-#endif	/* GNU C library.  */
-
-#ifdef VMS
-# include <unixlib.h>
-# if HAVE_STRING_H - 0
-#  include <string.h>
-# endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
-   When compiling libc, the _ macro is predefined.  */
-# ifdef HAVE_LIBINTL_H
-#  include <libintl.h>
-#  define _(msgid)	gettext (msgid)
-# else
-#  define _(msgid)	(msgid)
-# endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
-   but it behaves differently for the user, since it allows the user
-   to intersperse the options with the other arguments.
-
-   As `getopt' works, it permutes the elements of ARGV so that,
-   when it is done, all the options precede everything else.  Thus
-   all application programs are extended to handle flexible argument order.
-
-   Setting the environment variable POSIXLY_CORRECT disables permutation.
-   Then the behavior is completely standard.
-
-   GNU application programs can use a third alternative mode in which
-   they can distinguish the relative order of options and other arguments.  */
-
-#include "getopt_win.h"
-
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
-
-   On entry to `getopt', zero means this is the first call; initialize.
-
-   When `getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, `optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-/* 1003.2 says this must be 1 before any call.  */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
-   causes problems with re-calling getopt as programs generally don't
-   know that. */
-
-int __getopt_initialized;
-
-/* The next char to be scanned in the option-element
-   in which the last option character we returned was found.
-   This allows us to pick up the scan where we left off.
-
-   If this is zero, or a null string, it means resume the scan
-   by advancing to the next ARGV-element.  */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
-   for unrecognized options.  */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
-   This must be initialized on some systems to avoid linking in the
-   system's own getopt implementation.  */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
-   If the caller did not specify anything,
-   the default is REQUIRE_ORDER if the environment variable
-   POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
-   REQUIRE_ORDER means don't recognize them as options;
-   stop option processing when the first non-option is seen.
-   This is what Unix does.
-   This mode of operation is selected by either setting the environment
-   variable POSIXLY_CORRECT, or using `+' as the first character
-   of the list of option characters.
-
-   PERMUTE is the default.  We permute the contents of ARGV as we scan,
-   so that eventually all the non-options are at the end.  This allows options
-   to be given in any order, even with programs that were not written to
-   expect this.
-
-   RETURN_IN_ORDER is an option available to programs that were written
-   to expect options and other ARGV-elements in any order and that care about
-   the ordering of the two.  We describe each non-option ARGV-element
-   as if it were the argument of an option with character code 1.
-   Using `-' as the first character of the list of option characters
-   selects this mode of operation.
-
-   The special argument `--' forces an end of option-scanning regardless
-   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
-   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
-
-static enum
-{
-  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable.  */
-static char *posixly_correct;
-
-#ifdef	__GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
-   because there are many ways it can cause trouble.
-   On some systems, it contains special magic macros that don't work
-   in GCC.  */
-# include <string.h>
-# define my_index	strchr
-#else
-
-#include <string.h>
-
-/* Avoid depending on library functions or files
-   whose names are inconsistent.  */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-
-static char *
-my_index (str, chr)
-     const char *str;
-     int chr;
-{
-  while (*str)
-    {
-      if (*str == chr)
-	return (char *) str;
-      str++;
-    }
-  return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
-   If not using GCC, it is ok not to declare it.  */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
-   That was relevant to code that was here before.  */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
-   and has done so at least since version 2.4.5. -- rms.  */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments.  */
-
-/* Describe the part of ARGV that contains non-options that have
-   been skipped.  `first_nonopt' is the index in ARGV of the first of them;
-   `last_nonopt' is the index after the last of them.  */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
-   indicating ARGV elements that should not be considered arguments.  */
-
-/* Defined in getopt_init.c  */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
-   is valid for the getopt call we must make sure that the ARGV passed
-   to getopt is that one passed to the process.  */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
-  /* XXX This is no good solution.  We should rather copy the args so
-     that we can compare them later.  But we must not use malloc(3).  */
-  original_argc = argc;
-  original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
-  if (nonoption_flags_len > 0)						      \
-    {									      \
-      char __tmp = __getopt_nonoption_flags[ch1];			      \
-      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];	      \
-      __getopt_nonoption_flags[ch2] = __tmp;				      \
-    }
-#else	/* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif	/* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
-   One subsequence is elements [first_nonopt,last_nonopt)
-   which contains all the non-options that have been skipped so far.
-   The other is elements [last_nonopt,optind), which contains all
-   the options processed since those non-options were skipped.
-
-   `first_nonopt' and `last_nonopt' are relocated so that they describe
-   the new indices of the non-options in ARGV after they are moved.  */
-
-#if defined __STDC__ && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
-     char **argv;
-{
-  int bottom = first_nonopt;
-  int middle = last_nonopt;
-  int top = optind;
-  char *tem;
-
-  /* Exchange the shorter segment with the far end of the longer segment.
-     That puts the shorter segment into the right place.
-     It leaves the longer segment in the right place overall,
-     but it consists of two parts that need to be swapped next.  */
-
-#ifdef _LIBC
-  /* First make sure the handling of the `__getopt_nonoption_flags'
-     string can work normally.  Our top argument must be in the range
-     of the string.  */
-  if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
-    {
-      /* We must extend the array.  The user plays games with us and
-	 presents new arguments.  */
-      char *new_str = malloc (top + 1);
-      if (new_str == NULL)
-	nonoption_flags_len = nonoption_flags_max_len = 0;
-      else
-	{
-	  memset (__mempcpy (new_str, __getopt_nonoption_flags,
-			     nonoption_flags_max_len),
-		  '\0', top + 1 - nonoption_flags_max_len);
-	  nonoption_flags_max_len = top + 1;
-	  __getopt_nonoption_flags = new_str;
-	}
-    }
-#endif
-
-  while (top > middle && middle > bottom)
-    {
-      if (top - middle > middle - bottom)
-	{
-	  /* Bottom segment is the short one.  */
-	  int len = middle - bottom;
-	  register int i;
-
-	  /* Swap it with the top part of the top segment.  */
-	  for (i = 0; i < len; i++)
-	    {
-	      tem = argv[bottom + i];
-	      argv[bottom + i] = argv[top - (middle - bottom) + i];
-	      argv[top - (middle - bottom) + i] = tem;
-	      SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-	    }
-	  /* Exclude the moved bottom segment from further swapping.  */
-	  top -= len;
-	}
-      else
-	{
-	  /* Top segment is the short one.  */
-	  int len = top - middle;
-	  register int i;
-
-	  /* Swap it with the bottom part of the bottom segment.  */
-	  for (i = 0; i < len; i++)
-	    {
-	      tem = argv[bottom + i];
-	      argv[bottom + i] = argv[middle + i];
-	      argv[middle + i] = tem;
-	      SWAP_FLAGS (bottom + i, middle + i);
-	    }
-	  /* Exclude the moved top segment from further swapping.  */
-	  bottom += len;
-	}
-    }
-
-  /* Update records for the slots the non-options now occupy.  */
-
-  first_nonopt += (optind - last_nonopt);
-  last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made.  */
-
-#if defined __STDC__ && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-{
-  /* Start processing options with ARGV-element 1 (since ARGV-element 0
-     is the program name); the sequence of previously skipped
-     non-option ARGV-elements is empty.  */
-
-  first_nonopt = last_nonopt = optind;
-
-  nextchar = NULL;
-
-  posixly_correct = getenv ("POSIXLY_CORRECT");
-
-  /* Determine how to handle the ordering of options and nonoptions.  */
-
-  if (optstring[0] == '-')
-    {
-      ordering = RETURN_IN_ORDER;
-      ++optstring;
-    }
-  else if (optstring[0] == '+')
-    {
-      ordering = REQUIRE_ORDER;
-      ++optstring;
-    }
-  else if (posixly_correct != NULL)
-    ordering = REQUIRE_ORDER;
-  else
-    ordering = PERMUTE;
-
-#ifdef _LIBC
-  if (posixly_correct == NULL
-      && argc == original_argc && argv == original_argv)
-    {
-      if (nonoption_flags_max_len == 0)
-	{
-	  if (__getopt_nonoption_flags == NULL
-	      || __getopt_nonoption_flags[0] == '\0')
-	    nonoption_flags_max_len = -1;
-	  else
-	    {
-	      const char *orig_str = __getopt_nonoption_flags;
-	      int len = nonoption_flags_max_len = strlen (orig_str);
-	      if (nonoption_flags_max_len < argc)
-		nonoption_flags_max_len = argc;
-	      __getopt_nonoption_flags =
-		(char *) malloc (nonoption_flags_max_len);
-	      if (__getopt_nonoption_flags == NULL)
-		nonoption_flags_max_len = -1;
-	      else
-		memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-			'\0', nonoption_flags_max_len - len);
-	    }
-	}
-      nonoption_flags_len = nonoption_flags_max_len;
-    }
-  else
-    nonoption_flags_len = 0;
-#endif
-
-  return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
-   given in OPTSTRING.
-
-   If an element of ARGV starts with '-', and is not exactly "-" or "--",
-   then it is an option element.  The characters of this element
-   (aside from the initial '-') are option characters.  If `getopt'
-   is called repeatedly, it returns successively each of the option characters
-   from each of the option elements.
-
-   If `getopt' finds another option character, it returns that character,
-   updating `optind' and `nextchar' so that the next call to `getopt' can
-   resume the scan with the following option character or ARGV-element.
-
-   If there are no more option characters, `getopt' returns -1.
-   Then `optind' is the index in ARGV of the first ARGV-element
-   that is not an option.  (The ARGV-elements have been permuted
-   so that those that are not options now come last.)
-
-   OPTSTRING is a string containing the legitimate option characters.
-   If an option character is seen that is not listed in OPTSTRING,
-   return '?' after printing an error message.  If you set `opterr' to
-   zero, the error message is suppressed but we still return '?'.
-
-   If a char in OPTSTRING is followed by a colon, that means it wants an arg,
-   so the following text in the same ARGV-element, or the text of the following
-   ARGV-element, is returned in `optarg'.  Two colons mean an option that
-   wants an optional arg; if there is text in the current ARGV-element,
-   it is returned in `optarg', otherwise `optarg' is set to zero.
-
-   If OPTSTRING starts with `-' or `+', it requests different methods of
-   handling the non-option ARGV-elements.
-   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
-   Long-named options begin with `--' instead of `-'.
-   Their names may be abbreviated as long as the abbreviation is unique
-   or is an exact match for some defined option.  If they have an
-   argument, it follows the option name in the same ARGV-element, separated
-   from the option name by a `=', or else the in next ARGV-element.
-   When `getopt' finds a long-named option, it returns 0 if that option's
-   `flag' field is nonzero, the value of the option's `val' field
-   if the `flag' field is zero.
-
-   The elements of ARGV aren't really const, because we permute them.
-   But we pretend they're const in the prototype to be compatible
-   with other systems.
-
-   LONGOPTS is a vector of `struct option' terminated by an
-   element containing a name which is zero.
-
-   LONGIND returns the index in LONGOPT of the long-named option found.
-   It is only valid when a long-named option has been found by the most
-   recent call.
-
-   If LONG_ONLY is nonzero, '-' as well as '--' can introduce
-   long-named options.  */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-     const struct option *longopts;
-     int *longind;
-     int long_only;
-{
-  optarg = NULL;
-
-  if (optind == 0 || !__getopt_initialized)
-    {
-      if (optind == 0)
-	optind = 1;	/* Don't scan ARGV[0], the program name.  */
-      optstring = _getopt_initialize (argc, argv, optstring);
-      __getopt_initialized = 1;
-    }
-
-  /* Test whether ARGV[optind] points to a non-option argument.
-     Either it does not have option syntax, or there is an environment flag
-     from the shell indicating it is not an option.  The later information
-     is only used when the used in the GNU libc.  */
-#ifdef _LIBC
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0'	      \
-		      || (optind < nonoption_flags_len			      \
-			  && __getopt_nonoption_flags[optind] == '1'))
-#else
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
-  if (nextchar == NULL || *nextchar == '\0')
-    {
-      /* Advance to the next ARGV-element.  */
-
-      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
-	 moved back by the user (who may also have changed the arguments).  */
-      if (last_nonopt > optind)
-	last_nonopt = optind;
-      if (first_nonopt > optind)
-	first_nonopt = optind;
-
-      if (ordering == PERMUTE)
-	{
-	  /* If we have just processed some options following some non-options,
-	     exchange them so that the options come first.  */
-
-	  if (first_nonopt != last_nonopt && last_nonopt != optind)
-	    exchange ((char **) argv);
-	  else if (last_nonopt != optind)
-	    first_nonopt = optind;
-
-	  /* Skip any additional non-options
-	     and extend the range of non-options previously skipped.  */
-
-	  while (optind < argc && NONOPTION_P)
-	    optind++;
-	  last_nonopt = optind;
-	}
-
-      /* The special ARGV-element `--' means premature end of options.
-	 Skip it like a null option,
-	 then exchange with previous non-options as if it were an option,
-	 then skip everything else like a non-option.  */
-
-      if (optind != argc && !strcmp (argv[optind], "--"))
-	{
-	  optind++;
-
-	  if (first_nonopt != last_nonopt && last_nonopt != optind)
-	    exchange ((char **) argv);
-	  else if (first_nonopt == last_nonopt)
-	    first_nonopt = optind;
-	  last_nonopt = argc;
-
-	  optind = argc;
-	}
-
-      /* If we have done all the ARGV-elements, stop the scan
-	 and back over any non-options that we skipped and permuted.  */
-
-      if (optind == argc)
-	{
-	  /* Set the next-arg-index to point at the non-options
-	     that we previously skipped, so the caller will digest them.  */
-	  if (first_nonopt != last_nonopt)
-	    optind = first_nonopt;
-	  return -1;
-	}
-
-      /* If we have come to a non-option and did not permute it,
-	 either stop the scan or describe it to the caller and pass it by.  */
-
-      if (NONOPTION_P)
-	{
-	  if (ordering == REQUIRE_ORDER)
-	    return -1;
-	  optarg = argv[optind++];
-	  return 1;
-	}
-
-      /* We have found another option-ARGV-element.
-	 Skip the initial punctuation.  */
-
-      nextchar = (argv[optind] + 1
-		  + (longopts != NULL && argv[optind][1] == '-'));
-    }
-
-  /* Decode the current option-ARGV-element.  */
-
-  /* Check whether the ARGV-element is a long option.
-
-     If long_only and the ARGV-element has the form "-f", where f is
-     a valid short option, don't consider it an abbreviated form of
-     a long option that starts with f.  Otherwise there would be no
-     way to give the -f short option.
-
-     On the other hand, if there's a long option "fubar" and
-     the ARGV-element is "-fu", do consider that an abbreviation of
-     the long option, just like "--fu", and not "-f" with arg "u".
-
-     This distinction seems to be the most useful approach.  */
-
-  if (longopts != NULL
-      && (argv[optind][1] == '-'
-	  || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
-    {
-      char *nameend;
-      const struct option *p;
-      const struct option *pfound = NULL;
-      int exact = 0;
-      int ambig = 0;
-      int indfound = -1;
-      int option_index;
-
-      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
-	/* Do nothing.  */ ;
-
-      /* Test all long options for either exact match
-	 or abbreviated matches.  */
-      for (p = longopts, option_index = 0; p->name; p++, option_index++)
-	if (!strncmp (p->name, nextchar, nameend - nextchar))
-	  {
-	    if ((unsigned int) (nameend - nextchar)
-		== (unsigned int) strlen (p->name))
-	      {
-		/* Exact match found.  */
-		pfound = p;
-		indfound = option_index;
-		exact = 1;
-		break;
-	      }
-	    else if (pfound == NULL)
-	      {
-		/* First nonexact match found.  */
-		pfound = p;
-		indfound = option_index;
-	      }
-	    else
-	      /* Second or later nonexact match found.  */
-	      ambig = 1;
-	  }
-
-      if (ambig && !exact)
-	{
-	  if (opterr)
-	    fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
-		     argv[0], argv[optind]);
-	  nextchar += strlen (nextchar);
-	  optind++;
-	  optopt = 0;
-	  return '?';
-	}
-
-      if (pfound != NULL)
-	{
-	  option_index = indfound;
-	  optind++;
-	  if (*nameend)
-	    {
-	      /* Don't test has_arg with >, because some C compilers don't
-		 allow it to be used on enums.  */
-	      if (pfound->has_arg)
-		optarg = nameend + 1;
-	      else
-		{
-		  if (opterr)
-		    {
-		      if (argv[optind - 1][1] == '-')
-			/* --option */
-			fprintf (stderr,
-				 _("%s: option `--%s' doesn't allow an argument\n"),
-				 argv[0], pfound->name);
-		      else
-			/* +option or -option */
-			fprintf (stderr,
-				 _("%s: option `%c%s' doesn't allow an argument\n"),
-				 argv[0], argv[optind - 1][0], pfound->name);
-		    }
-
-		  nextchar += strlen (nextchar);
-
-		  optopt = pfound->val;
-		  return '?';
-		}
-	    }
-	  else if (pfound->has_arg == 1)
-	    {
-	      if (optind < argc)
-		optarg = argv[optind++];
-	      else
-		{
-		  if (opterr)
-		    fprintf (stderr,
-			   _("%s: option `%s' requires an argument\n"),
-			   argv[0], argv[optind - 1]);
-		  nextchar += strlen (nextchar);
-		  optopt = pfound->val;
-		  return optstring[0] == ':' ? ':' : '?';
-		}
-	    }
-	  nextchar += strlen (nextchar);
-	  if (longind != NULL)
-	    *longind = option_index;
-	  if (pfound->flag)
-	    {
-	      *(pfound->flag) = pfound->val;
-	      return 0;
-	    }
-	  return pfound->val;
-	}
-
-      /* Can't find it as a long option.  If this is not getopt_long_only,
-	 or the option starts with '--' or is not a valid short
-	 option, then it's an error.
-	 Otherwise interpret it as a short option.  */
-      if (!long_only || argv[optind][1] == '-'
-	  || my_index (optstring, *nextchar) == NULL)
-	{
-	  if (opterr)
-	    {
-	      if (argv[optind][1] == '-')
-		/* --option */
-		fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
-			 argv[0], nextchar);
-	      else
-		/* +option or -option */
-		fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
-			 argv[0], argv[optind][0], nextchar);
-	    }
-	  nextchar = (char *) "";
-	  optind++;
-	  optopt = 0;
-	  return '?';
-	}
-    }
-
-  /* Look at and handle the next short option-character.  */
-
-  {
-    char c = *nextchar++;
-    char *temp = my_index (optstring, c);
-
-    /* Increment `optind' when we start to process its last character.  */
-    if (*nextchar == '\0')
-      ++optind;
-
-    if (temp == NULL || c == ':')
-      {
-	if (opterr)
-	  {
-	    if (posixly_correct)
-	      /* 1003.2 specifies the format of this message.  */
-	      fprintf (stderr, _("%s: illegal option -- %c\n"),
-		       argv[0], c);
-	    else
-	      fprintf (stderr, _("%s: invalid option -- %c\n"),
-		       argv[0], c);
-	  }
-	optopt = c;
-	return '?';
-      }
-    /* Convenience. Treat POSIX -W foo same as long option --foo */
-    if (temp[0] == 'W' && temp[1] == ';')
-      {
-	char *nameend;
-	const struct option *p;
-	const struct option *pfound = NULL;
-	int exact = 0;
-	int ambig = 0;
-	int indfound = 0;
-	int option_index;
-
-	/* This is an option that requires an argument.  */
-	if (*nextchar != '\0')
-	  {
-	    optarg = nextchar;
-	    /* If we end this ARGV-element by taking the rest as an arg,
-	       we must advance to the next element now.  */
-	    optind++;
-	  }
-	else if (optind == argc)
-	  {
-	    if (opterr)
-	      {
-		/* 1003.2 specifies the format of this message.  */
-		fprintf (stderr, _("%s: option requires an argument -- %c\n"),
-			 argv[0], c);
-	      }
-	    optopt = c;
-	    if (optstring[0] == ':')
-	      c = ':';
-	    else
-	      c = '?';
-	    return c;
-	  }
-	else
-	  /* We already incremented `optind' once;
-	     increment it again when taking next ARGV-elt as argument.  */
-	  optarg = argv[optind++];
-
-	/* optarg is now the argument, see if it's in the
-	   table of longopts.  */
-
-	for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
-	  /* Do nothing.  */ ;
-
-	/* Test all long options for either exact match
-	   or abbreviated matches.  */
-	for (p = longopts, option_index = 0; p->name; p++, option_index++)
-	  if (!strncmp (p->name, nextchar, nameend - nextchar))
-	    {
-	      if ((unsigned int) (nameend - nextchar) == strlen (p->name))
-		{
-		  /* Exact match found.  */
-		  pfound = p;
-		  indfound = option_index;
-		  exact = 1;
-		  break;
-		}
-	      else if (pfound == NULL)
-		{
-		  /* First nonexact match found.  */
-		  pfound = p;
-		  indfound = option_index;
-		}
-	      else
-		/* Second or later nonexact match found.  */
-		ambig = 1;
-	    }
-	if (ambig && !exact)
-	  {
-	    if (opterr)
-	      fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
-		       argv[0], argv[optind]);
-	    nextchar += strlen (nextchar);
-	    optind++;
-	    return '?';
-	  }
-	if (pfound != NULL)
-	  {
-	    option_index = indfound;
-	    if (*nameend)
-	      {
-		/* Don't test has_arg with >, because some C compilers don't
-		   allow it to be used on enums.  */
-		if (pfound->has_arg)
-		  optarg = nameend + 1;
-		else
-		  {
-		    if (opterr)
-		      fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
-			       argv[0], pfound->name);
-
-		    nextchar += strlen (nextchar);
-		    return '?';
-		  }
-	      }
-	    else if (pfound->has_arg == 1)
-	      {
-		if (optind < argc)
-		  optarg = argv[optind++];
-		else
-		  {
-		    if (opterr)
-		      fprintf (stderr,
-			       _("%s: option `%s' requires an argument\n"),
-			       argv[0], argv[optind - 1]);
-		    nextchar += strlen (nextchar);
-		    return optstring[0] == ':' ? ':' : '?';
-		  }
-	      }
-	    nextchar += strlen (nextchar);
-	    if (longind != NULL)
-	      *longind = option_index;
-	    if (pfound->flag)
-	      {
-		*(pfound->flag) = pfound->val;
-		return 0;
-	      }
-	    return pfound->val;
-	  }
-	  nextchar = NULL;
-	  return 'W';	/* Let the application handle it.   */
-      }
-    if (temp[1] == ':')
-      {
-	if (temp[2] == ':')
-	  {
-	    /* This is an option that accepts an argument optionally.  */
-	    if (*nextchar != '\0')
-	      {
-		optarg = nextchar;
-		optind++;
-	      }
-	    else
-	      optarg = NULL;
-	    nextchar = NULL;
-	  }
-	else
-	  {
-	    /* This is an option that requires an argument.  */
-	    if (*nextchar != '\0')
-	      {
-		optarg = nextchar;
-		/* If we end this ARGV-element by taking the rest as an arg,
-		   we must advance to the next element now.  */
-		optind++;
-	      }
-	    else if (optind == argc)
-	      {
-		if (opterr)
-		  {
-		    /* 1003.2 specifies the format of this message.  */
-		    fprintf (stderr,
-			   _("%s: option requires an argument -- %c\n"),
-			   argv[0], c);
-		  }
-		optopt = c;
-		if (optstring[0] == ':')
-		  c = ':';
-		else
-		  c = '?';
-	      }
-	    else
-	      /* We already incremented `optind' once;
-		 increment it again when taking next ARGV-elt as argument.  */
-	      optarg = argv[optind++];
-	    nextchar = NULL;
-	  }
-      }
-    return c;
-  }
-}
-
-int
-getopt (argc, argv, optstring)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-{
-  return _getopt_internal (argc, argv, optstring,
-			   (const struct option *) 0,
-			   (int *) 0,
-			   0);
-}
-
-#endif	/* Not ELIDE_CODE.  */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
-   the above definition of `getopt'.  */
-
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  int c;
-  int digit_optind = 0;
-
-  while (1)
-    {
-      int this_option_optind = optind ? optind : 1;
-
-      c = getopt (argc, argv, "abc:d:0123456789");
-      if (c == -1)
-	break;
-
-      switch (c)
-	{
-	case '0':
-	case '1':
-	case '2':
-	case '3':
-	case '4':
-	case '5':
-	case '6':
-	case '7':
-	case '8':
-	case '9':
-	  if (digit_optind != 0 && digit_optind != this_option_optind)
-	    printf ("digits occur in two different argv-elements.\n");
-	  digit_optind = this_option_optind;
-	  printf ("option %c\n", c);
-	  break;
-
-	case 'a':
-	  printf ("option a\n");
-	  break;
-
-	case 'b':
-	  printf ("option b\n");
-	  break;
-
-	case 'c':
-	  printf ("option c with value `%s'\n", optarg);
-	  break;
-
-	case '?':
-	  break;
-
-	default:
-	  printf ("?? getopt returned character code 0%o ??\n", c);
-	}
-    }
-
-  if (optind < argc)
-    {
-      printf ("non-option ARGV-elements: ");
-      while (optind < argc)
-	printf ("%s ", argv[optind++]);
-      printf ("\n");
-    }
-
-  exit (0);
-}
-
-#endif /* TEST */
+/* Getopt for GNU.
+   NOTE: getopt is now part of the C library, so if you don't know what
+   "Keep this file name-space clean" means, talk to drepper at gnu.org
+   before changing it!
+
+   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
+   	Free Software Foundation, Inc.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+   Ditto for AIX 3.2 and <stdlib.h>.  */
+#ifndef _NO_PROTO
+# define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if !defined __STDC__ || !__STDC__
+/* This is a separate conditional since some stdc systems
+   reject `defined (const)'.  */
+# ifndef const
+#  define const
+# endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+   actually compiling the library itself.  This code is part of the GNU C
+   Library, but also included in many other GNU distributions.  Compiling
+   and linking in this code is a waste when using the GNU C library
+   (especially if it is a shared library).  Rather than having every GNU
+   program understand `configure --with-gnu-libc' and omit the object files,
+   it is simpler to just do this in the source for each such file.  */
+
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
+# include <gnu-versions.h>
+# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#  define ELIDE_CODE
+# endif
+#endif
+
+#ifndef ELIDE_CODE
+
+
+/* This needs to come after some library #include
+   to get __GNU_LIBRARY__ defined.  */
+#ifdef	__GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+   contain conflicting prototypes for getopt.  */
+# include <stdlib.h>
+# include <unistd.h>
+#endif	/* GNU C library.  */
+
+#ifdef VMS
+# include <unixlib.h>
+# if HAVE_STRING_H - 0
+#  include <string.h>
+# endif
+#endif
+
+#ifndef _
+/* This is for other GNU distributions with internationalized messages.
+   When compiling libc, the _ macro is predefined.  */
+# ifdef HAVE_LIBINTL_H
+#  include <libintl.h>
+#  define _(msgid)	gettext (msgid)
+# else
+#  define _(msgid)	(msgid)
+# endif
+#endif
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+   but it behaves differently for the user, since it allows the user
+   to intersperse the options with the other arguments.
+
+   As `getopt' works, it permutes the elements of ARGV so that,
+   when it is done, all the options precede everything else.  Thus
+   all application programs are extended to handle flexible argument order.
+
+   Setting the environment variable POSIXLY_CORRECT disables permutation.
+   Then the behavior is completely standard.
+
+   GNU application programs can use a third alternative mode in which
+   they can distinguish the relative order of options and other arguments.  */
+
+#include "getopt_win.h"
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+/* 1003.2 says this must be 1 before any call.  */
+int optind = 1;
+
+/* Formerly, initialization of getopt depended on optind==0, which
+   causes problems with re-calling getopt as programs generally don't
+   know that. */
+
+int __getopt_initialized;
+
+/* The next char to be scanned in the option-element
+   in which the last option character we returned was found.
+   This allows us to pick up the scan where we left off.
+
+   If this is zero, or a null string, it means resume the scan
+   by advancing to the next ARGV-element.  */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+   for unrecognized options.  */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+   This must be initialized on some systems to avoid linking in the
+   system's own getopt implementation.  */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+   If the caller did not specify anything,
+   the default is REQUIRE_ORDER if the environment variable
+   POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+   REQUIRE_ORDER means don't recognize them as options;
+   stop option processing when the first non-option is seen.
+   This is what Unix does.
+   This mode of operation is selected by either setting the environment
+   variable POSIXLY_CORRECT, or using `+' as the first character
+   of the list of option characters.
+
+   PERMUTE is the default.  We permute the contents of ARGV as we scan,
+   so that eventually all the non-options are at the end.  This allows options
+   to be given in any order, even with programs that were not written to
+   expect this.
+
+   RETURN_IN_ORDER is an option available to programs that were written
+   to expect options and other ARGV-elements in any order and that care about
+   the ordering of the two.  We describe each non-option ARGV-element
+   as if it were the argument of an option with character code 1.
+   Using `-' as the first character of the list of option characters
+   selects this mode of operation.
+
+   The special argument `--' forces an end of option-scanning regardless
+   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
+   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
+
+static enum
+{
+  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable.  */
+static char *posixly_correct;
+
+#ifdef	__GNU_LIBRARY__
+/* We want to avoid inclusion of string.h with non-GNU libraries
+   because there are many ways it can cause trouble.
+   On some systems, it contains special magic macros that don't work
+   in GCC.  */
+# include <string.h>
+# define my_index	strchr
+#else
+
+#include <string.h>
+
+/* Avoid depending on library functions or files
+   whose names are inconsistent.  */
+
+#ifndef getenv
+extern char *getenv ();
+#endif
+
+static char *
+my_index (str, chr)
+     const char *str;
+     int chr;
+{
+  while (*str)
+    {
+      if (*str == chr)
+	return (char *) str;
+      str++;
+    }
+  return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+   If not using GCC, it is ok not to declare it.  */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+   That was relevant to code that was here before.  */
+# if (!defined __STDC__ || !__STDC__) && !defined strlen
+/* gcc with -traditional declares the built-in strlen to return int,
+   and has done so at least since version 2.4.5. -- rms.  */
+extern int strlen (const char *);
+# endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+
+/* Handle permutation of arguments.  */
+
+/* Describe the part of ARGV that contains non-options that have
+   been skipped.  `first_nonopt' is the index in ARGV of the first of them;
+   `last_nonopt' is the index after the last of them.  */
+
+static int first_nonopt;
+static int last_nonopt;
+
+#ifdef _LIBC
+/* Bash 2.0 gives us an environment variable containing flags
+   indicating ARGV elements that should not be considered arguments.  */
+
+/* Defined in getopt_init.c  */
+extern char *__getopt_nonoption_flags;
+
+static int nonoption_flags_max_len;
+static int nonoption_flags_len;
+
+static int original_argc;
+static char *const *original_argv;
+
+/* Make sure the environment variable bash 2.0 puts in the environment
+   is valid for the getopt call we must make sure that the ARGV passed
+   to getopt is that one passed to the process.  */
+static void
+__attribute__ ((unused))
+store_args_and_env (int argc, char *const *argv)
+{
+  /* XXX This is no good solution.  We should rather copy the args so
+     that we can compare them later.  But we must not use malloc(3).  */
+  original_argc = argc;
+  original_argv = argv;
+}
+# ifdef text_set_element
+text_set_element (__libc_subinit, store_args_and_env);
+# endif /* text_set_element */
+
+# define SWAP_FLAGS(ch1, ch2) \
+  if (nonoption_flags_len > 0)						      \
+    {									      \
+      char __tmp = __getopt_nonoption_flags[ch1];			      \
+      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];	      \
+      __getopt_nonoption_flags[ch2] = __tmp;				      \
+    }
+#else	/* !_LIBC */
+# define SWAP_FLAGS(ch1, ch2)
+#endif	/* _LIBC */
+
+/* Exchange two adjacent subsequences of ARGV.
+   One subsequence is elements [first_nonopt,last_nonopt)
+   which contains all the non-options that have been skipped so far.
+   The other is elements [last_nonopt,optind), which contains all
+   the options processed since those non-options were skipped.
+
+   `first_nonopt' and `last_nonopt' are relocated so that they describe
+   the new indices of the non-options in ARGV after they are moved.  */
+
+#if defined __STDC__ && __STDC__
+static void exchange (char **);
+#endif
+
+static void
+exchange (argv)
+     char **argv;
+{
+  int bottom = first_nonopt;
+  int middle = last_nonopt;
+  int top = optind;
+  char *tem;
+
+  /* Exchange the shorter segment with the far end of the longer segment.
+     That puts the shorter segment into the right place.
+     It leaves the longer segment in the right place overall,
+     but it consists of two parts that need to be swapped next.  */
+
+#ifdef _LIBC
+  /* First make sure the handling of the `__getopt_nonoption_flags'
+     string can work normally.  Our top argument must be in the range
+     of the string.  */
+  if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
+    {
+      /* We must extend the array.  The user plays games with us and
+	 presents new arguments.  */
+      char *new_str = malloc (top + 1);
+      if (new_str == NULL)
+	nonoption_flags_len = nonoption_flags_max_len = 0;
+      else
+	{
+	  memset (__mempcpy (new_str, __getopt_nonoption_flags,
+			     nonoption_flags_max_len),
+		  '\0', top + 1 - nonoption_flags_max_len);
+	  nonoption_flags_max_len = top + 1;
+	  __getopt_nonoption_flags = new_str;
+	}
+    }
+#endif
+
+  while (top > middle && middle > bottom)
+    {
+      if (top - middle > middle - bottom)
+	{
+	  /* Bottom segment is the short one.  */
+	  int len = middle - bottom;
+	  register int i;
+
+	  /* Swap it with the top part of the top segment.  */
+	  for (i = 0; i < len; i++)
+	    {
+	      tem = argv[bottom + i];
+	      argv[bottom + i] = argv[top - (middle - bottom) + i];
+	      argv[top - (middle - bottom) + i] = tem;
+	      SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
+	    }
+	  /* Exclude the moved bottom segment from further swapping.  */
+	  top -= len;
+	}
+      else
+	{
+	  /* Top segment is the short one.  */
+	  int len = top - middle;
+	  register int i;
+
+	  /* Swap it with the bottom part of the bottom segment.  */
+	  for (i = 0; i < len; i++)
+	    {
+	      tem = argv[bottom + i];
+	      argv[bottom + i] = argv[middle + i];
+	      argv[middle + i] = tem;
+	      SWAP_FLAGS (bottom + i, middle + i);
+	    }
+	  /* Exclude the moved top segment from further swapping.  */
+	  bottom += len;
+	}
+    }
+
+  /* Update records for the slots the non-options now occupy.  */
+
+  first_nonopt += (optind - last_nonopt);
+  last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made.  */
+
+#if defined __STDC__ && __STDC__
+static const char *_getopt_initialize (int, char *const *, const char *);
+#endif
+static const char *
+_getopt_initialize (argc, argv, optstring)
+     int argc;
+     char *const *argv;
+     const char *optstring;
+{
+  /* Start processing options with ARGV-element 1 (since ARGV-element 0
+     is the program name); the sequence of previously skipped
+     non-option ARGV-elements is empty.  */
+
+  first_nonopt = last_nonopt = optind;
+
+  nextchar = NULL;
+
+  posixly_correct = getenv ("POSIXLY_CORRECT");
+
+  /* Determine how to handle the ordering of options and nonoptions.  */
+
+  if (optstring[0] == '-')
+    {
+      ordering = RETURN_IN_ORDER;
+      ++optstring;
+    }
+  else if (optstring[0] == '+')
+    {
+      ordering = REQUIRE_ORDER;
+      ++optstring;
+    }
+  else if (posixly_correct != NULL)
+    ordering = REQUIRE_ORDER;
+  else
+    ordering = PERMUTE;
+
+#ifdef _LIBC
+  if (posixly_correct == NULL
+      && argc == original_argc && argv == original_argv)
+    {
+      if (nonoption_flags_max_len == 0)
+	{
+	  if (__getopt_nonoption_flags == NULL
+	      || __getopt_nonoption_flags[0] == '\0')
+	    nonoption_flags_max_len = -1;
+	  else
+	    {
+	      const char *orig_str = __getopt_nonoption_flags;
+	      int len = nonoption_flags_max_len = strlen (orig_str);
+	      if (nonoption_flags_max_len < argc)
+		nonoption_flags_max_len = argc;
+	      __getopt_nonoption_flags =
+		(char *) malloc (nonoption_flags_max_len);
+	      if (__getopt_nonoption_flags == NULL)
+		nonoption_flags_max_len = -1;
+	      else
+		memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+			'\0', nonoption_flags_max_len - len);
+	    }
+	}
+      nonoption_flags_len = nonoption_flags_max_len;
+    }
+  else
+    nonoption_flags_len = 0;
+#endif
+
+  return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+   given in OPTSTRING.
+
+   If an element of ARGV starts with '-', and is not exactly "-" or "--",
+   then it is an option element.  The characters of this element
+   (aside from the initial '-') are option characters.  If `getopt'
+   is called repeatedly, it returns successively each of the option characters
+   from each of the option elements.
+
+   If `getopt' finds another option character, it returns that character,
+   updating `optind' and `nextchar' so that the next call to `getopt' can
+   resume the scan with the following option character or ARGV-element.
+
+   If there are no more option characters, `getopt' returns -1.
+   Then `optind' is the index in ARGV of the first ARGV-element
+   that is not an option.  (The ARGV-elements have been permuted
+   so that those that are not options now come last.)
+
+   OPTSTRING is a string containing the legitimate option characters.
+   If an option character is seen that is not listed in OPTSTRING,
+   return '?' after printing an error message.  If you set `opterr' to
+   zero, the error message is suppressed but we still return '?'.
+
+   If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+   so the following text in the same ARGV-element, or the text of the following
+   ARGV-element, is returned in `optarg'.  Two colons mean an option that
+   wants an optional arg; if there is text in the current ARGV-element,
+   it is returned in `optarg', otherwise `optarg' is set to zero.
+
+   If OPTSTRING starts with `-' or `+', it requests different methods of
+   handling the non-option ARGV-elements.
+   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+   Long-named options begin with `--' instead of `-'.
+   Their names may be abbreviated as long as the abbreviation is unique
+   or is an exact match for some defined option.  If they have an
+   argument, it follows the option name in the same ARGV-element, separated
+   from the option name by a `=', or else the in next ARGV-element.
+   When `getopt' finds a long-named option, it returns 0 if that option's
+   `flag' field is nonzero, the value of the option's `val' field
+   if the `flag' field is zero.
+
+   The elements of ARGV aren't really const, because we permute them.
+   But we pretend they're const in the prototype to be compatible
+   with other systems.
+
+   LONGOPTS is a vector of `struct option' terminated by an
+   element containing a name which is zero.
+
+   LONGIND returns the index in LONGOPT of the long-named option found.
+   It is only valid when a long-named option has been found by the most
+   recent call.
+
+   If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+   long-named options.  */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+     int argc;
+     char *const *argv;
+     const char *optstring;
+     const struct option *longopts;
+     int *longind;
+     int long_only;
+{
+  optarg = NULL;
+
+  if (optind == 0 || !__getopt_initialized)
+    {
+      if (optind == 0)
+	optind = 1;	/* Don't scan ARGV[0], the program name.  */
+      optstring = _getopt_initialize (argc, argv, optstring);
+      __getopt_initialized = 1;
+    }
+
+  /* Test whether ARGV[optind] points to a non-option argument.
+     Either it does not have option syntax, or there is an environment flag
+     from the shell indicating it is not an option.  The later information
+     is only used when the used in the GNU libc.  */
+#ifdef _LIBC
+# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0'	      \
+		      || (optind < nonoption_flags_len			      \
+			  && __getopt_nonoption_flags[optind] == '1'))
+#else
+# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
+#endif
+
+  if (nextchar == NULL || *nextchar == '\0')
+    {
+      /* Advance to the next ARGV-element.  */
+
+      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+	 moved back by the user (who may also have changed the arguments).  */
+      if (last_nonopt > optind)
+	last_nonopt = optind;
+      if (first_nonopt > optind)
+	first_nonopt = optind;
+
+      if (ordering == PERMUTE)
+	{
+	  /* If we have just processed some options following some non-options,
+	     exchange them so that the options come first.  */
+
+	  if (first_nonopt != last_nonopt && last_nonopt != optind)
+	    exchange ((char **) argv);
+	  else if (last_nonopt != optind)
+	    first_nonopt = optind;
+
+	  /* Skip any additional non-options
+	     and extend the range of non-options previously skipped.  */
+
+	  while (optind < argc && NONOPTION_P)
+	    optind++;
+	  last_nonopt = optind;
+	}
+
+      /* The special ARGV-element `--' means premature end of options.
+	 Skip it like a null option,
+	 then exchange with previous non-options as if it were an option,
+	 then skip everything else like a non-option.  */
+
+      if (optind != argc && !strcmp (argv[optind], "--"))
+	{
+	  optind++;
+
+	  if (first_nonopt != last_nonopt && last_nonopt != optind)
+	    exchange ((char **) argv);
+	  else if (first_nonopt == last_nonopt)
+	    first_nonopt = optind;
+	  last_nonopt = argc;
+
+	  optind = argc;
+	}
+
+      /* If we have done all the ARGV-elements, stop the scan
+	 and back over any non-options that we skipped and permuted.  */
+
+      if (optind == argc)
+	{
+	  /* Set the next-arg-index to point at the non-options
+	     that we previously skipped, so the caller will digest them.  */
+	  if (first_nonopt != last_nonopt)
+	    optind = first_nonopt;
+	  return -1;
+	}
+
+      /* If we have come to a non-option and did not permute it,
+	 either stop the scan or describe it to the caller and pass it by.  */
+
+      if (NONOPTION_P)
+	{
+	  if (ordering == REQUIRE_ORDER)
+	    return -1;
+	  optarg = argv[optind++];
+	  return 1;
+	}
+
+      /* We have found another option-ARGV-element.
+	 Skip the initial punctuation.  */
+
+      nextchar = (argv[optind] + 1
+		  + (longopts != NULL && argv[optind][1] == '-'));
+    }
+
+  /* Decode the current option-ARGV-element.  */
+
+  /* Check whether the ARGV-element is a long option.
+
+     If long_only and the ARGV-element has the form "-f", where f is
+     a valid short option, don't consider it an abbreviated form of
+     a long option that starts with f.  Otherwise there would be no
+     way to give the -f short option.
+
+     On the other hand, if there's a long option "fubar" and
+     the ARGV-element is "-fu", do consider that an abbreviation of
+     the long option, just like "--fu", and not "-f" with arg "u".
+
+     This distinction seems to be the most useful approach.  */
+
+  if (longopts != NULL
+      && (argv[optind][1] == '-'
+	  || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+    {
+      char *nameend;
+      const struct option *p;
+      const struct option *pfound = NULL;
+      int exact = 0;
+      int ambig = 0;
+      int indfound = -1;
+      int option_index;
+
+      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+	/* Do nothing.  */ ;
+
+      /* Test all long options for either exact match
+	 or abbreviated matches.  */
+      for (p = longopts, option_index = 0; p->name; p++, option_index++)
+	if (!strncmp (p->name, nextchar, nameend - nextchar))
+	  {
+	    if ((unsigned int) (nameend - nextchar)
+		== (unsigned int) strlen (p->name))
+	      {
+		/* Exact match found.  */
+		pfound = p;
+		indfound = option_index;
+		exact = 1;
+		break;
+	      }
+	    else if (pfound == NULL)
+	      {
+		/* First nonexact match found.  */
+		pfound = p;
+		indfound = option_index;
+	      }
+	    else
+	      /* Second or later nonexact match found.  */
+	      ambig = 1;
+	  }
+
+      if (ambig && !exact)
+	{
+	  if (opterr)
+	    fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
+		     argv[0], argv[optind]);
+	  nextchar += strlen (nextchar);
+	  optind++;
+	  optopt = 0;
+	  return '?';
+	}
+
+      if (pfound != NULL)
+	{
+	  option_index = indfound;
+	  optind++;
+	  if (*nameend)
+	    {
+	      /* Don't test has_arg with >, because some C compilers don't
+		 allow it to be used on enums.  */
+	      if (pfound->has_arg)
+		optarg = nameend + 1;
+	      else
+		{
+		  if (opterr)
+		    {
+		      if (argv[optind - 1][1] == '-')
+			/* --option */
+			fprintf (stderr,
+				 _("%s: option `--%s' doesn't allow an argument\n"),
+				 argv[0], pfound->name);
+		      else
+			/* +option or -option */
+			fprintf (stderr,
+				 _("%s: option `%c%s' doesn't allow an argument\n"),
+				 argv[0], argv[optind - 1][0], pfound->name);
+		    }
+
+		  nextchar += strlen (nextchar);
+
+		  optopt = pfound->val;
+		  return '?';
+		}
+	    }
+	  else if (pfound->has_arg == 1)
+	    {
+	      if (optind < argc)
+		optarg = argv[optind++];
+	      else
+		{
+		  if (opterr)
+		    fprintf (stderr,
+			   _("%s: option `%s' requires an argument\n"),
+			   argv[0], argv[optind - 1]);
+		  nextchar += strlen (nextchar);
+		  optopt = pfound->val;
+		  return optstring[0] == ':' ? ':' : '?';
+		}
+	    }
+	  nextchar += strlen (nextchar);
+	  if (longind != NULL)
+	    *longind = option_index;
+	  if (pfound->flag)
+	    {
+	      *(pfound->flag) = pfound->val;
+	      return 0;
+	    }
+	  return pfound->val;
+	}
+
+      /* Can't find it as a long option.  If this is not getopt_long_only,
+	 or the option starts with '--' or is not a valid short
+	 option, then it's an error.
+	 Otherwise interpret it as a short option.  */
+      if (!long_only || argv[optind][1] == '-'
+	  || my_index (optstring, *nextchar) == NULL)
+	{
+	  if (opterr)
+	    {
+	      if (argv[optind][1] == '-')
+		/* --option */
+		fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+			 argv[0], nextchar);
+	      else
+		/* +option or -option */
+		fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+			 argv[0], argv[optind][0], nextchar);
+	    }
+	  nextchar = (char *) "";
+	  optind++;
+	  optopt = 0;
+	  return '?';
+	}
+    }
+
+  /* Look at and handle the next short option-character.  */
+
+  {
+    char c = *nextchar++;
+    char *temp = my_index (optstring, c);
+
+    /* Increment `optind' when we start to process its last character.  */
+    if (*nextchar == '\0')
+      ++optind;
+
+    if (temp == NULL || c == ':')
+      {
+	if (opterr)
+	  {
+	    if (posixly_correct)
+	      /* 1003.2 specifies the format of this message.  */
+	      fprintf (stderr, _("%s: illegal option -- %c\n"),
+		       argv[0], c);
+	    else
+	      fprintf (stderr, _("%s: invalid option -- %c\n"),
+		       argv[0], c);
+	  }
+	optopt = c;
+	return '?';
+      }
+    /* Convenience. Treat POSIX -W foo same as long option --foo */
+    if (temp[0] == 'W' && temp[1] == ';')
+      {
+	char *nameend;
+	const struct option *p;
+	const struct option *pfound = NULL;
+	int exact = 0;
+	int ambig = 0;
+	int indfound = 0;
+	int option_index;
+
+	/* This is an option that requires an argument.  */
+	if (*nextchar != '\0')
+	  {
+	    optarg = nextchar;
+	    /* If we end this ARGV-element by taking the rest as an arg,
+	       we must advance to the next element now.  */
+	    optind++;
+	  }
+	else if (optind == argc)
+	  {
+	    if (opterr)
+	      {
+		/* 1003.2 specifies the format of this message.  */
+		fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+			 argv[0], c);
+	      }
+	    optopt = c;
+	    if (optstring[0] == ':')
+	      c = ':';
+	    else
+	      c = '?';
+	    return c;
+	  }
+	else
+	  /* We already incremented `optind' once;
+	     increment it again when taking next ARGV-elt as argument.  */
+	  optarg = argv[optind++];
+
+	/* optarg is now the argument, see if it's in the
+	   table of longopts.  */
+
+	for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
+	  /* Do nothing.  */ ;
+
+	/* Test all long options for either exact match
+	   or abbreviated matches.  */
+	for (p = longopts, option_index = 0; p->name; p++, option_index++)
+	  if (!strncmp (p->name, nextchar, nameend - nextchar))
+	    {
+	      if ((unsigned int) (nameend - nextchar) == strlen (p->name))
+		{
+		  /* Exact match found.  */
+		  pfound = p;
+		  indfound = option_index;
+		  exact = 1;
+		  break;
+		}
+	      else if (pfound == NULL)
+		{
+		  /* First nonexact match found.  */
+		  pfound = p;
+		  indfound = option_index;
+		}
+	      else
+		/* Second or later nonexact match found.  */
+		ambig = 1;
+	    }
+	if (ambig && !exact)
+	  {
+	    if (opterr)
+	      fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
+		       argv[0], argv[optind]);
+	    nextchar += strlen (nextchar);
+	    optind++;
+	    return '?';
+	  }
+	if (pfound != NULL)
+	  {
+	    option_index = indfound;
+	    if (*nameend)
+	      {
+		/* Don't test has_arg with >, because some C compilers don't
+		   allow it to be used on enums.  */
+		if (pfound->has_arg)
+		  optarg = nameend + 1;
+		else
+		  {
+		    if (opterr)
+		      fprintf (stderr, _("\
+%s: option `-W %s' doesn't allow an argument\n"),
+			       argv[0], pfound->name);
+
+		    nextchar += strlen (nextchar);
+		    return '?';
+		  }
+	      }
+	    else if (pfound->has_arg == 1)
+	      {
+		if (optind < argc)
+		  optarg = argv[optind++];
+		else
+		  {
+		    if (opterr)
+		      fprintf (stderr,
+			       _("%s: option `%s' requires an argument\n"),
+			       argv[0], argv[optind - 1]);
+		    nextchar += strlen (nextchar);
+		    return optstring[0] == ':' ? ':' : '?';
+		  }
+	      }
+	    nextchar += strlen (nextchar);
+	    if (longind != NULL)
+	      *longind = option_index;
+	    if (pfound->flag)
+	      {
+		*(pfound->flag) = pfound->val;
+		return 0;
+	      }
+	    return pfound->val;
+	  }
+	  nextchar = NULL;
+	  return 'W';	/* Let the application handle it.   */
+      }
+    if (temp[1] == ':')
+      {
+	if (temp[2] == ':')
+	  {
+	    /* This is an option that accepts an argument optionally.  */
+	    if (*nextchar != '\0')
+	      {
+		optarg = nextchar;
+		optind++;
+	      }
+	    else
+	      optarg = NULL;
+	    nextchar = NULL;
+	  }
+	else
+	  {
+	    /* This is an option that requires an argument.  */
+	    if (*nextchar != '\0')
+	      {
+		optarg = nextchar;
+		/* If we end this ARGV-element by taking the rest as an arg,
+		   we must advance to the next element now.  */
+		optind++;
+	      }
+	    else if (optind == argc)
+	      {
+		if (opterr)
+		  {
+		    /* 1003.2 specifies the format of this message.  */
+		    fprintf (stderr,
+			   _("%s: option requires an argument -- %c\n"),
+			   argv[0], c);
+		  }
+		optopt = c;
+		if (optstring[0] == ':')
+		  c = ':';
+		else
+		  c = '?';
+	      }
+	    else
+	      /* We already incremented `optind' once;
+		 increment it again when taking next ARGV-elt as argument.  */
+	      optarg = argv[optind++];
+	    nextchar = NULL;
+	  }
+      }
+    return c;
+  }
+}
+
+int
+getopt (argc, argv, optstring)
+     int argc;
+     char *const *argv;
+     const char *optstring;
+{
+  return _getopt_internal (argc, argv, optstring,
+			   (const struct option *) 0,
+			   (int *) 0,
+			   0);
+}
+
+#endif	/* Not ELIDE_CODE.  */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+   the above definition of `getopt'.  */
+
+int
+main (argc, argv)
+     int argc;
+     char **argv;
+{
+  int c;
+  int digit_optind = 0;
+
+  while (1)
+    {
+      int this_option_optind = optind ? optind : 1;
+
+      c = getopt (argc, argv, "abc:d:0123456789");
+      if (c == -1)
+	break;
+
+      switch (c)
+	{
+	case '0':
+	case '1':
+	case '2':
+	case '3':
+	case '4':
+	case '5':
+	case '6':
+	case '7':
+	case '8':
+	case '9':
+	  if (digit_optind != 0 && digit_optind != this_option_optind)
+	    printf ("digits occur in two different argv-elements.\n");
+	  digit_optind = this_option_optind;
+	  printf ("option %c\n", c);
+	  break;
+
+	case 'a':
+	  printf ("option a\n");
+	  break;
+
+	case 'b':
+	  printf ("option b\n");
+	  break;
+
+	case 'c':
+	  printf ("option c with value `%s'\n", optarg);
+	  break;
+
+	case '?':
+	  break;
+
+	default:
+	  printf ("?? getopt returned character code 0%o ??\n", c);
+	}
+    }
+
+  if (optind < argc)
+    {
+      printf ("non-option ARGV-elements: ");
+      while (optind < argc)
+	printf ("%s ", argv[optind++]);
+      printf ("\n");
+    }
+
+  exit (0);
+}
+
+#endif /* TEST */

Modified: freeswitch/trunk/libs/speex/src/getopt1.c
==============================================================================
--- freeswitch/trunk/libs/speex/src/getopt1.c	(original)
+++ freeswitch/trunk/libs/speex/src/getopt1.c	Fri Sep 21 14:49:14 2007
@@ -1,188 +1,188 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
-     Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "getopt_win.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
-   reject `defined (const)'.  */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
-   actually compiling the library itself.  This code is part of the GNU C
-   Library, but also included in many other GNU distributions.  Compiling
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef	NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
-     int argc;
-     char *const *argv;
-     const char *options;
-     const struct option *long_options;
-     int *opt_index;
-{
-  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
-   If an option that starts with '-' (not '--') doesn't match a long option,
-   but does match a short option, it is parsed as a short option
-   instead.  */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
-     int argc;
-     char *const *argv;
-     const char *options;
-     const struct option *long_options;
-     int *opt_index;
-{
-  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif	/* Not ELIDE_CODE.  */
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  int c;
-  int digit_optind = 0;
-
-  while (1)
-    {
-      int this_option_optind = optind ? optind : 1;
-      int option_index = 0;
-      static struct option long_options[] =
-      {
-	{"add", 1, 0, 0},
-	{"append", 0, 0, 0},
-	{"delete", 1, 0, 0},
-	{"verbose", 0, 0, 0},
-	{"create", 0, 0, 0},
-	{"file", 1, 0, 0},
-	{0, 0, 0, 0}
-      };
-
-      c = getopt_long (argc, argv, "abc:d:0123456789",
-		       long_options, &option_index);
-      if (c == -1)
-	break;
-
-      switch (c)
-	{
-	case 0:
-	  printf ("option %s", long_options[option_index].name);
-	  if (optarg)
-	    printf (" with arg %s", optarg);
-	  printf ("\n");
-	  break;
-
-	case '0':
-	case '1':
-	case '2':
-	case '3':
-	case '4':
-	case '5':
-	case '6':
-	case '7':
-	case '8':
-	case '9':
-	  if (digit_optind != 0 && digit_optind != this_option_optind)
-	    printf ("digits occur in two different argv-elements.\n");
-	  digit_optind = this_option_optind;
-	  printf ("option %c\n", c);
-	  break;
-
-	case 'a':
-	  printf ("option a\n");
-	  break;
-
-	case 'b':
-	  printf ("option b\n");
-	  break;
-
-	case 'c':
-	  printf ("option c with value `%s'\n", optarg);
-	  break;
-
-	case 'd':
-	  printf ("option d with value `%s'\n", optarg);
-	  break;
-
-	case '?':
-	  break;
-
-	default:
-	  printf ("?? getopt returned character code 0%o ??\n", c);
-	}
-    }
-
-  if (optind < argc)
-    {
-      printf ("non-option ARGV-elements: ");
-      while (optind < argc)
-	printf ("%s ", argv[optind++]);
-      printf ("\n");
-    }
-
-  exit (0);
-}
-
-#endif /* TEST */
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
+     Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "getopt_win.h"
+
+#if !defined __STDC__ || !__STDC__
+/* This is a separate conditional since some stdc systems
+   reject `defined (const)'.  */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+   actually compiling the library itself.  This code is part of the GNU C
+   Library, but also included in many other GNU distributions.  Compiling
+   and linking in this code is a waste when using the GNU C library
+   (especially if it is a shared library).  Rather than having every GNU
+   program understand `configure --with-gnu-libc' and omit the object files,
+   it is simpler to just do this in the source for each such file.  */
+
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
+
+
+/* This needs to come after some library #include
+   to get __GNU_LIBRARY__ defined.  */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#endif
+
+#ifndef	NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+     int argc;
+     char *const *argv;
+     const char *options;
+     const struct option *long_options;
+     int *opt_index;
+{
+  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+   If an option that starts with '-' (not '--') doesn't match a long option,
+   but does match a short option, it is parsed as a short option
+   instead.  */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+     int argc;
+     char *const *argv;
+     const char *options;
+     const struct option *long_options;
+     int *opt_index;
+{
+  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif	/* Not ELIDE_CODE.  */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+     int argc;
+     char **argv;
+{
+  int c;
+  int digit_optind = 0;
+
+  while (1)
+    {
+      int this_option_optind = optind ? optind : 1;
+      int option_index = 0;
+      static struct option long_options[] =
+      {
+	{"add", 1, 0, 0},
+	{"append", 0, 0, 0},
+	{"delete", 1, 0, 0},
+	{"verbose", 0, 0, 0},
+	{"create", 0, 0, 0},
+	{"file", 1, 0, 0},
+	{0, 0, 0, 0}
+      };
+
+      c = getopt_long (argc, argv, "abc:d:0123456789",
+		       long_options, &option_index);
+      if (c == -1)
+	break;
+
+      switch (c)
+	{
+	case 0:
+	  printf ("option %s", long_options[option_index].name);
+	  if (optarg)
+	    printf (" with arg %s", optarg);
+	  printf ("\n");
+	  break;
+
+	case '0':
+	case '1':
+	case '2':
+	case '3':
+	case '4':
+	case '5':
+	case '6':
+	case '7':
+	case '8':
+	case '9':
+	  if (digit_optind != 0 && digit_optind != this_option_optind)
+	    printf ("digits occur in two different argv-elements.\n");
+	  digit_optind = this_option_optind;
+	  printf ("option %c\n", c);
+	  break;
+
+	case 'a':
+	  printf ("option a\n");
+	  break;
+
+	case 'b':
+	  printf ("option b\n");
+	  break;
+
+	case 'c':
+	  printf ("option c with value `%s'\n", optarg);
+	  break;
+
+	case 'd':
+	  printf ("option d with value `%s'\n", optarg);
+	  break;
+
+	case '?':
+	  break;
+
+	default:
+	  printf ("?? getopt returned character code 0%o ??\n", c);
+	}
+    }
+
+  if (optind < argc)
+    {
+      printf ("non-option ARGV-elements: ");
+      while (optind < argc)
+	printf ("%s ", argv[optind++]);
+      printf ("\n");
+    }
+
+  exit (0);
+}
+
+#endif /* TEST */

Modified: freeswitch/trunk/libs/speex/src/getopt_win.h
==============================================================================
--- freeswitch/trunk/libs/speex/src/getopt_win.h	(original)
+++ freeswitch/trunk/libs/speex/src/getopt_win.h	Fri Sep 21 14:49:14 2007
@@ -1,169 +1,169 @@
-/* Declarations for getopt.
-   Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
-
-   On entry to `getopt', zero means this is the first call; initialize.
-
-   When `getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, `optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
-   for unrecognized options.  */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized.  */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
-   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
-   of `struct option' terminated by an element containing a name which is
-   zero.
-
-   The field `has_arg' is:
-   no_argument		(or 0) if the option does not take an argument,
-   required_argument	(or 1) if the option requires an argument,
-   optional_argument 	(or 2) if the option takes an optional argument.
-
-   If the field `flag' is not NULL, it points to a variable that is set
-   to the value given in the field `val' when the option is found, but
-   left unchanged if the option is not found.
-
-   To have a long-named option do something other than set an `int' to
-   a compiled-in constant, such as set a value from `optarg', set the
-   option's `flag' field to zero and its `val' field to a nonzero
-   value (the equivalent single-letter option character, if there is
-   one).  For long options that have a zero `flag' field, `getopt'
-   returns the contents of the `val' field.  */
-
-struct option
-{
-# if defined __STDC__ && __STDC__
-  const char *name;
-# else
-  char *name;
-# endif
-  /* has_arg can't be an enum because some compilers complain about
-     type mismatches in all the code that assumes it is an int.  */
-  int has_arg;
-  int *flag;
-  int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'.  */
-
-# define no_argument		0
-# define required_argument	1
-# define optional_argument	2
-#endif	/* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
-   arguments in ARGV (ARGC of them, minus the program name) for
-   options given in OPTS.
-
-   Return the option character from OPTS just read.  Return -1 when
-   there are no more options.  For unrecognized options, or options
-   missing arguments, `optopt' is set to the option letter, and '?' is
-   returned.
-
-   The OPTS string is a list of characters which are recognized option
-   letters, optionally followed by colons, specifying that that letter
-   takes an argument, to be placed in `optarg'.
-
-   If a letter in OPTS is followed by two colons, its argument is
-   optional.  This behavior is specific to the GNU `getopt'.
-
-   The argument `--' causes premature termination of argument
-   scanning, explicitly telling `getopt' that there are no more
-   options.
-
-   If OPTS begins with `--', then non-option arguments are treated as
-   arguments to the option '\0'.  This behavior is specific to the GNU
-   `getopt'.  */
-
-#if defined __STDC__ && __STDC__
-# ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
-   differences in the consts, in stdlib.h.  To avoid compilation
-   errors, only prototype getopt for the GNU C library.  */
-extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
-# else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
-
-# ifndef __need_getopt
-extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
-		        const struct option *__longopts, int *__longind);
-extern int getopt_long_only (int __argc, char *const *__argv,
-			     const char *__shortopts,
-		             const struct option *__longopts, int *__longind);
-
-/* Internal only.  Users should not call this directly.  */
-extern int _getopt_internal (int __argc, char *const *__argv,
-			     const char *__shortopts,
-		             const struct option *__longopts, int *__longind,
-			     int __long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
-
-#ifdef	__cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations.  */
-#undef __need_getopt
-
-#endif /* getopt.h */
+/* Declarations for getopt.
+   Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _GETOPT_H
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of `struct option' terminated by an element containing a name which is
+   zero.
+
+   The field `has_arg' is:
+   no_argument		(or 0) if the option does not take an argument,
+   required_argument	(or 1) if the option requires an argument,
+   optional_argument 	(or 2) if the option takes an optional argument.
+
+   If the field `flag' is not NULL, it points to a variable that is set
+   to the value given in the field `val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an `int' to
+   a compiled-in constant, such as set a value from `optarg', set the
+   option's `flag' field to zero and its `val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero `flag' field, `getopt'
+   returns the contents of the `val' field.  */
+
+struct option
+{
+# if defined __STDC__ && __STDC__
+  const char *name;
+# else
+  char *name;
+# endif
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'.  */
+
+# define no_argument		0
+# define required_argument	1
+# define optional_argument	2
+#endif	/* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+   arguments in ARGV (ARGC of them, minus the program name) for
+   options given in OPTS.
+
+   Return the option character from OPTS just read.  Return -1 when
+   there are no more options.  For unrecognized options, or options
+   missing arguments, `optopt' is set to the option letter, and '?' is
+   returned.
+
+   The OPTS string is a list of characters which are recognized option
+   letters, optionally followed by colons, specifying that that letter
+   takes an argument, to be placed in `optarg'.
+
+   If a letter in OPTS is followed by two colons, its argument is
+   optional.  This behavior is specific to the GNU `getopt'.
+
+   The argument `--' causes premature termination of argument
+   scanning, explicitly telling `getopt' that there are no more
+   options.
+
+   If OPTS begins with `--', then non-option arguments are treated as
+   arguments to the option '\0'.  This behavior is specific to the GNU
+   `getopt'.  */
+
+#if defined __STDC__ && __STDC__
+# ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+   differences in the consts, in stdlib.h.  To avoid compilation
+   errors, only prototype getopt for the GNU C library.  */
+extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
+# else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+# endif /* __GNU_LIBRARY__ */
+
+# ifndef __need_getopt
+extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
+		        const struct option *__longopts, int *__longind);
+extern int getopt_long_only (int __argc, char *const *__argv,
+			     const char *__shortopts,
+		             const struct option *__longopts, int *__longind);
+
+/* Internal only.  Users should not call this directly.  */
+extern int _getopt_internal (int __argc, char *const *__argv,
+			     const char *__shortopts,
+		             const struct option *__longopts, int *__longind,
+			     int __long_only);
+# endif
+#else /* not __STDC__ */
+extern int getopt ();
+# ifndef __need_getopt
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+# endif
+#endif /* __STDC__ */
+
+#ifdef	__cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations.  */
+#undef __need_getopt
+
+#endif /* getopt.h */

Modified: freeswitch/trunk/libs/speex/src/wave_out.c
==============================================================================
--- freeswitch/trunk/libs/speex/src/wave_out.c	(original)
+++ freeswitch/trunk/libs/speex/src/wave_out.c	Fri Sep 21 14:49:14 2007
@@ -1,220 +1,220 @@
-/* Copyright (c) 2002, John Edwards
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-
-   - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-   - Neither the name of the Xiph.org Foundation nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-/* Set TABS = 4 */
-/********************************************************************
-
- function: To provide playback of 16 bit PCM wave data in Win32
-           environments from decoded compressed files.
-
- ********************************************************************/
-
-#if defined WIN32 || defined _WIN32
-
-#include <string.h>
-#include <errno.h>
-#include "wave_out.h"
-
-#define MAXWAVESIZE     4294967040LU
-#define MAX_WAVEBLOCKS    32
-
-// This is modified for USE_WIN_AUDIO - ONLY 2002-02-27
-
-
-static CRITICAL_SECTION  cs;
-static HWAVEOUT          dev                    = NULL;
-static int               ScheduledBlocks        = 0;
-static int               PlayedWaveHeadersCount = 0;          // free index
-static WAVEHDR*          PlayedWaveHeaders [MAX_WAVEBLOCKS];
-
-static int
-Box ( const char* msg )
-{
-	MessageBox ( NULL, msg, " "VERSION_STRING": Error Message . . .", MB_OK | MB_ICONEXCLAMATION );
-	return -1;
-}
-
-
-/*
- *  This function registers already played WAVE chunks. Freeing is done by free_memory(),
- */
-
-static void CALLBACK
-wave_callback ( HWAVE hWave, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
-{
-	if ( uMsg == WOM_DONE ) {
-		EnterCriticalSection ( &cs );
-		PlayedWaveHeaders [PlayedWaveHeadersCount++] = (WAVEHDR*) dwParam1;
-		LeaveCriticalSection ( &cs );
-	}
-}
-
-
-static void
-free_memory ( void )
-{
-	WAVEHDR*  wh;
-	HGLOBAL   hg;
-
-	EnterCriticalSection ( &cs );
-	wh = PlayedWaveHeaders [--PlayedWaveHeadersCount];
-	ScheduledBlocks--;                               // decrease the number of USED blocks
-	LeaveCriticalSection ( &cs );
-
-	waveOutUnprepareHeader ( dev, wh, sizeof (WAVEHDR) );
-
-	hg = GlobalHandle ( wh -> lpData );       // Deallocate the buffer memory
-	GlobalUnlock (hg);
-	GlobalFree   (hg);
-
-	hg = GlobalHandle ( wh );                 // Deallocate the header memory
-	GlobalUnlock (hg);
-	GlobalFree   (hg);
-}
-
-
-Int
-Set_WIN_Params ( FILE_T   dummyFile ,
-                 Ldouble  SampleFreq,
-                 Uint     BitsPerSample,
-                 Uint     Channels )
-{
-	WAVEFORMATEX  outFormat;
-	UINT          deviceID = WAVE_MAPPER;
-
-	(void) dummyFile;
-
-	if ( waveOutGetNumDevs () == 0 )
-		return Box ( "No audio device present." );
-
-	outFormat.wFormatTag      = WAVE_FORMAT_PCM;
-	outFormat.wBitsPerSample  = BitsPerSample;
-	outFormat.nChannels       = Channels;
-	outFormat.nSamplesPerSec  = (unsigned long)(SampleFreq + 0.5);
-	outFormat.nBlockAlign     = (outFormat.wBitsPerSample + 7) / 8 * outFormat.nChannels;
-	outFormat.nAvgBytesPerSec = outFormat.nSamplesPerSec * outFormat.nBlockAlign;
-
-	switch ( waveOutOpen ( &dev, deviceID, &outFormat, (DWORD)wave_callback, 0, CALLBACK_FUNCTION ) )
-	{
-		case MMSYSERR_ALLOCATED:   return Box ( "Device is already open." );
-		case MMSYSERR_BADDEVICEID: return Box ( "The specified device is out of range." );
-		case MMSYSERR_NODRIVER:    return Box ( "There is no audio driver in this system." );
-		case MMSYSERR_NOMEM:       return Box ( "Unable to allocate sound memory." );
-		case WAVERR_BADFORMAT:     return Box ( "This audio format is not supported." );
-		case WAVERR_SYNC:          return Box ( "The device is synchronous." );
-		default:                   return Box ( "Unknown media error." );
-		case MMSYSERR_NOERROR:     break;
-	}
-
-	waveOutReset ( dev );
-	InitializeCriticalSection ( &cs );
-	SetPriorityClass ( GetCurrentProcess (), HIGH_PRIORITY_CLASS );
-	return 0;
-}
-
-
-int
-WIN_Play_Samples ( const void* data, size_t len )
-{
-	HGLOBAL    hg;
-	HGLOBAL    hg2;
-	LPWAVEHDR  wh;
-	void*      allocptr;
-
-	do {
-		while ( PlayedWaveHeadersCount > 0 )                // free used blocks ...
-			free_memory ();
-
-		if ( ScheduledBlocks < sizeof(PlayedWaveHeaders)/sizeof(*PlayedWaveHeaders) ) // wait for a free block ...
-			break;
-		Sleep (26);
-	} while (1);
-
-	if ( (hg2 = GlobalAlloc ( GMEM_MOVEABLE, len )) == NULL )   // allocate some memory for a copy of the buffer
-		return Box ( "GlobalAlloc failed." );
-
-	allocptr = GlobalLock (hg2);
-	CopyMemory ( allocptr, data, len );                         // Here we can call any modification output functions we want....
-
-	if ( (hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof (WAVEHDR))) == NULL ) // now make a header and WRITE IT!
-		return -1;
-
-	wh                   = GlobalLock (hg);
-	wh -> dwBufferLength = len;
-	wh -> lpData         = allocptr;
-
-	if ( waveOutPrepareHeader ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR ) {
-		GlobalUnlock (hg);
-		GlobalFree   (hg);
-		return -1;
-	}
-
-	if ( waveOutWrite ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR ) {
-		GlobalUnlock (hg);
-		GlobalFree   (hg);
-		return -1;
-	}
-
-	EnterCriticalSection ( &cs );
-	ScheduledBlocks++;
-	LeaveCriticalSection ( &cs );
-
-	return len;
-}
-
-
-int
-WIN_Audio_close ( void )
-{
-	if ( dev != NULL ) {
-
-		while ( ScheduledBlocks > 0 ) {
-			Sleep (ScheduledBlocks);
-			while ( PlayedWaveHeadersCount > 0 )         // free used blocks ...
-				free_memory ();
-		}
-
-		waveOutReset (dev);      // reset the device
-		waveOutClose (dev);      // close the device
-		dev = NULL;
-	}
-
-	DeleteCriticalSection ( &cs );
-	ScheduledBlocks = 0;
-	return 0;
-}
-
-#endif
-
-/* end of wave_out.c */
+/* Copyright (c) 2002, John Edwards
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+   - Neither the name of the Xiph.org Foundation nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+/* Set TABS = 4 */
+/********************************************************************
+
+ function: To provide playback of 16 bit PCM wave data in Win32
+           environments from decoded compressed files.
+
+ ********************************************************************/
+
+#if defined WIN32 || defined _WIN32
+
+#include <string.h>
+#include <errno.h>
+#include "wave_out.h"
+
+#define MAXWAVESIZE     4294967040LU
+#define MAX_WAVEBLOCKS    32
+
+// This is modified for USE_WIN_AUDIO - ONLY 2002-02-27
+
+
+static CRITICAL_SECTION  cs;
+static HWAVEOUT          dev                    = NULL;
+static int               ScheduledBlocks        = 0;
+static int               PlayedWaveHeadersCount = 0;          // free index
+static WAVEHDR*          PlayedWaveHeaders [MAX_WAVEBLOCKS];
+
+static int
+Box ( const char* msg )
+{
+	MessageBox ( NULL, msg, " "VERSION_STRING": Error Message . . .", MB_OK | MB_ICONEXCLAMATION );
+	return -1;
+}
+
+
+/*
+ *  This function registers already played WAVE chunks. Freeing is done by free_memory(),
+ */
+
+static void CALLBACK
+wave_callback ( HWAVE hWave, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
+{
+	if ( uMsg == WOM_DONE ) {
+		EnterCriticalSection ( &cs );
+		PlayedWaveHeaders [PlayedWaveHeadersCount++] = (WAVEHDR*) dwParam1;
+		LeaveCriticalSection ( &cs );
+	}
+}
+
+
+static void
+free_memory ( void )
+{
+	WAVEHDR*  wh;
+	HGLOBAL   hg;
+
+	EnterCriticalSection ( &cs );
+	wh = PlayedWaveHeaders [--PlayedWaveHeadersCount];
+	ScheduledBlocks--;                               // decrease the number of USED blocks
+	LeaveCriticalSection ( &cs );
+
+	waveOutUnprepareHeader ( dev, wh, sizeof (WAVEHDR) );
+
+	hg = GlobalHandle ( wh -> lpData );       // Deallocate the buffer memory
+	GlobalUnlock (hg);
+	GlobalFree   (hg);
+
+	hg = GlobalHandle ( wh );                 // Deallocate the header memory
+	GlobalUnlock (hg);
+	GlobalFree   (hg);
+}
+
+
+Int
+Set_WIN_Params ( FILE_T   dummyFile ,
+                 Ldouble  SampleFreq,
+                 Uint     BitsPerSample,
+                 Uint     Channels )
+{
+	WAVEFORMATEX  outFormat;
+	UINT          deviceID = WAVE_MAPPER;
+
+	(void) dummyFile;
+
+	if ( waveOutGetNumDevs () == 0 )
+		return Box ( "No audio device present." );
+
+	outFormat.wFormatTag      = WAVE_FORMAT_PCM;
+	outFormat.wBitsPerSample  = BitsPerSample;
+	outFormat.nChannels       = Channels;
+	outFormat.nSamplesPerSec  = (unsigned long)(SampleFreq + 0.5);
+	outFormat.nBlockAlign     = (outFormat.wBitsPerSample + 7) / 8 * outFormat.nChannels;
+	outFormat.nAvgBytesPerSec = outFormat.nSamplesPerSec * outFormat.nBlockAlign;
+
+	switch ( waveOutOpen ( &dev, deviceID, &outFormat, (DWORD)wave_callback, 0, CALLBACK_FUNCTION ) )
+	{
+		case MMSYSERR_ALLOCATED:   return Box ( "Device is already open." );
+		case MMSYSERR_BADDEVICEID: return Box ( "The specified device is out of range." );
+		case MMSYSERR_NODRIVER:    return Box ( "There is no audio driver in this system." );
+		case MMSYSERR_NOMEM:       return Box ( "Unable to allocate sound memory." );
+		case WAVERR_BADFORMAT:     return Box ( "This audio format is not supported." );
+		case WAVERR_SYNC:          return Box ( "The device is synchronous." );
+		default:                   return Box ( "Unknown media error." );
+		case MMSYSERR_NOERROR:     break;
+	}
+
+	waveOutReset ( dev );
+	InitializeCriticalSection ( &cs );
+	SetPriorityClass ( GetCurrentProcess (), HIGH_PRIORITY_CLASS );
+	return 0;
+}
+
+
+int
+WIN_Play_Samples ( const void* data, size_t len )
+{
+	HGLOBAL    hg;
+	HGLOBAL    hg2;
+	LPWAVEHDR  wh;
+	void*      allocptr;
+
+	do {
+		while ( PlayedWaveHeadersCount > 0 )                // free used blocks ...
+			free_memory ();
+
+		if ( ScheduledBlocks < sizeof(PlayedWaveHeaders)/sizeof(*PlayedWaveHeaders) ) // wait for a free block ...
+			break;
+		Sleep (26);
+	} while (1);
+
+	if ( (hg2 = GlobalAlloc ( GMEM_MOVEABLE, len )) == NULL )   // allocate some memory for a copy of the buffer
+		return Box ( "GlobalAlloc failed." );
+
+	allocptr = GlobalLock (hg2);
+	CopyMemory ( allocptr, data, len );                         // Here we can call any modification output functions we want....
+
+	if ( (hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof (WAVEHDR))) == NULL ) // now make a header and WRITE IT!
+		return -1;
+
+	wh                   = GlobalLock (hg);
+	wh -> dwBufferLength = len;
+	wh -> lpData         = allocptr;
+
+	if ( waveOutPrepareHeader ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR ) {
+		GlobalUnlock (hg);
+		GlobalFree   (hg);
+		return -1;
+	}
+
+	if ( waveOutWrite ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR ) {
+		GlobalUnlock (hg);
+		GlobalFree   (hg);
+		return -1;
+	}
+
+	EnterCriticalSection ( &cs );
+	ScheduledBlocks++;
+	LeaveCriticalSection ( &cs );
+
+	return len;
+}
+
+
+int
+WIN_Audio_close ( void )
+{
+	if ( dev != NULL ) {
+
+		while ( ScheduledBlocks > 0 ) {
+			Sleep (ScheduledBlocks);
+			while ( PlayedWaveHeadersCount > 0 )         // free used blocks ...
+				free_memory ();
+		}
+
+		waveOutReset (dev);      // reset the device
+		waveOutClose (dev);      // close the device
+		dev = NULL;
+	}
+
+	DeleteCriticalSection ( &cs );
+	ScheduledBlocks = 0;
+	return 0;
+}
+
+#endif
+
+/* end of wave_out.c */

Modified: freeswitch/trunk/libs/speex/src/wave_out.h
==============================================================================
--- freeswitch/trunk/libs/speex/src/wave_out.h	(original)
+++ freeswitch/trunk/libs/speex/src/wave_out.h	Fri Sep 21 14:49:14 2007
@@ -1,71 +1,71 @@
-/* Copyright (c) 2002, John Edwards
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-
-   - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-   - Neither the name of the Xiph.org Foundation nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-//    WAVE_OUT.H - Necessary stuff for WIN_AUDIO
-
-#ifndef WAVE_OUT_H
-#define WAVE_OUT_H
-
-#include <stdio.h>
-#include <windows.h>
-#ifdef __MINGW32__
-#include <mmsystem.h>
-#endif
-
-#define VERSION_STRING "\n 0.7.0\n"
-
-#define Cdecl               __cdecl
-#define __attribute__(x)
-#define sleep(__sec)        Sleep ((__sec) * 1000)
-#define inline              __inline
-#define restrict
-
-//// constants /////////////////////////////////////////////////////
-
-#define CD_SAMPLE_FREQ         44.1e3
-#define SAMPLE_SIZE            16
-#define SAMPLE_SIZE_STRING     ""
-#define WINAUDIO_FD            ((FILE_T)-128)
-#define FILE_T                 FILE*
-#define INVALID_FILEDESC       NULL
-
-//// Simple types //////////////////////////////////////////////////
-
-typedef signed   int        Int;        // at least -32767...+32767, fast type
-typedef unsigned int        Uint;       // at least 0...65535, fast type
-typedef long double         Ldouble;    // most exact floating point format
-
-//// procedures/functions //////////////////////////////////////////
-// wave_out.c
-Int        Set_WIN_Params             ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels);
-int        WIN_Play_Samples           ( const void* buff, size_t len );
-int        WIN_Audio_close            ( void );
-
-#endif /* WAVE_OUT_H */
+/* Copyright (c) 2002, John Edwards
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+   - Neither the name of the Xiph.org Foundation nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+//    WAVE_OUT.H - Necessary stuff for WIN_AUDIO
+
+#ifndef WAVE_OUT_H
+#define WAVE_OUT_H
+
+#include <stdio.h>
+#include <windows.h>
+#ifdef __MINGW32__
+#include <mmsystem.h>
+#endif
+
+#define VERSION_STRING "\n 0.7.0\n"
+
+#define Cdecl               __cdecl
+#define __attribute__(x)
+#define sleep(__sec)        Sleep ((__sec) * 1000)
+#define inline              __inline
+#define restrict
+
+//// constants /////////////////////////////////////////////////////
+
+#define CD_SAMPLE_FREQ         44.1e3
+#define SAMPLE_SIZE            16
+#define SAMPLE_SIZE_STRING     ""
+#define WINAUDIO_FD            ((FILE_T)-128)
+#define FILE_T                 FILE*
+#define INVALID_FILEDESC       NULL
+
+//// Simple types //////////////////////////////////////////////////
+
+typedef signed   int        Int;        // at least -32767...+32767, fast type
+typedef unsigned int        Uint;       // at least 0...65535, fast type
+typedef long double         Ldouble;    // most exact floating point format
+
+//// procedures/functions //////////////////////////////////////////
+// wave_out.c
+Int        Set_WIN_Params             ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels);
+int        WIN_Play_Samples           ( const void* buff, size_t len );
+int        WIN_Audio_close            ( void );
+
+#endif /* WAVE_OUT_H */

Modified: freeswitch/trunk/libs/speex/symbian/config.h
==============================================================================
--- freeswitch/trunk/libs/speex/symbian/config.h	(original)
+++ freeswitch/trunk/libs/speex/symbian/config.h	Fri Sep 21 14:49:14 2007
@@ -1,57 +1,57 @@
-/*
-   Copyright (C) 2003 Commonwealth Scientific and Industrial Research
-   Organisation (CSIRO) Australia
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-
-   - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-   - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-   - Neither the name of CSIRO Australia nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-   PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-/* An inline macro is required for use of the inline keyword as not all C compilers support */
-/* inline.  It is officially C99 and C++ only */
-
-#ifdef __WINS__
-
-#define inline __inline
-
-/* Disable some pointless/stupid warnings */
-
-#pragma warning(disable: 4100) /* unreferenced formal parameter */
-#pragma warning(disable: 4127) /* conditional expression is constant */
-#pragma warning(disable: 4305) /* truncation from '...' to '...' */
-#pragma warning(disable: 4244) /* conversion from '...' to '...', possible loss of data */
-#pragma warning(disable: 4701) /* local variable may be be used without having been initialized */
-
-#endif /* ! __WINS__ */
-
-/* Use only fixed point arithmetic */
-
-#define FIXED_POINT 1
-
-#endif /* ! CONFIG_H */
+/*
+   Copyright (C) 2003 Commonwealth Scientific and Industrial Research
+   Organisation (CSIRO) Australia
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+   - Neither the name of CSIRO Australia nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+   PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/* An inline macro is required for use of the inline keyword as not all C compilers support */
+/* inline.  It is officially C99 and C++ only */
+
+#ifdef __WINS__
+
+#define inline __inline
+
+/* Disable some pointless/stupid warnings */
+
+#pragma warning(disable: 4100) /* unreferenced formal parameter */
+#pragma warning(disable: 4127) /* conditional expression is constant */
+#pragma warning(disable: 4305) /* truncation from '...' to '...' */
+#pragma warning(disable: 4244) /* conversion from '...' to '...', possible loss of data */
+#pragma warning(disable: 4701) /* local variable may be be used without having been initialized */
+
+#endif /* ! __WINS__ */
+
+/* Use only fixed point arithmetic */
+
+#define FIXED_POINT 1
+
+#endif /* ! CONFIG_H */

Modified: freeswitch/trunk/libs/speex/ti/config.h
==============================================================================
--- freeswitch/trunk/libs/speex/ti/config.h	(original)
+++ freeswitch/trunk/libs/speex/ti/config.h	Fri Sep 21 14:49:14 2007
@@ -1,6 +1,6 @@
 /* Copyright (C) 2005 Psi Systems, Inc.
    File: config.h
-   Main Speex option include file for TI C64xx, C54xx and C55xx processors
+   Main Speex option include file for TI C64xx, C54xx and C55xx processors
    for use with TI Code Composer (TM) DSP development tools.
 
    Redistribution and use in source and binary forms, with or without
@@ -30,44 +30,44 @@
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
-#define FIXED_POINT
-#define FRAME_SIZE 160
-#define DISABLE_WIDEBAND
-
-/* Allow for 2 20ms narrowband blocks per frame, plus a couple of bytes */
-#define MAX_CHARS_PER_FRAME (42/BYTES_PER_CHAR)
-
-/* for debug */
-#undef DECODE_ONLY
-
-/* EITHER    Allocate from fixed array (C heap not used) */
-/*           Enable VERBOSE_ALLOC to see how much is used */
-#define MANUAL_ALLOC
-#define USER_MISC
-#define VERBOSE_ALLOC
-/* OR        Use CALLOC (heap size must be increased in linker command file) */
-//#undef MANUAL_ALLOC
-//#undef USER_MISC
-
-#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) 
-//#define PRECISION16
-
-// These values determined by analysis for 8kbps narrowband
-#define SPEEXENC_PERSIST_STACK_SIZE 5000
-#define SPEEXENC_SCRATCH_STACK_SIZE 3000
-#define SPEEXDEC_PERSIST_STACK_SIZE 2500
-#define SPEEXDEC_SCRATCH_STACK_SIZE 1000
-#else /* C6X */
-#define NO_LONGLONG
-
-#define SPEEXENC_PERSIST_STACK_SIZE 10000
-#define SPEEXENC_SCRATCH_STACK_SIZE 6000
-#define SPEEXDEC_PERSIST_STACK_SIZE 5000
-#define SPEEXDEC_SCRATCH_STACK_SIZE 2000
-#endif
-#define SPEEX_PERSIST_STACK_SIZE (SPEEXENC_PERSIST_STACK_SIZE + SPEEXDEC_PERSIST_STACK_SIZE)
-#define SPEEX_SCRATCH_STACK_SIZE SPEEXENC_SCRATCH_STACK_SIZE
-#define NB_ENC_STACK SPEEXENC_SCRATCH_STACK_SIZE
-#define NB_DEC_STACK SPEEXDEC_SCRATCH_STACK_SIZE
-
+
+#define FIXED_POINT
+#define FRAME_SIZE 160
+#define DISABLE_WIDEBAND
+
+/* Allow for 2 20ms narrowband blocks per frame, plus a couple of bytes */
+#define MAX_CHARS_PER_FRAME (42/BYTES_PER_CHAR)
+
+/* for debug */
+#undef DECODE_ONLY
+
+/* EITHER    Allocate from fixed array (C heap not used) */
+/*           Enable VERBOSE_ALLOC to see how much is used */
+#define MANUAL_ALLOC
+#define USER_MISC
+#define VERBOSE_ALLOC
+/* OR        Use CALLOC (heap size must be increased in linker command file) */
+//#undef MANUAL_ALLOC
+//#undef USER_MISC
+
+#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) 
+//#define PRECISION16
+
+// These values determined by analysis for 8kbps narrowband
+#define SPEEXENC_PERSIST_STACK_SIZE 5000
+#define SPEEXENC_SCRATCH_STACK_SIZE 3000
+#define SPEEXDEC_PERSIST_STACK_SIZE 2500
+#define SPEEXDEC_SCRATCH_STACK_SIZE 1000
+#else /* C6X */
+#define NO_LONGLONG
+
+#define SPEEXENC_PERSIST_STACK_SIZE 10000
+#define SPEEXENC_SCRATCH_STACK_SIZE 6000
+#define SPEEXDEC_PERSIST_STACK_SIZE 5000
+#define SPEEXDEC_SCRATCH_STACK_SIZE 2000
+#endif
+#define SPEEX_PERSIST_STACK_SIZE (SPEEXENC_PERSIST_STACK_SIZE + SPEEXDEC_PERSIST_STACK_SIZE)
+#define SPEEX_SCRATCH_STACK_SIZE SPEEXENC_SCRATCH_STACK_SIZE
+#define NB_ENC_STACK SPEEXENC_SCRATCH_STACK_SIZE
+#define NB_DEC_STACK SPEEXDEC_SCRATCH_STACK_SIZE
+

Modified: freeswitch/trunk/libs/speex/ti/testenc-TI-C5x.c
==============================================================================
--- freeswitch/trunk/libs/speex/ti/testenc-TI-C5x.c	(original)
+++ freeswitch/trunk/libs/speex/ti/testenc-TI-C5x.c	Fri Sep 21 14:49:14 2007
@@ -1,287 +1,287 @@
-/* Copyright (C) 2005 Psi Systems, Inc.
-   File: testenc-TI-C5x.c
-   Encoder/Decoder Loop Main file for TI C54xx and C55xx processors
-   for use with TI Code Composer (TM) DSP development tools.
-   Modified from speexlib/testenc.c
-
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-   
-   - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-   
-   - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-   
-   - Neither the name of the Xiph.org Foundation nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-   
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/* Modified from speexlib/testenc.c for Code Composer simulator */
-
-#include <speex/speex.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <speex/speex_callbacks.h>
-#include <..\libspeex\arch.h>
-
-#undef DECODE_ONLY
-#define CHECK_RESULT  /* Compares original file with encoded/decoder file */
-#define TESTENC_BYTES_PER_FRAME 20  /* 8kbps */
-#define TESTENC_QUALITY 4 /* 8kbps */
-//#define TESTENC_BYTES_PER_FRAME 28  /* 11kbps */
-//#define TESTENC_QUALITY 5	      /* 11 kbps */
-
-/* For narrowband, QUALITY maps to these bit rates (see modes.c, manual.pdf) 
- *   {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7}
- * 0 -> 2150
- * 1 -> 3950
- * 2 -> 5950
- * 3 -> 8000
- * 4 -> 8000
- * 5 -> 11000
- * 6 -> 11000
- * 7 -> 15000
- * 8 -> 15000
- * 9 -> 18200
- *10 -> 26400  */
-
-#ifdef FIXED_DEBUG
-extern long long spx_mips;
-#endif
-#include <math.h>
-
-#ifdef MANUAL_ALLOC
-/* Take all Speex space from this private heap */ 
-/* This is useful for multichannel applications */
-#pragma DATA_SECTION(spxHeap, ".myheap"); 
-static char spxHeap[SPEEX_PERSIST_STACK_SIZE];
-
-#pragma DATA_SECTION(spxScratch, ".myheap"); 
-static char spxScratch[SPEEX_SCRATCH_STACK_SIZE];
-
-char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
-char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
-#endif
-
-void byte2word(short* pInBuf, short* pOutBuf, int nWords)
-{
-   short *pIn, *pOut, sNext;
-   int i;
-   
-   pIn = pInBuf;
-   pOut = pOutBuf;
-   for(i=0;i<nWords;i++)
-   {
-      sNext = *pIn++;			// Get low byte
-      *pOut++ = (sNext & 0x00ff) | (*pIn++ << 8);	// insert high byte
-   }
-}
-   
-void word2byte(short* pInBuf, short* pOutBuf, int nWords)
-{
-   short *pIn, *pOut;
-   int i;
-   
-   pIn = pInBuf;
-   pOut = pOutBuf;
-   for(i=0;i<nWords;i++)
-   {
-      *pOut++ = *pIn & 0x00ff;	// Get low byte
-      *pOut++ = (short) ((unsigned short) *pIn++ >> 8);
-   }
-}
-   
-void main()
-{
-   char *outFile, *bitsFile;
-   FILE *fout, *fbits=NULL;
-#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
-   char *inFile;
-   FILE *fin;
-   short in_short[FRAME_SIZE];
-#endif
-   short out_short[FRAME_SIZE];
-   short inout_byte[2*FRAME_SIZE];
-#ifndef DECODE_ONLY
-   int nbChars;
-#endif
-#ifdef CHECK_RESULT
-   float sigpow,errpow,snr, seg_snr=0;
-   int snr_frames = 0;
-   int i;
-#endif
-   char cbits[TESTENC_BYTES_PER_FRAME/2 + 2];  /* temp store for encoded data */
-   void *st;
-   void *dec;
-   SpeexBits bits;
-   spx_int32_t tmp;
-   unsigned long bitCount=0;
-   spx_int32_t skip_group_delay;
-   SpeexCallback callback;
-
-   /* C54xx defaults to max wait states, even for parts like C5416 with 
-      larger internal memory.  Need to force the wait state register to zero */
-
-#ifdef CONFIG_TI_C54X
-   asm("	STM	#0,SWWSR");
-#endif
-
-#ifdef CHECK_RESULT
-   sigpow = 0;
-   errpow = 0;
-#endif
-
-#ifdef MANUAL_ALLOC
-	spxGlobalHeapPtr = spxHeap;
-	spxGlobalHeapEnd = spxHeap + sizeof(spxHeap);
-
-	spxGlobalScratchPtr = spxScratch;
-	spxGlobalScratchEnd = spxScratch + sizeof(spxScratch);
-#endif
-   st = speex_encoder_init(&speex_nb_mode);
-#ifdef MANUAL_ALLOC
-	spxGlobalScratchPtr = spxScratch;		/* Reuse scratch for decoder */
-#endif
-   dec = speex_decoder_init(&speex_nb_mode);
-
-   callback.callback_id = SPEEX_INBAND_CHAR;
-   callback.func = speex_std_char_handler;
-   callback.data = stderr;
-   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
-
-   callback.callback_id = SPEEX_INBAND_MODE_REQUEST;
-   callback.func = speex_std_mode_request_handler;
-   callback.data = st;
-   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
-
-   tmp=0;
-   speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp);
-   tmp=0;
-   speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp);
-   tmp=TESTENC_QUALITY;
-   speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp);
-   tmp=1;  /* Lowest */
-   speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
-
+/* Copyright (C) 2005 Psi Systems, Inc.
+   File: testenc-TI-C5x.c
+   Encoder/Decoder Loop Main file for TI C54xx and C55xx processors
+   for use with TI Code Composer (TM) DSP development tools.
+   Modified from speexlib/testenc.c
+
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+   
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+   
+   - Neither the name of the Xiph.org Foundation nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+   
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* Modified from speexlib/testenc.c for Code Composer simulator */
+
+#include <speex/speex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <speex/speex_callbacks.h>
+#include <..\libspeex\arch.h>
+
+#undef DECODE_ONLY
+#define CHECK_RESULT  /* Compares original file with encoded/decoder file */
+#define TESTENC_BYTES_PER_FRAME 20  /* 8kbps */
+#define TESTENC_QUALITY 4 /* 8kbps */
+//#define TESTENC_BYTES_PER_FRAME 28  /* 11kbps */
+//#define TESTENC_QUALITY 5	      /* 11 kbps */
+
+/* For narrowband, QUALITY maps to these bit rates (see modes.c, manual.pdf) 
+ *   {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7}
+ * 0 -> 2150
+ * 1 -> 3950
+ * 2 -> 5950
+ * 3 -> 8000
+ * 4 -> 8000
+ * 5 -> 11000
+ * 6 -> 11000
+ * 7 -> 15000
+ * 8 -> 15000
+ * 9 -> 18200
+ *10 -> 26400  */
+
+#ifdef FIXED_DEBUG
+extern long long spx_mips;
+#endif
+#include <math.h>
+
+#ifdef MANUAL_ALLOC
+/* Take all Speex space from this private heap */ 
+/* This is useful for multichannel applications */
+#pragma DATA_SECTION(spxHeap, ".myheap"); 
+static char spxHeap[SPEEX_PERSIST_STACK_SIZE];
+
+#pragma DATA_SECTION(spxScratch, ".myheap"); 
+static char spxScratch[SPEEX_SCRATCH_STACK_SIZE];
+
+char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
+char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
+#endif
+
+void byte2word(short* pInBuf, short* pOutBuf, int nWords)
+{
+   short *pIn, *pOut, sNext;
+   int i;
+   
+   pIn = pInBuf;
+   pOut = pOutBuf;
+   for(i=0;i<nWords;i++)
+   {
+      sNext = *pIn++;			// Get low byte
+      *pOut++ = (sNext & 0x00ff) | (*pIn++ << 8);	// insert high byte
+   }
+}
+   
+void word2byte(short* pInBuf, short* pOutBuf, int nWords)
+{
+   short *pIn, *pOut;
+   int i;
+   
+   pIn = pInBuf;
+   pOut = pOutBuf;
+   for(i=0;i<nWords;i++)
+   {
+      *pOut++ = *pIn & 0x00ff;	// Get low byte
+      *pOut++ = (short) ((unsigned short) *pIn++ >> 8);
+   }
+}
+   
+void main()
+{
+   char *outFile, *bitsFile;
+   FILE *fout, *fbits=NULL;
+#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
+   char *inFile;
+   FILE *fin;
+   short in_short[FRAME_SIZE];
+#endif
+   short out_short[FRAME_SIZE];
+   short inout_byte[2*FRAME_SIZE];
+#ifndef DECODE_ONLY
+   int nbChars;
+#endif
+#ifdef CHECK_RESULT
+   float sigpow,errpow,snr, seg_snr=0;
+   int snr_frames = 0;
+   int i;
+#endif
+   char cbits[TESTENC_BYTES_PER_FRAME/2 + 2];  /* temp store for encoded data */
+   void *st;
+   void *dec;
+   SpeexBits bits;
+   spx_int32_t tmp;
+   unsigned long bitCount=0;
+   spx_int32_t skip_group_delay;
+   SpeexCallback callback;
+
+   /* C54xx defaults to max wait states, even for parts like C5416 with 
+      larger internal memory.  Need to force the wait state register to zero */
+
+#ifdef CONFIG_TI_C54X
+   asm("	STM	#0,SWWSR");
+#endif
+
+#ifdef CHECK_RESULT
+   sigpow = 0;
+   errpow = 0;
+#endif
+
+#ifdef MANUAL_ALLOC
+	spxGlobalHeapPtr = spxHeap;
+	spxGlobalHeapEnd = spxHeap + sizeof(spxHeap);
+
+	spxGlobalScratchPtr = spxScratch;
+	spxGlobalScratchEnd = spxScratch + sizeof(spxScratch);
+#endif
+   st = speex_encoder_init(&speex_nb_mode);
+#ifdef MANUAL_ALLOC
+	spxGlobalScratchPtr = spxScratch;		/* Reuse scratch for decoder */
+#endif
+   dec = speex_decoder_init(&speex_nb_mode);
+
+   callback.callback_id = SPEEX_INBAND_CHAR;
+   callback.func = speex_std_char_handler;
+   callback.data = stderr;
+   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
+
+   callback.callback_id = SPEEX_INBAND_MODE_REQUEST;
+   callback.func = speex_std_mode_request_handler;
+   callback.data = st;
+   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
+
+   tmp=0;
+   speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp);
+   tmp=0;
+   speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp);
+   tmp=TESTENC_QUALITY;
+   speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp);
+   tmp=1;  /* Lowest */
+   speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
+
    speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
    speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
    skip_group_delay += tmp;
-   fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay);
-
-#ifdef DECODE_ONLY
-   bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat";
-   fbits = fopen(bitsFile, "rb");
-#else
-   bitsFile = "c:\\speextrunktest\\samples\\malebits5x.dat";
-   fbits = fopen(bitsFile, "wb");
-#endif
-#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
-   inFile = "c:\\speextrunktest\\samples\\male.snd";
-   fin = fopen(inFile, "rb");
-#endif
-   outFile = "c:\\speextrunktest\\samples\\maleout5x.snd";
-   fout = fopen(outFile, "wb+");
- 
-   speex_bits_init(&bits);
-#ifndef DECODE_ONLY
-   while (!feof(fin))
-   {
-      fread(inout_byte, 2, FRAME_SIZE, fin);
-      byte2word(inout_byte, in_short, FRAME_SIZE);  /* C5x has 16-bit char */
-
-      if (feof(fin))
-         break;
-      speex_bits_reset(&bits);
-
-      speex_encode_int(st, in_short, &bits);
-      nbChars = speex_bits_write(&bits, cbits, 
-                         sizeof(cbits)*BYTES_PER_CHAR) /BYTES_PER_CHAR;
-      bitCount+=bits.nbBits;
-
-      word2byte((short *) cbits, inout_byte, nbChars);
-      fwrite(inout_byte, 2, nbChars, fbits);
-      speex_bits_rewind(&bits);
-
-#else /* DECODE_ONLY */
-   while (!feof(fbits))
-   {
-      fread(inout_byte, 1, TESTENC_BYTES_PER_FRAME, fbits);
-
-      if (feof(fbits))
-         break;
-
-      byte2word(inout_byte, (short *)cbits, TESTENC_BYTES_PER_FRAME/2);
-      speex_bits_read_from(&bits, cbits, TESTENC_BYTES_PER_FRAME);
-      bitCount+=160;
-#endif
-      speex_decode_int(dec, &bits, out_short);
-      speex_bits_reset(&bits);
-
-      word2byte(&out_short[skip_group_delay], inout_byte, FRAME_SIZE-skip_group_delay);
-      fwrite(inout_byte, 2, FRAME_SIZE-skip_group_delay, fout);
-      skip_group_delay = 0;
-#if 1
-   fprintf (stderr, "Bits so far: %lu \n", bitCount);
-#endif
-   }
-   fprintf (stderr, "Total encoded size: %lu bits\n", bitCount);
-   speex_encoder_destroy(st);
-   speex_decoder_destroy(dec);
-
-#ifdef CHECK_RESULT
-   rewind(fin);
-   rewind(fout);
-
-   while ( FRAME_SIZE == fread(inout_byte, 2, FRAME_SIZE, fin)) 
-   {
-	float s=0, e=0;
-
-    byte2word(inout_byte, in_short, FRAME_SIZE);
-    fread(inout_byte, 2, FRAME_SIZE, fout);
-    byte2word(inout_byte, out_short, FRAME_SIZE);
-
-        for (i=0;i<FRAME_SIZE;++i) {
-            s += (float)in_short[i] * in_short[i];
-            e += ((float)in_short[i]-out_short[i]) * ((float)in_short[i]-out_short[i]);
-        }
-	seg_snr += 10*log10((s+160)/(e+160));
-	sigpow += s;
-	errpow += e;
-	snr_frames++;
-   }
-
-   snr = 10 * log10( sigpow / errpow );
-   seg_snr /= snr_frames;
-   fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
-
-#ifdef FIXED_DEBUG
-   printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
-#endif
-#endif /* CHECK_RESULT */
-#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
-   fclose(fin);
-#endif
-   fclose(fout);
-   fclose(fbits);
-}
+   fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay);
+
+#ifdef DECODE_ONLY
+   bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat";
+   fbits = fopen(bitsFile, "rb");
+#else
+   bitsFile = "c:\\speextrunktest\\samples\\malebits5x.dat";
+   fbits = fopen(bitsFile, "wb");
+#endif
+#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
+   inFile = "c:\\speextrunktest\\samples\\male.snd";
+   fin = fopen(inFile, "rb");
+#endif
+   outFile = "c:\\speextrunktest\\samples\\maleout5x.snd";
+   fout = fopen(outFile, "wb+");
+ 
+   speex_bits_init(&bits);
+#ifndef DECODE_ONLY
+   while (!feof(fin))
+   {
+      fread(inout_byte, 2, FRAME_SIZE, fin);
+      byte2word(inout_byte, in_short, FRAME_SIZE);  /* C5x has 16-bit char */
+
+      if (feof(fin))
+         break;
+      speex_bits_reset(&bits);
+
+      speex_encode_int(st, in_short, &bits);
+      nbChars = speex_bits_write(&bits, cbits, 
+                         sizeof(cbits)*BYTES_PER_CHAR) /BYTES_PER_CHAR;
+      bitCount+=bits.nbBits;
+
+      word2byte((short *) cbits, inout_byte, nbChars);
+      fwrite(inout_byte, 2, nbChars, fbits);
+      speex_bits_rewind(&bits);
+
+#else /* DECODE_ONLY */
+   while (!feof(fbits))
+   {
+      fread(inout_byte, 1, TESTENC_BYTES_PER_FRAME, fbits);
+
+      if (feof(fbits))
+         break;
+
+      byte2word(inout_byte, (short *)cbits, TESTENC_BYTES_PER_FRAME/2);
+      speex_bits_read_from(&bits, cbits, TESTENC_BYTES_PER_FRAME);
+      bitCount+=160;
+#endif
+      speex_decode_int(dec, &bits, out_short);
+      speex_bits_reset(&bits);
+
+      word2byte(&out_short[skip_group_delay], inout_byte, FRAME_SIZE-skip_group_delay);
+      fwrite(inout_byte, 2, FRAME_SIZE-skip_group_delay, fout);
+      skip_group_delay = 0;
+#if 1
+   fprintf (stderr, "Bits so far: %lu \n", bitCount);
+#endif
+   }
+   fprintf (stderr, "Total encoded size: %lu bits\n", bitCount);
+   speex_encoder_destroy(st);
+   speex_decoder_destroy(dec);
+
+#ifdef CHECK_RESULT
+   rewind(fin);
+   rewind(fout);
+
+   while ( FRAME_SIZE == fread(inout_byte, 2, FRAME_SIZE, fin)) 
+   {
+	float s=0, e=0;
+
+    byte2word(inout_byte, in_short, FRAME_SIZE);
+    fread(inout_byte, 2, FRAME_SIZE, fout);
+    byte2word(inout_byte, out_short, FRAME_SIZE);
+
+        for (i=0;i<FRAME_SIZE;++i) {
+            s += (float)in_short[i] * in_short[i];
+            e += ((float)in_short[i]-out_short[i]) * ((float)in_short[i]-out_short[i]);
+        }
+	seg_snr += 10*log10((s+160)/(e+160));
+	sigpow += s;
+	errpow += e;
+	snr_frames++;
+   }
+
+   snr = 10 * log10( sigpow / errpow );
+   seg_snr /= snr_frames;
+   fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
+
+#ifdef FIXED_DEBUG
+   printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
+#endif
+#endif /* CHECK_RESULT */
+#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
+   fclose(fin);
+#endif
+   fclose(fout);
+   fclose(fbits);
+}

Modified: freeswitch/trunk/libs/speex/ti/testenc-TI-C64x.c
==============================================================================
--- freeswitch/trunk/libs/speex/ti/testenc-TI-C64x.c	(original)
+++ freeswitch/trunk/libs/speex/ti/testenc-TI-C64x.c	Fri Sep 21 14:49:14 2007
@@ -1,10 +1,10 @@
 /* Copyright (C) 2005 Psi Systems, Inc.
    Author:  Jean-Marc Valin 
    File: testenc-TI-C64x.c
-   Encoder/Decoder Loop Main file for TI TMS320C64xx processor
+   Encoder/Decoder Loop Main file for TI TMS320C64xx processor
    for use with TI Code Composer (TM) DSP development tools.
-   Modified from speexlib/testenc.c
-
+   Modified from speexlib/testenc.c
+
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -33,210 +33,210 @@
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <speex/speex.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <speex/speex_callbacks.h>
-
-#undef DECODE_ONLY
-#define CHECK_RESULT  /* Compares original file with encoded/decoder file */
-#define TESTENC_BYTES_PER_FRAME 20  /* 8kbps */
-#define TESTENC_QUALITY 4 /* 8kbps */
-//#define TESTENC_BYTES_PER_FRAME 28  /* 11kbps */
-//#define TESTENC_QUALITY 5	      /* 11 kbps */
-
-/* For narrowband, QUALITY maps to these bit rates (see modes.c, manual.pdf) 
- *   {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7}
- * 0 -> 2150
- * 1 -> 3950
- * 2 -> 5950
- * 3 -> 8000
- * 4 -> 8000
- * 5 -> 11000
- * 6 -> 11000
- * 7 -> 15000
- * 8 -> 15000
- * 9 -> 18200
- *10 -> 26400  */
-
-#ifdef FIXED_DEBUG
-extern long long spx_mips;
-#endif
-
-#ifdef MANUAL_ALLOC
-/* Take all Speex space from this private heap */ 
-/* This is useful for multichannel applications */
-#pragma DATA_SECTION(spxHeap, ".myheap"); 
-static char spxHeap[SPEEX_PERSIST_STACK_SIZE];
-
-#pragma DATA_SECTION(spxScratch, ".myheap"); 
-static char spxScratch[SPEEX_SCRATCH_STACK_SIZE];
-
-char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
-char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
-#endif    /* MANUAL_ALLOC */
-
-#include <math.h>
-void main()
-{
-   char *outFile, *bitsFile;
-   FILE *fout, *fbits=NULL;
-#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
-   char *inFile;
-   FILE *fin;
-   short in_short[FRAME_SIZE];
-#endif
-   short out_short[FRAME_SIZE];
-#ifndef DECODE_ONLY
-   int nbBits;
-#endif
-#ifdef CHECK_RESULT
-   float sigpow,errpow,snr, seg_snr=0;
-   int snr_frames = 0;
-   int i;
-#endif
-   char cbits[200];
-   void *st;
-   void *dec;
-   SpeexBits bits;
-   spx_int32_t tmp;
-   unsigned long bitCount=0;
-   spx_int32_t skip_group_delay;
-   SpeexCallback callback;
-
-#ifdef CHECK_RESULT
-   sigpow = 0;
-   errpow = 0;
-#endif
-
-#ifdef MANUAL_ALLOC
-	spxGlobalHeapPtr = spxHeap;
-	spxGlobalHeapEnd = spxHeap + sizeof(spxHeap);
-
-	spxGlobalScratchPtr = spxScratch;
-	spxGlobalScratchEnd = spxScratch + sizeof(spxScratch);
-#endif
-   st = speex_encoder_init(&speex_nb_mode);
-#ifdef MANUAL_ALLOC
-	spxGlobalScratchPtr = spxScratch;		/* Reuse scratch for decoder */
-#endif
-   dec = speex_decoder_init(&speex_nb_mode);
-
-   callback.callback_id = SPEEX_INBAND_CHAR;
-   callback.func = speex_std_char_handler;
-   callback.data = stderr;
-   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
-
-   callback.callback_id = SPEEX_INBAND_MODE_REQUEST;
-   callback.func = speex_std_mode_request_handler;
-   callback.data = st;
-   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
-
-   tmp=0;
-   speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp);
-   tmp=0;
-   speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp);
-   tmp=TESTENC_QUALITY;
-   speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp);
-   tmp=1;  /* Lowest */
-   speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
-
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <speex/speex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <speex/speex_callbacks.h>
+
+#undef DECODE_ONLY
+#define CHECK_RESULT  /* Compares original file with encoded/decoder file */
+#define TESTENC_BYTES_PER_FRAME 20  /* 8kbps */
+#define TESTENC_QUALITY 4 /* 8kbps */
+//#define TESTENC_BYTES_PER_FRAME 28  /* 11kbps */
+//#define TESTENC_QUALITY 5	      /* 11 kbps */
+
+/* For narrowband, QUALITY maps to these bit rates (see modes.c, manual.pdf) 
+ *   {1, 8, 2, 3, 3, 4, 4, 5, 5, 6, 7}
+ * 0 -> 2150
+ * 1 -> 3950
+ * 2 -> 5950
+ * 3 -> 8000
+ * 4 -> 8000
+ * 5 -> 11000
+ * 6 -> 11000
+ * 7 -> 15000
+ * 8 -> 15000
+ * 9 -> 18200
+ *10 -> 26400  */
+
+#ifdef FIXED_DEBUG
+extern long long spx_mips;
+#endif
+
+#ifdef MANUAL_ALLOC
+/* Take all Speex space from this private heap */ 
+/* This is useful for multichannel applications */
+#pragma DATA_SECTION(spxHeap, ".myheap"); 
+static char spxHeap[SPEEX_PERSIST_STACK_SIZE];
+
+#pragma DATA_SECTION(spxScratch, ".myheap"); 
+static char spxScratch[SPEEX_SCRATCH_STACK_SIZE];
+
+char *spxGlobalHeapPtr, *spxGlobalHeapEnd;
+char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
+#endif    /* MANUAL_ALLOC */
+
+#include <math.h>
+void main()
+{
+   char *outFile, *bitsFile;
+   FILE *fout, *fbits=NULL;
+#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
+   char *inFile;
+   FILE *fin;
+   short in_short[FRAME_SIZE];
+#endif
+   short out_short[FRAME_SIZE];
+#ifndef DECODE_ONLY
+   int nbBits;
+#endif
+#ifdef CHECK_RESULT
+   float sigpow,errpow,snr, seg_snr=0;
+   int snr_frames = 0;
+   int i;
+#endif
+   char cbits[200];
+   void *st;
+   void *dec;
+   SpeexBits bits;
+   spx_int32_t tmp;
+   unsigned long bitCount=0;
+   spx_int32_t skip_group_delay;
+   SpeexCallback callback;
+
+#ifdef CHECK_RESULT
+   sigpow = 0;
+   errpow = 0;
+#endif
+
+#ifdef MANUAL_ALLOC
+	spxGlobalHeapPtr = spxHeap;
+	spxGlobalHeapEnd = spxHeap + sizeof(spxHeap);
+
+	spxGlobalScratchPtr = spxScratch;
+	spxGlobalScratchEnd = spxScratch + sizeof(spxScratch);
+#endif
+   st = speex_encoder_init(&speex_nb_mode);
+#ifdef MANUAL_ALLOC
+	spxGlobalScratchPtr = spxScratch;		/* Reuse scratch for decoder */
+#endif
+   dec = speex_decoder_init(&speex_nb_mode);
+
+   callback.callback_id = SPEEX_INBAND_CHAR;
+   callback.func = speex_std_char_handler;
+   callback.data = stderr;
+   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
+
+   callback.callback_id = SPEEX_INBAND_MODE_REQUEST;
+   callback.func = speex_std_mode_request_handler;
+   callback.data = st;
+   speex_decoder_ctl(dec, SPEEX_SET_HANDLER, &callback);
+
+   tmp=0;
+   speex_decoder_ctl(dec, SPEEX_SET_ENH, &tmp);
+   tmp=0;
+   speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp);
+   tmp=TESTENC_QUALITY;
+   speex_encoder_ctl(st, SPEEX_SET_QUALITY, &tmp);
+   tmp=1;  /* Lowest */
+   speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
+
    speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
    speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
    skip_group_delay += tmp;
-   fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay);
-
-#ifdef DECODE_ONLY
-   bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat";
-   fbits = fopen(bitsFile, "rb");
-#else
-   bitsFile = "c:\\speextrunktest\\samples\\malebits6x.dat";
-   fbits = fopen(bitsFile, "wb");
-#endif
-#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
-   inFile = "c:\\speextrunktest\\samples\\male.snd";
-   fin = fopen(inFile, "rb");
-#endif
-   outFile = "c:\\speextrunktest\\samples\\maleout6x.snd";
-   fout = fopen(outFile, "wb+");
- 
-   speex_bits_init(&bits);
-#ifndef DECODE_ONLY
-   while (!feof(fin))
-   {
-      fread(in_short, sizeof(short), FRAME_SIZE, fin);
-      if (feof(fin))
-         break;
-      speex_bits_reset(&bits);
-
-      speex_encode_int(st, in_short, &bits);
-      nbBits = speex_bits_write(&bits, cbits, 200);
-      bitCount+=bits.nbBits;
-
-      fwrite(cbits, 1, nbBits, fbits);
-      speex_bits_rewind(&bits);
-
-#else /* DECODE_ONLY */
-   while (!feof(fbits))
-   {
-      fread(cbits, 1, TESTENC_BYTES_PER_FRAME, fbits);
-
-      if (feof(fbits))
-         break;
-
-      speex_bits_read_from(&bits, cbits, TESTENC_BYTES_PER_FRAME);
-//      bitCount+=160;  /* only correct for 8kbps, but just for the printf */
-      bitCount+=bits.nbBits;
-#endif
-      
-      speex_decode_int(dec, &bits, out_short);
-      speex_bits_reset(&bits);
-
-      fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout);
-      skip_group_delay = 0;
-#if 1
-   fprintf (stderr, "Bits so far: %lu \n", bitCount);
-#endif
-   }
-   fprintf (stderr, "Total encoded size: %lu bits\n", bitCount);
-   speex_encoder_destroy(st);
-   speex_decoder_destroy(dec);
-
-#ifdef CHECK_RESULT 
-   rewind(fin);
-   rewind(fout);
-
-   while ( FRAME_SIZE == fread(in_short, sizeof(short), FRAME_SIZE, fin) 
-           &&
-           FRAME_SIZE ==  fread(out_short, sizeof(short), FRAME_SIZE,fout) )
-   {
-	float s=0, e=0;
-        for (i=0;i<FRAME_SIZE;++i) {
-            s += (float)in_short[i] * in_short[i];
-            e += ((float)in_short[i]-out_short[i]) * ((float)in_short[i]-out_short[i]);
-        }
-	seg_snr += 10*log10((s+160)/(e+160));
-	sigpow += s;
-	errpow += e;
-	snr_frames++;
-   }
-
-   snr = 10 * log10( sigpow / errpow );
-   seg_snr /= snr_frames;
-   fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
-
-#ifdef FIXED_DEBUG
-   printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
-#endif
-#endif /* CHECK_RESULT */
-#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
-   fclose(fin);
-#endif
-   fclose(fout);
-   fclose(fbits);
-}
+   fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay);
+
+#ifdef DECODE_ONLY
+   bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat";
+   fbits = fopen(bitsFile, "rb");
+#else
+   bitsFile = "c:\\speextrunktest\\samples\\malebits6x.dat";
+   fbits = fopen(bitsFile, "wb");
+#endif
+#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
+   inFile = "c:\\speextrunktest\\samples\\male.snd";
+   fin = fopen(inFile, "rb");
+#endif
+   outFile = "c:\\speextrunktest\\samples\\maleout6x.snd";
+   fout = fopen(outFile, "wb+");
+ 
+   speex_bits_init(&bits);
+#ifndef DECODE_ONLY
+   while (!feof(fin))
+   {
+      fread(in_short, sizeof(short), FRAME_SIZE, fin);
+      if (feof(fin))
+         break;
+      speex_bits_reset(&bits);
+
+      speex_encode_int(st, in_short, &bits);
+      nbBits = speex_bits_write(&bits, cbits, 200);
+      bitCount+=bits.nbBits;
+
+      fwrite(cbits, 1, nbBits, fbits);
+      speex_bits_rewind(&bits);
+
+#else /* DECODE_ONLY */
+   while (!feof(fbits))
+   {
+      fread(cbits, 1, TESTENC_BYTES_PER_FRAME, fbits);
+
+      if (feof(fbits))
+         break;
+
+      speex_bits_read_from(&bits, cbits, TESTENC_BYTES_PER_FRAME);
+//      bitCount+=160;  /* only correct for 8kbps, but just for the printf */
+      bitCount+=bits.nbBits;
+#endif
+      
+      speex_decode_int(dec, &bits, out_short);
+      speex_bits_reset(&bits);
+
+      fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout);
+      skip_group_delay = 0;
+#if 1
+   fprintf (stderr, "Bits so far: %lu \n", bitCount);
+#endif
+   }
+   fprintf (stderr, "Total encoded size: %lu bits\n", bitCount);
+   speex_encoder_destroy(st);
+   speex_decoder_destroy(dec);
+
+#ifdef CHECK_RESULT 
+   rewind(fin);
+   rewind(fout);
+
+   while ( FRAME_SIZE == fread(in_short, sizeof(short), FRAME_SIZE, fin) 
+           &&
+           FRAME_SIZE ==  fread(out_short, sizeof(short), FRAME_SIZE,fout) )
+   {
+	float s=0, e=0;
+        for (i=0;i<FRAME_SIZE;++i) {
+            s += (float)in_short[i] * in_short[i];
+            e += ((float)in_short[i]-out_short[i]) * ((float)in_short[i]-out_short[i]);
+        }
+	seg_snr += 10*log10((s+160)/(e+160));
+	sigpow += s;
+	errpow += e;
+	snr_frames++;
+   }
+
+   snr = 10 * log10( sigpow / errpow );
+   seg_snr /= snr_frames;
+   fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
+
+#ifdef FIXED_DEBUG
+   printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
+#endif
+#endif /* CHECK_RESULT */
+#if !defined(DECODE_ONLY) || defined(CHECK_RESULT)
+   fclose(fin);
+#endif
+   fclose(fout);
+   fclose(fbits);
+}

Modified: freeswitch/trunk/libs/speex/ti/user_misc.h
==============================================================================
--- freeswitch/trunk/libs/speex/ti/user_misc.h	(original)
+++ freeswitch/trunk/libs/speex/ti/user_misc.h	Fri Sep 21 14:49:14 2007
@@ -30,98 +30,98 @@
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
-#ifdef MANUAL_ALLOC
-
-/* To avoid changing the Speex call model, this file relies on four static variables 
-   The user main creates two linear buffers, and initializes spxGlobalHeap/ScratchPtr 
-   to point to the start of the two buffers, and initializes spxGlobalHeap/ScratchEnd 
-   to point to the first address following the last byte of the two buffers.
-   
-   This mechanism allows, for example, data caching for multichannel applications, 
-   where the Speex state is swapped from a large slow memory to a small fast memory 
-   each time the codec runs.
-   
-   Persistent data is allocated in spxGlobalHeap (instead of calloc), while scratch
-   data is allocated in spxGlobalScratch.
-*/
-
-extern char *spxGlobalHeapPtr, *spxGlobalHeapEnd; 
-extern char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
-
-/* Make sure that all structures are aligned to largest type */
-#define BLOCK_MASK      (sizeof(long double)-1)
-
-#define OVERRIDE_SPEEX_ALLOC
-void *speex_alloc (int size)
-{
-    void *ptr;
-    
-    ptr = (void *) (((int)spxGlobalHeapPtr + BLOCK_MASK) & ~BLOCK_MASK);  //Start on 8 boundary
-
-    spxGlobalHeapPtr = (char *)((int)ptr + size);	// Update pointer to next free location
-
-    if (spxGlobalHeapPtr > spxGlobalHeapEnd ) 
-    {
-#ifdef VERBOSE_ALLOC
-	    fprintf (stderr, "insufficient space for persistent alloc request %d bytes\n", size);
-#endif
-       return 0;
-    }
-   
-#ifdef VERBOSE_ALLOC
-    fprintf (stderr, "Persist Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalHeapEnd - (int)spxGlobalHeapPtr));
-#endif
-    memset(ptr, 0, size);
-    return ptr;
-}
-
-#define OVERRIDE_SPEEX_ALLOC_SCRATCH
-void *speex_alloc_scratch (int size)
-{
-    void *ptr;
-
-    ptr = (void *) (((int)spxGlobalScratchPtr + BLOCK_MASK) & ~BLOCK_MASK);  //Start on 8 boundary
-
-    spxGlobalScratchPtr = (char *)((int)ptr + size);	// Update pointer to next free location
-
-    if (spxGlobalScratchPtr > spxGlobalScratchEnd ) 
-    {
-#ifdef VERBOSE_ALLOC
-	    fprintf (stderr, "insufficient space for scratch alloc request %d bytes\n", size);
-#endif
-       return 0;
-    }
-   
-#ifdef VERBOSE_ALLOC
-    fprintf (stderr, "Scratch Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalScratchEnd - (int)spxGlobalScratchPtr));
-#endif
-    memset(ptr, 0, size);
-    return ptr;
-}
-
-#define OVERRIDE_SPEEX_REALLOC
-void *speex_realloc (void *ptr, int size)
-{
-#ifdef VERBOSE_ALLOC
-   speex_warning("realloc attempted, not allowed");
-#endif
-   return 0;
-}
-
-#define OVERRIDE_SPEEX_FREE
-void speex_free (void *ptr)
-{
-#ifdef VERBOSE_ALLOC
-   speex_warning("at speex_free");
-#endif
-}
-#define OVERRIDE_SPEEX_FREE_SCRATCH
-void speex_free_scratch (void *ptr)
-{
-#ifdef VERBOSE_ALLOC
-   speex_warning("at speex_free_scratch");
-#endif
-}
-
-#endif    /* !MANUAL_ALLOC */
+
+#ifdef MANUAL_ALLOC
+
+/* To avoid changing the Speex call model, this file relies on four static variables 
+   The user main creates two linear buffers, and initializes spxGlobalHeap/ScratchPtr 
+   to point to the start of the two buffers, and initializes spxGlobalHeap/ScratchEnd 
+   to point to the first address following the last byte of the two buffers.
+   
+   This mechanism allows, for example, data caching for multichannel applications, 
+   where the Speex state is swapped from a large slow memory to a small fast memory 
+   each time the codec runs.
+   
+   Persistent data is allocated in spxGlobalHeap (instead of calloc), while scratch
+   data is allocated in spxGlobalScratch.
+*/
+
+extern char *spxGlobalHeapPtr, *spxGlobalHeapEnd; 
+extern char *spxGlobalScratchPtr, *spxGlobalScratchEnd;
+
+/* Make sure that all structures are aligned to largest type */
+#define BLOCK_MASK      (sizeof(long double)-1)
+
+#define OVERRIDE_SPEEX_ALLOC
+void *speex_alloc (int size)
+{
+    void *ptr;
+    
+    ptr = (void *) (((int)spxGlobalHeapPtr + BLOCK_MASK) & ~BLOCK_MASK);  //Start on 8 boundary
+
+    spxGlobalHeapPtr = (char *)((int)ptr + size);	// Update pointer to next free location
+
+    if (spxGlobalHeapPtr > spxGlobalHeapEnd ) 
+    {
+#ifdef VERBOSE_ALLOC
+	    fprintf (stderr, "insufficient space for persistent alloc request %d bytes\n", size);
+#endif
+       return 0;
+    }
+   
+#ifdef VERBOSE_ALLOC
+    fprintf (stderr, "Persist Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalHeapEnd - (int)spxGlobalHeapPtr));
+#endif
+    memset(ptr, 0, size);
+    return ptr;
+}
+
+#define OVERRIDE_SPEEX_ALLOC_SCRATCH
+void *speex_alloc_scratch (int size)
+{
+    void *ptr;
+
+    ptr = (void *) (((int)spxGlobalScratchPtr + BLOCK_MASK) & ~BLOCK_MASK);  //Start on 8 boundary
+
+    spxGlobalScratchPtr = (char *)((int)ptr + size);	// Update pointer to next free location
+
+    if (spxGlobalScratchPtr > spxGlobalScratchEnd ) 
+    {
+#ifdef VERBOSE_ALLOC
+	    fprintf (stderr, "insufficient space for scratch alloc request %d bytes\n", size);
+#endif
+       return 0;
+    }
+   
+#ifdef VERBOSE_ALLOC
+    fprintf (stderr, "Scratch Allocated %d chars at %x, %d remaining\n", size, ptr, ((int)spxGlobalScratchEnd - (int)spxGlobalScratchPtr));
+#endif
+    memset(ptr, 0, size);
+    return ptr;
+}
+
+#define OVERRIDE_SPEEX_REALLOC
+void *speex_realloc (void *ptr, int size)
+{
+#ifdef VERBOSE_ALLOC
+   speex_warning("realloc attempted, not allowed");
+#endif
+   return 0;
+}
+
+#define OVERRIDE_SPEEX_FREE
+void speex_free (void *ptr)
+{
+#ifdef VERBOSE_ALLOC
+   speex_warning("at speex_free");
+#endif
+}
+#define OVERRIDE_SPEEX_FREE_SCRATCH
+void speex_free_scratch (void *ptr)
+{
+#ifdef VERBOSE_ALLOC
+   speex_warning("at speex_free_scratch");
+#endif
+}
+
+#endif    /* !MANUAL_ALLOC */

Modified: freeswitch/trunk/libs/speex/win32/config.h
==============================================================================
--- freeswitch/trunk/libs/speex/win32/config.h	(original)
+++ freeswitch/trunk/libs/speex/win32/config.h	Fri Sep 21 14:49:14 2007
@@ -1,3 +1,3 @@
-#define inline __inline
-#define restrict
+#define inline __inline
+#define restrict
 #include "misc.h"
\ No newline at end of file

Modified: freeswitch/trunk/libs/xmlrpc-c/lib/wininet_transport/xmlrpc_wininet_transport.h
==============================================================================
--- freeswitch/trunk/libs/xmlrpc-c/lib/wininet_transport/xmlrpc_wininet_transport.h	(original)
+++ freeswitch/trunk/libs/xmlrpc-c/lib/wininet_transport/xmlrpc_wininet_transport.h	Fri Sep 21 14:49:14 2007
@@ -1,8 +1,8 @@
-#ifndef XMLRPC_WININET_TRANSPORT_H
-#define XMLRPC_WININET_TRANSPORT_H
-
-#include "xmlrpc-c/transport.h"
-
-extern struct xmlrpc_client_transport_ops xmlrpc_wininet_transport_ops;
-
-#endif
+#ifndef XMLRPC_WININET_TRANSPORT_H
+#define XMLRPC_WININET_TRANSPORT_H
+
+#include "xmlrpc-c/transport.h"
+
+extern struct xmlrpc_client_transport_ops xmlrpc_wininet_transport_ops;
+
+#endif

Modified: freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c	Fri Sep 21 14:49:14 2007
@@ -1,970 +1,970 @@
-/* 
- * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
- * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
- *
- * Version: MPL 1.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
- *
- * The Initial Developer of the Original Code is
- * Anthony Minessale II <anthmct at yahoo.com>
- * Portions created by the Initial Developer are Copyright (C)
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * 
- * Traun Leyden <tleyden at branchcut.com>
- * Arsen Chaloyan <achaloyan at yahoo.com>
- *
- * Module which acts as an MRCP client to an MRCP speech recognition
- * server.  In other words it bridges freeswitch to an external speech
- * recognition system.  Documentation on how to install and configure
- * the module is here: http://wiki.freeswitch.org/wiki/Mod_openmrcp
- *
- * Uses OpenMrcp (http://wiki.freeswitch.org/wiki/OpenMRCP) as the 
- * the client library.  
- *
- * TODO
- * =======
- *
- * - There are two memory pools in use.  One in asr_session which is managed
- * by this module, and one in the switch_asr_handle_t, which is managed by freeswitch.
- * These need to be consolidated into one.  (basically throw away the one in asr_session)
- * 
- * - fs status codes (eg, SWITCH_STATUS_GENERR) and mrcp status codes (MRCP_STATUS_FAILURE)
- * are intermixed badly.  this needs cleanup
- * 
- * - openmrcp_flush_tts, openmrcp_text_param_tts, openmrcp_numeric_param_tts, 
- * openmrcp_float_param_tts need to have functionality added
- *
- * - use a regex for extracting xml from raw result received from mrcp recognition
- * server
- *
- */
-
-#ifdef __ICC
-#pragma warning (disable:188)
-#endif
-
-
-#include "openmrcp_client.h"
-#include "mrcp_client_context.h"
-#include "mrcp_recognizer.h"
-#include "mrcp_synthesizer.h"
-#include "mrcp_generic_header.h"
-
-#include <switch.h>
-	
-SWITCH_MODULE_LOAD_FUNCTION(mod_openmrcp_load);
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_openmrcp_shutdown);
-SWITCH_MODULE_DEFINITION(mod_openmrcp, mod_openmrcp_load, 
-						 mod_openmrcp_shutdown, NULL);
-
-typedef struct {
-	char                      *name;
-	openmrcp_client_options_t *mrcp_options;
-	mrcp_client_t             *mrcp_client;
-	mrcp_client_context_t     *mrcp_context;
-} openmrcp_profile_t;
-
-typedef struct {
-	openmrcp_profile_t    *profile;
-	mrcp_session_t        *client_session;
-	mrcp_client_channel_t *control_channel;
-	mrcp_audio_channel_t  *audio_channel;
-	mrcp_message_t        *mrcp_message_last_rcvd;
-	apr_pool_t            *pool;
-	switch_speech_flag_t   flags;
-	switch_mutex_t        *flag_mutex;
-	switch_thread_cond_t  *wait_object;
-} openmrcp_session_t;
-
-typedef enum {
-	FLAG_HAS_MESSAGE =    (1 << 0),
-	FLAG_FEED_STARTED =   (1 << 1),
-	FLAG_TERMINATING =    (1 << 2)
-} mrcp_flag_t;
-
-typedef struct {
-	switch_memory_pool_t *pool;
-	switch_hash_t        *profile_hash;
-
-	openmrcp_profile_t   *asr_profile;
-	openmrcp_profile_t   *tts_profile;
-} openmrcp_module_t;
-
-static openmrcp_module_t openmrcp_module;
-
-
-static openmrcp_session_t* openmrcp_session_create(openmrcp_profile_t *profile)
-{
-	openmrcp_session_t *openmrcp_session;
-	apr_pool_t *session_pool;
-
-	if(!profile) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no profile specified\n");
-		return NULL;
-	}
-
-	if(apr_pool_create(&session_pool,NULL) != APR_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to create session_pool\n");
-		return NULL;
-	}
-
-	openmrcp_session = apr_palloc(session_pool,sizeof(openmrcp_session_t));
-	openmrcp_session->pool = session_pool;
-	openmrcp_session->profile = profile;
-	openmrcp_session->client_session = NULL;
-	openmrcp_session->control_channel = NULL;
-	openmrcp_session->audio_channel = NULL;
-	openmrcp_session->mrcp_message_last_rcvd = NULL;
-
-	switch_mutex_init(&openmrcp_session->flag_mutex, SWITCH_MUTEX_NESTED, openmrcp_session->pool);
-
-	if (switch_thread_cond_create(&openmrcp_session->wait_object, openmrcp_session->pool)) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,  "wait object creation failed\n");
-	}
-
-	openmrcp_session->client_session = mrcp_client_context_session_create(openmrcp_session->profile->mrcp_context,openmrcp_session);
-	if (!openmrcp_session->client_session) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "session creation FAILED\n");
-		apr_pool_destroy(session_pool);
-		return NULL;
-	}
-
-	return openmrcp_session;
-}
-
-static void openmrcp_session_destroy(openmrcp_session_t *openmrcp_session)
-{
-	if(openmrcp_session && openmrcp_session->pool) {
-		mrcp_client_context_session_destroy(openmrcp_session->profile->mrcp_context,openmrcp_session->client_session);
-		apr_pool_destroy(openmrcp_session->pool);
-	}
-}
-
-static mrcp_status_t openmrcp_on_session_initiate(mrcp_client_context_t *context, mrcp_session_t *session)
-{
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_session_initiate called\n");
-	return MRCP_STATUS_SUCCESS;
-}
-
-static mrcp_status_t openmrcp_on_session_terminate(mrcp_client_context_t *context, mrcp_session_t *session)
-{
-	openmrcp_session_t *openmrcp_session = mrcp_client_context_session_object_get(session);
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_session_terminate called\n");
-	if(!openmrcp_session) {
-		return MRCP_STATUS_FAILURE;
-	}
-
-	if (switch_test_flag(openmrcp_session, FLAG_TERMINATING)) {
-		openmrcp_session_destroy(openmrcp_session);
-	}
-	else {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "abnormal session terminate\n");
-	}
-	return MRCP_STATUS_SUCCESS;
-}
-
-static mrcp_status_t openmrcp_on_channel_add(mrcp_client_context_t *context, mrcp_session_t *session, mrcp_client_channel_t *control_channel, mrcp_audio_channel_t *audio_channel)
-{
-	openmrcp_session_t *openmrcp_session = mrcp_client_context_session_object_get(session);
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_channel_add called\n");
-	if(!openmrcp_session) {
-		return MRCP_STATUS_FAILURE;
-	}
-	switch_mutex_lock(openmrcp_session->flag_mutex);
-	openmrcp_session->control_channel = control_channel;
-	openmrcp_session->audio_channel = audio_channel;
-	switch_thread_cond_signal(openmrcp_session->wait_object);
-	switch_mutex_unlock(openmrcp_session->flag_mutex);
-	return MRCP_STATUS_SUCCESS;
-}
-
-static mrcp_status_t openmrcp_on_channel_remove(mrcp_client_context_t *context, mrcp_session_t *session, mrcp_client_channel_t *control_channel)
-{
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_channel_remove called\n");
-	return MRCP_STATUS_SUCCESS;
-}
-
-/** this is called by the mrcp core whenever an mrcp message is received from
-    the other side. */
-static mrcp_status_t openmrcp_on_channel_modify(mrcp_client_context_t *context, mrcp_session_t *session, mrcp_message_t *mrcp_message)
-{
-	openmrcp_session_t *openmrcp_session = mrcp_client_context_session_object_get(session);
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "on_channel_modify called\n");
-	if (!openmrcp_session) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "!openmrcp_session\n");
-		return MRCP_STATUS_FAILURE;
-	}
-	if (!mrcp_message) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "!mrcp_message\n");
-		return MRCP_STATUS_FAILURE;
-	}
-
-	if (mrcp_message->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE && mrcp_message->start_line.request_state == MRCP_REQUEST_STATE_INPROGRESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ignoring mrcp response\n");
-		return MRCP_STATUS_SUCCESS;
-	}
-
-	if (switch_test_flag(openmrcp_session, FLAG_HAS_MESSAGE)) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "already has message\n");
-		return MRCP_STATUS_SUCCESS;
-	}
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "setting FLAG_HAS_MESSAGE\n");
-	openmrcp_session->mrcp_message_last_rcvd = mrcp_message;
-	switch_set_flag_locked(openmrcp_session, FLAG_HAS_MESSAGE);
-	return MRCP_STATUS_SUCCESS;
-}
-
-/** Read in the grammar and construct an MRCP Recognize message that has
-    The grammar attached as the payload */
-static mrcp_status_t openmrcp_recog_start(mrcp_client_context_t *context, openmrcp_session_t *asr_session, char *path)
-{
-	mrcp_generic_header_t *generic_header;
-	apr_status_t rv;
-	apr_file_t *fp;
-	apr_pool_t *mp;
-	apr_finfo_t finfo;
-	char *buf1;
-	apr_size_t bytes2read = 0;
-	
-	mrcp_message_t *mrcp_message = mrcp_client_context_message_get(context, asr_session->client_session, asr_session->control_channel, RECOGNIZER_RECOGNIZE);
-
-	if(!mrcp_message) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not create mrcp msg\n");
-		return MRCP_STATUS_FAILURE;
-	}
-
-	/* open the file with the grammar and read into char* buffer */
-	mp = mrcp_message->pool;
-	if ((rv = apr_file_open(&fp, path, APR_READ, APR_OS_DEFAULT, mp)) != APR_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not read grammar\n");
-		return -1;
-	}
-	rv = apr_file_info_get(&finfo, APR_FINFO_NORM, fp);
-	
-	buf1 = apr_palloc(mp, (apr_size_t)finfo.size + 1);
-	bytes2read = (apr_size_t)finfo.size;
-	rv = apr_file_read(fp, buf1, &bytes2read);
-	buf1[bytes2read] = '\0';
-
-	generic_header = mrcp_generic_header_prepare(mrcp_message);
-	if(!generic_header) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not prepare generic_header\n");
-		return MRCP_STATUS_FAILURE;
-	}
-
-	generic_header->content_type = "application/srgs+xml";
-	mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_TYPE);
-	mrcp_message->body = buf1;
-
-	/* send the MRCP RECOGNIZE message to MRCP server */
-	return mrcp_client_context_channel_modify(context, asr_session->client_session, mrcp_message);
-}
-
-
-/**
- * Freeswitch calls this from switch_ivr_detect_speech() and then adds a media
- * bug to tap into the channel's audio, which will result in all data getting
- * passed to asr_feed() and calls to asr_check_results() on each recevied frame.
- * 
- * This code expects certain one-time initialization of the openmrcp client
- * engine/systeme to have already taken place.function to open the asr interface 
- */
-static switch_status_t openmrcp_asr_open(switch_asr_handle_t *ah, char *codec, int rate, char *dest, switch_asr_flag_t *flags) 
-{
-	openmrcp_session_t *asr_session;
-	mrcp_client_channel_t *asr_channel;
-	
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "asr_open called, codec: %s, rate: %d\n", codec, rate);
-
-	if (strcmp(codec,"L16")) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sorry, only L16 codec supported\n");
-		return SWITCH_STATUS_GENERR;		
-	}
-	if (rate != 8000) {
-		// TODO: look into supporting other sample rates
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sorry, only 8kz supported\n");
-		return SWITCH_STATUS_GENERR;		
-	}
-	/* create session */
-	asr_session = openmrcp_session_create(openmrcp_module.asr_profile);
-	if (!asr_session) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "asr_session creation FAILED\n");
-		return SWITCH_STATUS_GENERR;
-	}
-
-	/* create recognizer channel, also starts outgoing rtp media */
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Create Recognizer Channel\n");
-	asr_channel = mrcp_client_recognizer_channel_create(asr_session->profile->mrcp_context, asr_session->client_session, NULL);
-	if (!asr_channel) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create recognizer channel\n");
-		return SWITCH_STATUS_FALSE;
-	}
-
-	switch_mutex_lock(asr_session->flag_mutex);
-	mrcp_client_context_channel_add(asr_session->profile->mrcp_context, asr_session->client_session, asr_channel, NULL);
-	if(switch_thread_cond_timedwait(asr_session->wait_object,asr_session->flag_mutex,5000*1000) != APR_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n");
-	}
-	switch_mutex_unlock(asr_session->flag_mutex);
-	if(!asr_session->control_channel) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No recognizer channel available\n");
-		return SWITCH_STATUS_FALSE;
-	}
-
-	asr_session->flags = *flags;
-	ah->private_info = asr_session;
-	return SWITCH_STATUS_SUCCESS;
-}
-
-/* function to load a grammar to the asr interface */
-static switch_status_t openmrcp_asr_load_grammar(switch_asr_handle_t *ah, char *grammar, char *path)
-{
-	/** Read grammar from path and create and send and MRCP RECOGNIZE msg
-	    that has the grammar attached to body.   
-	
-	    TODO: - how does DEFINE-GRAMMAR fit into the picture here?  (if at all) 
-	*/
-	
-	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
-	mrcp_client_context_t *context = asr_session->profile->mrcp_context;
-		
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Loading grammar\n");
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Start Recognizer\n");
-	openmrcp_recog_start(context, asr_session, path);
-	
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Finished loading grammar\n");
-	return SWITCH_STATUS_SUCCESS;
-}
-
-/** 
- * function to feed audio to the ASR
- * asr_open and asr_feed appear to be called asynchronously -- in other 
- * words asr_open is not completed yet, but asr_feed is already called 
- * from another thread.
- */
-static switch_status_t openmrcp_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)
-{
-	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
-	media_frame_t media_frame;
-	audio_sink_t *audio_sink = mrcp_client_audio_sink_get(asr_session->audio_channel);
-
-	media_frame.type = MEDIA_FRAME_TYPE_AUDIO;
-	/* sampling rate and frame size should be retrieved from audio sink */
-	media_frame.codec_frame.size = 160;
-	media_frame.codec_frame.buffer = data;
-	while(len >= media_frame.codec_frame.size) {
-		if (!audio_sink) {
-			/*!
-			  If there is no audio_sink established yet, discard the audio and
-			  return SUCCESS.  returning anything other than success causes freeswitch
-			  to abort the call and tear down the channel.  One reason there might
-			  not be an audio sink is that the openmrcp client lib is still in the startup
-			  process.  
-			*/
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "!audio_sink\n");
-			return SWITCH_STATUS_SUCCESS;  
-		}
-		audio_sink->method_set->write_frame(audio_sink,&media_frame);
-		
-		len -= (unsigned int)media_frame.codec_frame.size;
-		media_frame.codec_frame.buffer = (char*)media_frame.codec_frame.buffer + media_frame.codec_frame.size;
-	}
-	if(len > 0) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "None frame alligned data len [%d]\n",len);
-	}
-	return SWITCH_STATUS_SUCCESS;
-}
-
-
-static switch_status_t openmrcp_asr_pause(switch_asr_handle_t *ah)
-{
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "openmrcp_asr_pause called\n");
-
-	return SWITCH_STATUS_SUCCESS;
-
-}
-
-static switch_status_t openmrcp_asr_resume(switch_asr_handle_t *ah)
-{
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "openmrcp_asr_resume called\n");
-
-	return SWITCH_STATUS_SUCCESS;
-}
-
-
-/*! function to unload a grammar to the asr interface */
-static switch_status_t openmrcp_asr_unload_grammar(switch_asr_handle_t *ah, char *grammar)
-{
-
-	return SWITCH_STATUS_SUCCESS;
-}
-
-/**
- * Freeswitch calls this whenever the channel is hungup or the
- * speech detection is stopped via a call to switch_ivr_stop_detect_speech()
- */
-static switch_status_t openmrcp_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
-{
-	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
-	mrcp_client_context_t *context = asr_session->profile->mrcp_context;
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "openmrcp_asr_close()\n");
-
-	// TODO!! should we do a switch_pool_clear(switch_memory_pool_t *p) on the pool held
-	// by asr_session?
-
-	// terminate client session
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Going to TERMINATE SESSION\n");
-	switch_set_flag_locked(asr_session, FLAG_TERMINATING);  
-	mrcp_client_context_session_terminate(context, asr_session->client_session);
-	
-	switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
-
-	return SWITCH_STATUS_SUCCESS;
-}
-
-
-/**
- * Freeswitch calls this method from the speech_thread() thread body method
- * in switch_ivr_async.c every time a new frame is received by the media bug
- * attached to the audio channel.  If this method returns SWITCH_STATUS_SUCCESS,
- * then Freeswitch will call openmrcp_asr_get_results() to get the result value.
- */
-static switch_status_t openmrcp_asr_check_results(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
-{
-	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
-	
-	switch_status_t rv = (switch_test_flag(asr_session, FLAG_HAS_MESSAGE)) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
-
-	return rv;
-}
-
-/*! This will be called after asr_check_results returns SUCCESS */
-static switch_status_t openmrcp_asr_get_results(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags)
-{
-	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
-	switch_status_t ret = SWITCH_STATUS_SUCCESS;
-	mrcp_message_t *message;
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "openmrcp_asr_get_results called\n");
-
-	message = asr_session->mrcp_message_last_rcvd;
-	asr_session->mrcp_message_last_rcvd = NULL;
-	// since we are returning our result here, future calls to check_results
-	// should return False
-	switch_clear_flag_locked(asr_session, FLAG_HAS_MESSAGE);
-
-	if (message->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE) {
-		if (message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS && 
-			message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "error code received [%d]\n", message->start_line.status_code);
-			ret = SWITCH_STATUS_FALSE;
-		}
-	} 
-	else if (message->start_line.message_type == MRCP_MESSAGE_TYPE_EVENT) {
-		if (message->start_line.method_id == RECOGNIZER_RECOGNITION_COMPLETE) {
-			/*! 
-			   we have to extract the XML but stripping off the <?xml version="1.0"?>
-			   header.  the body looks like:
-			
-			   Completion-Cause:001 no-match
-			   Content-Type: application/nlsml+xml
-			   Content-Length: 260
-			 
-			  <?xml version="1.0"?>
-			  <result xmlns="http://www.ietf.org/xml/ns/mrcpv2" xmlns:ex="http://www.example.com/example" score="100" grammar="session:request1 at form-level.store">
-				<interpretation>             <input mode="speech">open a</input>
-				</interpretation>
-			  </result>
-			*/
-
-			if(message->body) {
-				char *marker = "?>";  // FIXME -- lame and brittle way of doing this.  use regex or better.
-				char *position = strstr(message->body, marker);
-				if (!position) {
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Bad result received from mrcp server: %s", message->body);
-					ret = SWITCH_STATUS_FALSE;
-				}
-				else {
-					position += strlen(marker);
-					*xmlstr = strdup(position);
-				}
-			}
-			else {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No result received from mrcp server\n");
-				ret = SWITCH_STATUS_FALSE;
-			}
-
-			ret = SWITCH_STATUS_SUCCESS;	
-		} 
-		else if (message->start_line.method_id == RECOGNIZER_START_OF_INPUT) {
-			ret = SWITCH_STATUS_BREAK;
-		}
-	}
-	return ret;
-}
-
-
-static mrcp_status_t synth_speak(mrcp_client_context_t *context, openmrcp_session_t *tts_session, char *text)
-{
-	mrcp_generic_header_t *generic_header;
-	mrcp_message_t *mrcp_message;
-
-	char *text2speak;
-	const char xml_head[] = 
-		"<?xml version=\"1.0\"?>\r\n"
-		"<speak>\r\n"
-		"<paragraph>\r\n"
-		"    <sentence>";
-
-	const char xml_tail[] = "</sentence>\r\n"
-		"</paragraph>\r\n"
-		"</speak>\r\n";
-
-	size_t len = sizeof(xml_head) + sizeof(text) + sizeof(xml_tail);
-	text2speak = (char *) switch_core_alloc(tts_session->pool, len);
-	strcat(text2speak, xml_head);
-	strcat(text2speak, text);
-	strcat(text2speak, xml_tail);
-
-	mrcp_message = mrcp_client_context_message_get(context,tts_session->client_session,tts_session->control_channel,SYNTHESIZER_SPEAK);
-	if(!mrcp_message) {
-		return MRCP_STATUS_FAILURE;
-	}
-
-	generic_header = mrcp_generic_header_prepare(mrcp_message);
-	if(!generic_header) {
-		return MRCP_STATUS_FAILURE;
-	}
-
-	generic_header->content_type = "application/synthesis+ssml";
-	mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_TYPE);
-	mrcp_message->body = text2speak;
-
-	return mrcp_client_context_channel_modify(context,tts_session->client_session,mrcp_message);
-}
-
-static mrcp_status_t synth_stop(mrcp_client_context_t *context, openmrcp_session_t *tts_session)
-{
-	mrcp_message_t *mrcp_message = mrcp_client_context_message_get(context,tts_session->client_session,tts_session->control_channel,SYNTHESIZER_STOP);
-	if(!mrcp_message) {
-		return MRCP_STATUS_FAILURE;
-	}
-
-	return mrcp_client_context_channel_modify(context,tts_session->client_session,mrcp_message);
-}
-
-
-static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, char *voice_name, int rate, switch_speech_flag_t *flags) 
-{
-	openmrcp_session_t *tts_session;
-	mrcp_client_channel_t *tts_channel;
-
-	/* create session */
-	tts_session = openmrcp_session_create(openmrcp_module.tts_profile);
-	if (!tts_session) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "tts_session creation FAILED\n");
-		return SWITCH_STATUS_GENERR;
-	}
-
-	/* create synthesizer channel */
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Create Synthesizer Channel\n");
-	tts_channel = mrcp_client_synthesizer_channel_create(tts_session->profile->mrcp_context, tts_session->client_session, NULL);
-	if (!tts_channel) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create synthesizer channel\n");
-		return SWITCH_STATUS_FALSE;
-	}
-	switch_mutex_lock(tts_session->flag_mutex);
-	mrcp_client_context_channel_add(tts_session->profile->mrcp_context, tts_session->client_session, tts_channel, NULL);
-	if(switch_thread_cond_timedwait(tts_session->wait_object,tts_session->flag_mutex,5000*1000) != APR_SUCCESS) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n");
-	}
-	switch_mutex_unlock(tts_session->flag_mutex);
-	if(!tts_session->control_channel) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No synthesizer channel available\n");
-		return SWITCH_STATUS_FALSE;
-	}
-
-	tts_session->flags = *flags;
-	sh->private_info = tts_session;
-	return SWITCH_STATUS_SUCCESS;
-}
-
-static switch_status_t openmrcp_tts_close(switch_speech_handle_t *sh, switch_speech_flag_t *flags)
-{
-	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
-	mrcp_client_context_t *context = tts_session->profile->mrcp_context;
-
-	/* terminate tts session */
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "terminate tts_session\n");
-	switch_set_flag_locked(tts_session, FLAG_TERMINATING);
-	mrcp_client_context_session_terminate(context,tts_session->client_session);
-	return SWITCH_STATUS_SUCCESS;	
-}
-
-static switch_status_t openmrcp_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
-{
-	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
-	mrcp_client_context_t *context = tts_session->profile->mrcp_context;
-
-	if(!tts_session->control_channel) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no synthesizer channel too feed tts\n");
-		return SWITCH_STATUS_FALSE;
-	}
-	
-	synth_speak(context, tts_session, text); 
-	
-	switch_clear_flag(tts_session,FLAG_FEED_STARTED);
-	return SWITCH_STATUS_SUCCESS;	
-}
-
-/**
- * Freeswitch calls this when its ready to read datalen bytes of data.
- * 
- * TODO: check the blocking flag passed in flags and act accordingly  
- *       (see mod_cepstral.c)
- */
-static switch_status_t openmrcp_read_tts(switch_speech_handle_t *sh, void *data, size_t *datalen, uint32_t *rate, switch_speech_flag_t *flags)
-{
-	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
-	size_t return_len=0;
-	media_frame_t media_frame;
-	audio_source_t *audio_source;
-
-	if (switch_test_flag(tts_session, FLAG_HAS_MESSAGE)) {
-		mrcp_message_t *message = tts_session->mrcp_message_last_rcvd;
-		tts_session->mrcp_message_last_rcvd = NULL;
-		switch_clear_flag_locked(tts_session, FLAG_HAS_MESSAGE);
-
-		if (message->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE) {
-			if (message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS && 
-				message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE) {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "error code received [%d]\n", message->start_line.status_code);
-				return SWITCH_STATUS_BREAK;
-			}
-		} 
-		else if (message->start_line.message_type == MRCP_MESSAGE_TYPE_EVENT) {
-			if (message->start_line.method_id == SYNTHESIZER_SPEAK_COMPLETE) {
-				/* tell fs we are done */
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FLAG_SPEAK_COMPLETE\n");
-				return SWITCH_STATUS_BREAK;
-			}
-		}
-	}
-
-	audio_source = mrcp_client_audio_source_get(tts_session->audio_channel);
-	if(!audio_source) {
-		return SWITCH_STATUS_BREAK;
-	}
-
-	if (!switch_test_flag(tts_session, FLAG_FEED_STARTED)) {
-		switch_set_flag(tts_session, FLAG_FEED_STARTED);  // shouldn't this use set_flag_locked? -tl
-		if(audio_source->method_set->open) {
-			audio_source->method_set->open(audio_source);
-		}
-	}
-
-	/* sampling rate and frame size should be retrieved from audio source */
-	*rate = 8000;
-	media_frame.codec_frame.size = 160;
-	while(return_len < *datalen) {
-		media_frame.codec_frame.buffer = (char*)data + return_len;
-		audio_source->method_set->read_frame(audio_source,&media_frame);
-		if(media_frame.type != MEDIA_FRAME_TYPE_AUDIO) {
-			memset(media_frame.codec_frame.buffer,0,media_frame.codec_frame.size);
-		}
-		return_len += media_frame.codec_frame.size;
-	}
-	*datalen = return_len;
-	return SWITCH_STATUS_SUCCESS;	
-}
-
-
-static void openmrcp_flush_tts(switch_speech_handle_t *sh)
-{
-	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
-	mrcp_client_context_t *context = tts_session->profile->mrcp_context;
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "flush_tts called\n");
-	synth_stop(context,tts_session); // TODO
-}
-
-static void openmrcp_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
-{
-
-}
-
-static void openmrcp_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val)
-{
-
-}
-
-static void openmrcp_float_param_tts(switch_speech_handle_t *sh, char *param, double val)
-{
-
-}
-
-
-static switch_status_t do_config()
-{
-	char *cf = "mod_openmrcp.conf";
-	const char *asr_profile_name = NULL;
-	const char *tts_profile_name = NULL;
-	switch_xml_t cfg, xml, settings, profiles, xprofile, param;
-	openmrcp_profile_t *mrcp_profile;
-	openmrcp_client_options_t *mrcp_options;
-
-	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
-		return SWITCH_STATUS_TERM;
-	}
-
-	mrcp_logger.priority = MRCP_PRIO_EMERGENCY;
-	if ((settings = switch_xml_child(cfg, "settings"))) {
-		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
-			const char *var = switch_xml_attr_soft(param, "name");
-			const char *val = switch_xml_attr_soft(param, "value");
-
-			if (!strcasecmp(var, "asr_default_profile")) {
-				asr_profile_name = val;
-			} else if (!strcasecmp(var, "tts_default_profile")) {
-				tts_profile_name = val;
-			} else if (!strcasecmp(var, "log_level")) {
-				mrcp_logger.priority = atoi(val);
-			}
-		}
-	}
-	else {
-		goto error;
-	}
-	if ((profiles = switch_xml_child(cfg, "profiles"))) {
-		for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
-			const char *profile_name = switch_xml_attr_soft(xprofile, "name");
-			mrcp_profile = switch_core_alloc(openmrcp_module.pool,sizeof(openmrcp_profile_t));
-			mrcp_profile->mrcp_client = NULL;
-			mrcp_profile->mrcp_context = NULL;
-			mrcp_profile->name = "noname";
-			if(profile_name) {
-				mrcp_profile->name = switch_core_strdup(openmrcp_module.pool,profile_name);
-			}
-
-			mrcp_options = openmrcp_client_options_create(openmrcp_module.pool);
-			for (param = switch_xml_child(xprofile, "param"); param; param = param->next) {
-				const char *var = switch_xml_attr_soft(param, "name");
-				const char *val = switch_xml_attr_soft(param, "value");
-
-				if (!strcasecmp(var, "proto_version")) {
-					mrcp_options->proto_version =(mrcp_version_t) atoi(val);
-				}
-				else if (!strcasecmp(var, "client_ip")) {
-					mrcp_options->client_ip = switch_core_strdup(openmrcp_module.pool,val);
-				} else if (!strcasecmp(var, "server_ip")) {
-					mrcp_options->server_ip = switch_core_strdup(openmrcp_module.pool,val);
-				} else if (!strcasecmp(var, "client_port")) {
-					mrcp_options->client_port = (apr_port_t) atoi(val);
-				} else if (!strcasecmp(var, "server_port")) {
-					mrcp_options->server_port = (apr_port_t) atoi(val);
-				} else if (!strcasecmp(var, "rtp_port_min")) {
-					mrcp_options->rtp_port_min = (apr_port_t) atoi(val);
-				} else if (!strcasecmp(var, "rtp_port_max")) {
-					mrcp_options->rtp_port_max = (apr_port_t) atoi(val);
-				}
-			}
-			mrcp_profile->mrcp_options = mrcp_options;
-
-			/* add profile */
-			if (!switch_core_hash_find(openmrcp_module.profile_hash, mrcp_profile->name)) {
-				switch_core_hash_insert(openmrcp_module.profile_hash, mrcp_profile->name, mrcp_profile);
-
-				/* try to set default asr profile */
-				if (!openmrcp_module.asr_profile) {
-					if (asr_profile_name) {
-						if (!strcasecmp(mrcp_profile->name,asr_profile_name)) {
-							openmrcp_module.asr_profile = mrcp_profile;
-						}
-					}
-					else {
-						openmrcp_module.asr_profile = mrcp_profile;
-					}
-				}
-				/* try to set default tts profile */
-				if (!openmrcp_module.tts_profile) {
-					if (tts_profile_name) {
-						if (!strcasecmp(mrcp_profile->name,tts_profile_name)) {
-							openmrcp_module.tts_profile = mrcp_profile;
-						}
-					}
-					else {
-						openmrcp_module.tts_profile = mrcp_profile;
-					}
-				}
-			}
-		}
-	}
-	else {
-		goto error;
-	}
-
-	switch_xml_free(xml);
-	return SWITCH_STATUS_SUCCESS;
-
- error:
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to load module configuration\n");
-	switch_xml_free(xml);
-	return SWITCH_STATUS_TERM;
-
-}
-
-static switch_status_t openmrcp_profile_run(openmrcp_profile_t *profile)
-{
-	mrcp_client_event_handler_t *mrcp_event_handler;
-	mrcp_client_t *mrcp_client;
-	mrcp_client_context_t *mrcp_context;
-	
-	/*!
-	Perform one-time initialization of mrcp client library
-	*/
-	mrcp_event_handler = switch_core_alloc(openmrcp_module.pool,sizeof(mrcp_client_event_handler_t));
-	mrcp_event_handler->on_session_initiate = openmrcp_on_session_initiate;
-	mrcp_event_handler->on_session_terminate = openmrcp_on_session_terminate;
-	mrcp_event_handler->on_channel_add = openmrcp_on_channel_add;
-	mrcp_event_handler->on_channel_remove = openmrcp_on_channel_remove;
-	mrcp_event_handler->on_channel_modify = openmrcp_on_channel_modify;
-
-	// create client context, which must be passed to client engine 
-	mrcp_context = mrcp_client_context_create(&openmrcp_module,mrcp_event_handler);
-	if(!mrcp_context) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "mrcp_client_context creation failed\n");
-		return SWITCH_STATUS_GENERR;
-	}
-	profile->mrcp_context = mrcp_context;
-
-	// this basically starts a thread that pulls events from the event queue
-	// and handles them 
-	mrcp_client = openmrcp_client_start(profile->mrcp_options,mrcp_context);
-	if(!mrcp_client) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "openmrcp_client_start FAILED\n");
-		mrcp_client_context_destroy(mrcp_context);
-		return SWITCH_STATUS_GENERR;
-	}
-	profile->mrcp_client = mrcp_client;
-	return SWITCH_STATUS_SUCCESS;
-}
-
-
-static switch_status_t openmrcp_init()
-{
-	/* one-time mrcp global initialization */
-	mrcp_global_init();
-
-	openmrcp_module.pool = mrcp_global_pool_get();
-	openmrcp_module.asr_profile = NULL;
-	openmrcp_module.tts_profile = NULL;
-
-	switch_core_hash_init(&openmrcp_module.profile_hash,openmrcp_module.pool);
-
-	/* read config */
-	if (do_config() != SWITCH_STATUS_SUCCESS) {
-		return SWITCH_STATUS_FALSE;
-	}
-
-	/* run default asr/tts profiles */
-	if(openmrcp_module.asr_profile) {
-		openmrcp_profile_run(openmrcp_module.asr_profile);
-	}
-	if(openmrcp_module.tts_profile && openmrcp_module.tts_profile != openmrcp_module.asr_profile) {
-		openmrcp_profile_run(openmrcp_module.tts_profile);
-	}
-
-	return SWITCH_STATUS_SUCCESS;
-}
-
-static switch_status_t openmrcp_destroy()
-{
-	/* destroy asr/tts profiles */
-	if(openmrcp_module.asr_profile) {
-		/* shutdown client engine */
-		openmrcp_client_shutdown(openmrcp_module.asr_profile->mrcp_client);
-		/* destroy client context */
-		mrcp_client_context_destroy(openmrcp_module.asr_profile->mrcp_context);
-		if(openmrcp_module.tts_profile == openmrcp_module.asr_profile) {
-			openmrcp_module.tts_profile = NULL;
-		}
-		openmrcp_module.asr_profile = NULL;
-	}
-	if(openmrcp_module.tts_profile) {
-		/* shutdown client engine */
-		openmrcp_client_shutdown(openmrcp_module.tts_profile->mrcp_client);
-		/* destroy client context */
-		mrcp_client_context_destroy(openmrcp_module.tts_profile->mrcp_context);
-		openmrcp_module.tts_profile = NULL;
-	}
-
-	switch_core_hash_destroy(openmrcp_module.profile_hash);
-	openmrcp_module.profile_hash = NULL;
-
-	/* one-time mrcp global destroy */
-	mrcp_global_destroy();
-	return SWITCH_STATUS_SUCCESS;
-}
-
-SWITCH_MODULE_LOAD_FUNCTION(mod_openmrcp_load)
-{
-	switch_speech_interface_t *speech_interface;
-	switch_asr_interface_t *asr_interface;
-
-	/* connect my internal structure to the blank pointer passed to me */
-	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
-	speech_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SPEECH_INTERFACE);
-	speech_interface->interface_name = "openmrcp";
-	speech_interface->speech_open = openmrcp_tts_open;
-	speech_interface->speech_close = openmrcp_tts_close;
-	speech_interface->speech_feed_tts = openmrcp_feed_tts;
-	speech_interface->speech_read_tts = openmrcp_read_tts;
-	speech_interface->speech_flush_tts = openmrcp_flush_tts;
-	speech_interface->speech_text_param_tts = openmrcp_text_param_tts;
-	speech_interface->speech_numeric_param_tts = openmrcp_numeric_param_tts;
-	speech_interface->speech_float_param_tts = openmrcp_float_param_tts;
-	asr_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ASR_INTERFACE);
-	asr_interface->interface_name = "openmrcp";
-	asr_interface->asr_open = openmrcp_asr_open;
-	asr_interface->asr_load_grammar = openmrcp_asr_load_grammar;
-	asr_interface->asr_unload_grammar = openmrcp_asr_unload_grammar;
-	asr_interface->asr_close = openmrcp_asr_close;
-	asr_interface->asr_feed = openmrcp_asr_feed;
-	asr_interface->asr_resume = openmrcp_asr_resume;
-	asr_interface->asr_pause = openmrcp_asr_pause;
-	asr_interface->asr_check_results = openmrcp_asr_check_results;
-	asr_interface->asr_get_results = openmrcp_asr_get_results;
-
-	/* initialize openmrcp */
-	if (openmrcp_init() != SWITCH_STATUS_SUCCESS) {
-		return SWITCH_STATUS_FALSE;		
-	}
-
-	/* indicate that the module should continue to be loaded */
-	return SWITCH_STATUS_SUCCESS;
-}
-
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_openmrcp_shutdown)
-{
-	/* destroy openmrcp */
-	openmrcp_destroy();
-	return SWITCH_STATUS_SUCCESS;
-}
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthmct at yahoo.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Traun Leyden <tleyden at branchcut.com>
+ * Arsen Chaloyan <achaloyan at yahoo.com>
+ *
+ * Module which acts as an MRCP client to an MRCP speech recognition
+ * server.  In other words it bridges freeswitch to an external speech
+ * recognition system.  Documentation on how to install and configure
+ * the module is here: http://wiki.freeswitch.org/wiki/Mod_openmrcp
+ *
+ * Uses OpenMrcp (http://wiki.freeswitch.org/wiki/OpenMRCP) as the 
+ * the client library.  
+ *
+ * TODO
+ * =======
+ *
+ * - There are two memory pools in use.  One in asr_session which is managed
+ * by this module, and one in the switch_asr_handle_t, which is managed by freeswitch.
+ * These need to be consolidated into one.  (basically throw away the one in asr_session)
+ * 
+ * - fs status codes (eg, SWITCH_STATUS_GENERR) and mrcp status codes (MRCP_STATUS_FAILURE)
+ * are intermixed badly.  this needs cleanup
+ * 
+ * - openmrcp_flush_tts, openmrcp_text_param_tts, openmrcp_numeric_param_tts, 
+ * openmrcp_float_param_tts need to have functionality added
+ *
+ * - use a regex for extracting xml from raw result received from mrcp recognition
+ * server
+ *
+ */
+
+#ifdef __ICC
+#pragma warning (disable:188)
+#endif
+
+
+#include "openmrcp_client.h"
+#include "mrcp_client_context.h"
+#include "mrcp_recognizer.h"
+#include "mrcp_synthesizer.h"
+#include "mrcp_generic_header.h"
+
+#include <switch.h>
+	
+SWITCH_MODULE_LOAD_FUNCTION(mod_openmrcp_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_openmrcp_shutdown);
+SWITCH_MODULE_DEFINITION(mod_openmrcp, mod_openmrcp_load, 
+						 mod_openmrcp_shutdown, NULL);
+
+typedef struct {
+	char                      *name;
+	openmrcp_client_options_t *mrcp_options;
+	mrcp_client_t             *mrcp_client;
+	mrcp_client_context_t     *mrcp_context;
+} openmrcp_profile_t;
+
+typedef struct {
+	openmrcp_profile_t    *profile;
+	mrcp_session_t        *client_session;
+	mrcp_client_channel_t *control_channel;
+	mrcp_audio_channel_t  *audio_channel;
+	mrcp_message_t        *mrcp_message_last_rcvd;
+	apr_pool_t            *pool;
+	switch_speech_flag_t   flags;
+	switch_mutex_t        *flag_mutex;
+	switch_thread_cond_t  *wait_object;
+} openmrcp_session_t;
+
+typedef enum {
+	FLAG_HAS_MESSAGE =    (1 << 0),
+	FLAG_FEED_STARTED =   (1 << 1),
+	FLAG_TERMINATING =    (1 << 2)
+} mrcp_flag_t;
+
+typedef struct {
+	switch_memory_pool_t *pool;
+	switch_hash_t        *profile_hash;
+
+	openmrcp_profile_t   *asr_profile;
+	openmrcp_profile_t   *tts_profile;
+} openmrcp_module_t;
+
+static openmrcp_module_t openmrcp_module;
+
+
+static openmrcp_session_t* openmrcp_session_create(openmrcp_profile_t *profile)
+{
+	openmrcp_session_t *openmrcp_session;
+	apr_pool_t *session_pool;
+
+	if(!profile) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no profile specified\n");
+		return NULL;
+	}
+
+	if(apr_pool_create(&session_pool,NULL) != APR_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to create session_pool\n");
+		return NULL;
+	}
+
+	openmrcp_session = apr_palloc(session_pool,sizeof(openmrcp_session_t));
+	openmrcp_session->pool = session_pool;
+	openmrcp_session->profile = profile;
+	openmrcp_session->client_session = NULL;
+	openmrcp_session->control_channel = NULL;
+	openmrcp_session->audio_channel = NULL;
+	openmrcp_session->mrcp_message_last_rcvd = NULL;
+
+	switch_mutex_init(&openmrcp_session->flag_mutex, SWITCH_MUTEX_NESTED, openmrcp_session->pool);
+
+	if (switch_thread_cond_create(&openmrcp_session->wait_object, openmrcp_session->pool)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,  "wait object creation failed\n");
+	}
+
+	openmrcp_session->client_session = mrcp_client_context_session_create(openmrcp_session->profile->mrcp_context,openmrcp_session);
+	if (!openmrcp_session->client_session) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "session creation FAILED\n");
+		apr_pool_destroy(session_pool);
+		return NULL;
+	}
+
+	return openmrcp_session;
+}
+
+static void openmrcp_session_destroy(openmrcp_session_t *openmrcp_session)
+{
+	if(openmrcp_session && openmrcp_session->pool) {
+		mrcp_client_context_session_destroy(openmrcp_session->profile->mrcp_context,openmrcp_session->client_session);
+		apr_pool_destroy(openmrcp_session->pool);
+	}
+}
+
+static mrcp_status_t openmrcp_on_session_initiate(mrcp_client_context_t *context, mrcp_session_t *session)
+{
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_session_initiate called\n");
+	return MRCP_STATUS_SUCCESS;
+}
+
+static mrcp_status_t openmrcp_on_session_terminate(mrcp_client_context_t *context, mrcp_session_t *session)
+{
+	openmrcp_session_t *openmrcp_session = mrcp_client_context_session_object_get(session);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_session_terminate called\n");
+	if(!openmrcp_session) {
+		return MRCP_STATUS_FAILURE;
+	}
+
+	if (switch_test_flag(openmrcp_session, FLAG_TERMINATING)) {
+		openmrcp_session_destroy(openmrcp_session);
+	}
+	else {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "abnormal session terminate\n");
+	}
+	return MRCP_STATUS_SUCCESS;
+}
+
+static mrcp_status_t openmrcp_on_channel_add(mrcp_client_context_t *context, mrcp_session_t *session, mrcp_client_channel_t *control_channel, mrcp_audio_channel_t *audio_channel)
+{
+	openmrcp_session_t *openmrcp_session = mrcp_client_context_session_object_get(session);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_channel_add called\n");
+	if(!openmrcp_session) {
+		return MRCP_STATUS_FAILURE;
+	}
+	switch_mutex_lock(openmrcp_session->flag_mutex);
+	openmrcp_session->control_channel = control_channel;
+	openmrcp_session->audio_channel = audio_channel;
+	switch_thread_cond_signal(openmrcp_session->wait_object);
+	switch_mutex_unlock(openmrcp_session->flag_mutex);
+	return MRCP_STATUS_SUCCESS;
+}
+
+static mrcp_status_t openmrcp_on_channel_remove(mrcp_client_context_t *context, mrcp_session_t *session, mrcp_client_channel_t *control_channel)
+{
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "on_channel_remove called\n");
+	return MRCP_STATUS_SUCCESS;
+}
+
+/** this is called by the mrcp core whenever an mrcp message is received from
+    the other side. */
+static mrcp_status_t openmrcp_on_channel_modify(mrcp_client_context_t *context, mrcp_session_t *session, mrcp_message_t *mrcp_message)
+{
+	openmrcp_session_t *openmrcp_session = mrcp_client_context_session_object_get(session);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "on_channel_modify called\n");
+	if (!openmrcp_session) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "!openmrcp_session\n");
+		return MRCP_STATUS_FAILURE;
+	}
+	if (!mrcp_message) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "!mrcp_message\n");
+		return MRCP_STATUS_FAILURE;
+	}
+
+	if (mrcp_message->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE && mrcp_message->start_line.request_state == MRCP_REQUEST_STATE_INPROGRESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ignoring mrcp response\n");
+		return MRCP_STATUS_SUCCESS;
+	}
+
+	if (switch_test_flag(openmrcp_session, FLAG_HAS_MESSAGE)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "already has message\n");
+		return MRCP_STATUS_SUCCESS;
+	}
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "setting FLAG_HAS_MESSAGE\n");
+	openmrcp_session->mrcp_message_last_rcvd = mrcp_message;
+	switch_set_flag_locked(openmrcp_session, FLAG_HAS_MESSAGE);
+	return MRCP_STATUS_SUCCESS;
+}
+
+/** Read in the grammar and construct an MRCP Recognize message that has
+    The grammar attached as the payload */
+static mrcp_status_t openmrcp_recog_start(mrcp_client_context_t *context, openmrcp_session_t *asr_session, char *path)
+{
+	mrcp_generic_header_t *generic_header;
+	apr_status_t rv;
+	apr_file_t *fp;
+	apr_pool_t *mp;
+	apr_finfo_t finfo;
+	char *buf1;
+	apr_size_t bytes2read = 0;
+	
+	mrcp_message_t *mrcp_message = mrcp_client_context_message_get(context, asr_session->client_session, asr_session->control_channel, RECOGNIZER_RECOGNIZE);
+
+	if(!mrcp_message) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not create mrcp msg\n");
+		return MRCP_STATUS_FAILURE;
+	}
+
+	/* open the file with the grammar and read into char* buffer */
+	mp = mrcp_message->pool;
+	if ((rv = apr_file_open(&fp, path, APR_READ, APR_OS_DEFAULT, mp)) != APR_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not read grammar\n");
+		return -1;
+	}
+	rv = apr_file_info_get(&finfo, APR_FINFO_NORM, fp);
+	
+	buf1 = apr_palloc(mp, (apr_size_t)finfo.size + 1);
+	bytes2read = (apr_size_t)finfo.size;
+	rv = apr_file_read(fp, buf1, &bytes2read);
+	buf1[bytes2read] = '\0';
+
+	generic_header = mrcp_generic_header_prepare(mrcp_message);
+	if(!generic_header) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not prepare generic_header\n");
+		return MRCP_STATUS_FAILURE;
+	}
+
+	generic_header->content_type = "application/srgs+xml";
+	mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_TYPE);
+	mrcp_message->body = buf1;
+
+	/* send the MRCP RECOGNIZE message to MRCP server */
+	return mrcp_client_context_channel_modify(context, asr_session->client_session, mrcp_message);
+}
+
+
+/**
+ * Freeswitch calls this from switch_ivr_detect_speech() and then adds a media
+ * bug to tap into the channel's audio, which will result in all data getting
+ * passed to asr_feed() and calls to asr_check_results() on each recevied frame.
+ * 
+ * This code expects certain one-time initialization of the openmrcp client
+ * engine/systeme to have already taken place.function to open the asr interface 
+ */
+static switch_status_t openmrcp_asr_open(switch_asr_handle_t *ah, char *codec, int rate, char *dest, switch_asr_flag_t *flags) 
+{
+	openmrcp_session_t *asr_session;
+	mrcp_client_channel_t *asr_channel;
+	
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "asr_open called, codec: %s, rate: %d\n", codec, rate);
+
+	if (strcmp(codec,"L16")) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sorry, only L16 codec supported\n");
+		return SWITCH_STATUS_GENERR;		
+	}
+	if (rate != 8000) {
+		// TODO: look into supporting other sample rates
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Sorry, only 8kz supported\n");
+		return SWITCH_STATUS_GENERR;		
+	}
+	/* create session */
+	asr_session = openmrcp_session_create(openmrcp_module.asr_profile);
+	if (!asr_session) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "asr_session creation FAILED\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	/* create recognizer channel, also starts outgoing rtp media */
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Create Recognizer Channel\n");
+	asr_channel = mrcp_client_recognizer_channel_create(asr_session->profile->mrcp_context, asr_session->client_session, NULL);
+	if (!asr_channel) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create recognizer channel\n");
+		return SWITCH_STATUS_FALSE;
+	}
+
+	switch_mutex_lock(asr_session->flag_mutex);
+	mrcp_client_context_channel_add(asr_session->profile->mrcp_context, asr_session->client_session, asr_channel, NULL);
+	if(switch_thread_cond_timedwait(asr_session->wait_object,asr_session->flag_mutex,5000*1000) != APR_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n");
+	}
+	switch_mutex_unlock(asr_session->flag_mutex);
+	if(!asr_session->control_channel) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No recognizer channel available\n");
+		return SWITCH_STATUS_FALSE;
+	}
+
+	asr_session->flags = *flags;
+	ah->private_info = asr_session;
+	return SWITCH_STATUS_SUCCESS;
+}
+
+/* function to load a grammar to the asr interface */
+static switch_status_t openmrcp_asr_load_grammar(switch_asr_handle_t *ah, char *grammar, char *path)
+{
+	/** Read grammar from path and create and send and MRCP RECOGNIZE msg
+	    that has the grammar attached to body.   
+	
+	    TODO: - how does DEFINE-GRAMMAR fit into the picture here?  (if at all) 
+	*/
+	
+	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
+	mrcp_client_context_t *context = asr_session->profile->mrcp_context;
+		
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Loading grammar\n");
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Start Recognizer\n");
+	openmrcp_recog_start(context, asr_session, path);
+	
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Finished loading grammar\n");
+	return SWITCH_STATUS_SUCCESS;
+}
+
+/** 
+ * function to feed audio to the ASR
+ * asr_open and asr_feed appear to be called asynchronously -- in other 
+ * words asr_open is not completed yet, but asr_feed is already called 
+ * from another thread.
+ */
+static switch_status_t openmrcp_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)
+{
+	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
+	media_frame_t media_frame;
+	audio_sink_t *audio_sink = mrcp_client_audio_sink_get(asr_session->audio_channel);
+
+	media_frame.type = MEDIA_FRAME_TYPE_AUDIO;
+	/* sampling rate and frame size should be retrieved from audio sink */
+	media_frame.codec_frame.size = 160;
+	media_frame.codec_frame.buffer = data;
+	while(len >= media_frame.codec_frame.size) {
+		if (!audio_sink) {
+			/*!
+			  If there is no audio_sink established yet, discard the audio and
+			  return SUCCESS.  returning anything other than success causes freeswitch
+			  to abort the call and tear down the channel.  One reason there might
+			  not be an audio sink is that the openmrcp client lib is still in the startup
+			  process.  
+			*/
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "!audio_sink\n");
+			return SWITCH_STATUS_SUCCESS;  
+		}
+		audio_sink->method_set->write_frame(audio_sink,&media_frame);
+		
+		len -= (unsigned int)media_frame.codec_frame.size;
+		media_frame.codec_frame.buffer = (char*)media_frame.codec_frame.buffer + media_frame.codec_frame.size;
+	}
+	if(len > 0) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "None frame alligned data len [%d]\n",len);
+	}
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+static switch_status_t openmrcp_asr_pause(switch_asr_handle_t *ah)
+{
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "openmrcp_asr_pause called\n");
+
+	return SWITCH_STATUS_SUCCESS;
+
+}
+
+static switch_status_t openmrcp_asr_resume(switch_asr_handle_t *ah)
+{
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "openmrcp_asr_resume called\n");
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+/*! function to unload a grammar to the asr interface */
+static switch_status_t openmrcp_asr_unload_grammar(switch_asr_handle_t *ah, char *grammar)
+{
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+/**
+ * Freeswitch calls this whenever the channel is hungup or the
+ * speech detection is stopped via a call to switch_ivr_stop_detect_speech()
+ */
+static switch_status_t openmrcp_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
+{
+	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
+	mrcp_client_context_t *context = asr_session->profile->mrcp_context;
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "openmrcp_asr_close()\n");
+
+	// TODO!! should we do a switch_pool_clear(switch_memory_pool_t *p) on the pool held
+	// by asr_session?
+
+	// terminate client session
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Going to TERMINATE SESSION\n");
+	switch_set_flag_locked(asr_session, FLAG_TERMINATING);  
+	mrcp_client_context_session_terminate(context, asr_session->client_session);
+	
+	switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+/**
+ * Freeswitch calls this method from the speech_thread() thread body method
+ * in switch_ivr_async.c every time a new frame is received by the media bug
+ * attached to the audio channel.  If this method returns SWITCH_STATUS_SUCCESS,
+ * then Freeswitch will call openmrcp_asr_get_results() to get the result value.
+ */
+static switch_status_t openmrcp_asr_check_results(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
+{
+	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
+	
+	switch_status_t rv = (switch_test_flag(asr_session, FLAG_HAS_MESSAGE)) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+
+	return rv;
+}
+
+/*! This will be called after asr_check_results returns SUCCESS */
+static switch_status_t openmrcp_asr_get_results(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags)
+{
+	openmrcp_session_t *asr_session = (openmrcp_session_t *) ah->private_info;
+	switch_status_t ret = SWITCH_STATUS_SUCCESS;
+	mrcp_message_t *message;
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "openmrcp_asr_get_results called\n");
+
+	message = asr_session->mrcp_message_last_rcvd;
+	asr_session->mrcp_message_last_rcvd = NULL;
+	// since we are returning our result here, future calls to check_results
+	// should return False
+	switch_clear_flag_locked(asr_session, FLAG_HAS_MESSAGE);
+
+	if (message->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE) {
+		if (message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS && 
+			message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "error code received [%d]\n", message->start_line.status_code);
+			ret = SWITCH_STATUS_FALSE;
+		}
+	} 
+	else if (message->start_line.message_type == MRCP_MESSAGE_TYPE_EVENT) {
+		if (message->start_line.method_id == RECOGNIZER_RECOGNITION_COMPLETE) {
+			/*! 
+			   we have to extract the XML but stripping off the <?xml version="1.0"?>
+			   header.  the body looks like:
+			
+			   Completion-Cause:001 no-match
+			   Content-Type: application/nlsml+xml
+			   Content-Length: 260
+			 
+			  <?xml version="1.0"?>
+			  <result xmlns="http://www.ietf.org/xml/ns/mrcpv2" xmlns:ex="http://www.example.com/example" score="100" grammar="session:request1 at form-level.store">
+				<interpretation>             <input mode="speech">open a</input>
+				</interpretation>
+			  </result>
+			*/
+
+			if(message->body) {
+				char *marker = "?>";  // FIXME -- lame and brittle way of doing this.  use regex or better.
+				char *position = strstr(message->body, marker);
+				if (!position) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Bad result received from mrcp server: %s", message->body);
+					ret = SWITCH_STATUS_FALSE;
+				}
+				else {
+					position += strlen(marker);
+					*xmlstr = strdup(position);
+				}
+			}
+			else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No result received from mrcp server\n");
+				ret = SWITCH_STATUS_FALSE;
+			}
+
+			ret = SWITCH_STATUS_SUCCESS;	
+		} 
+		else if (message->start_line.method_id == RECOGNIZER_START_OF_INPUT) {
+			ret = SWITCH_STATUS_BREAK;
+		}
+	}
+	return ret;
+}
+
+
+static mrcp_status_t synth_speak(mrcp_client_context_t *context, openmrcp_session_t *tts_session, char *text)
+{
+	mrcp_generic_header_t *generic_header;
+	mrcp_message_t *mrcp_message;
+
+	char *text2speak;
+	const char xml_head[] = 
+		"<?xml version=\"1.0\"?>\r\n"
+		"<speak>\r\n"
+		"<paragraph>\r\n"
+		"    <sentence>";
+
+	const char xml_tail[] = "</sentence>\r\n"
+		"</paragraph>\r\n"
+		"</speak>\r\n";
+
+	size_t len = sizeof(xml_head) + sizeof(text) + sizeof(xml_tail);
+	text2speak = (char *) switch_core_alloc(tts_session->pool, len);
+	strcat(text2speak, xml_head);
+	strcat(text2speak, text);
+	strcat(text2speak, xml_tail);
+
+	mrcp_message = mrcp_client_context_message_get(context,tts_session->client_session,tts_session->control_channel,SYNTHESIZER_SPEAK);
+	if(!mrcp_message) {
+		return MRCP_STATUS_FAILURE;
+	}
+
+	generic_header = mrcp_generic_header_prepare(mrcp_message);
+	if(!generic_header) {
+		return MRCP_STATUS_FAILURE;
+	}
+
+	generic_header->content_type = "application/synthesis+ssml";
+	mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_TYPE);
+	mrcp_message->body = text2speak;
+
+	return mrcp_client_context_channel_modify(context,tts_session->client_session,mrcp_message);
+}
+
+static mrcp_status_t synth_stop(mrcp_client_context_t *context, openmrcp_session_t *tts_session)
+{
+	mrcp_message_t *mrcp_message = mrcp_client_context_message_get(context,tts_session->client_session,tts_session->control_channel,SYNTHESIZER_STOP);
+	if(!mrcp_message) {
+		return MRCP_STATUS_FAILURE;
+	}
+
+	return mrcp_client_context_channel_modify(context,tts_session->client_session,mrcp_message);
+}
+
+
+static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, char *voice_name, int rate, switch_speech_flag_t *flags) 
+{
+	openmrcp_session_t *tts_session;
+	mrcp_client_channel_t *tts_channel;
+
+	/* create session */
+	tts_session = openmrcp_session_create(openmrcp_module.tts_profile);
+	if (!tts_session) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "tts_session creation FAILED\n");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	/* create synthesizer channel */
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Create Synthesizer Channel\n");
+	tts_channel = mrcp_client_synthesizer_channel_create(tts_session->profile->mrcp_context, tts_session->client_session, NULL);
+	if (!tts_channel) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create synthesizer channel\n");
+		return SWITCH_STATUS_FALSE;
+	}
+	switch_mutex_lock(tts_session->flag_mutex);
+	mrcp_client_context_channel_add(tts_session->profile->mrcp_context, tts_session->client_session, tts_channel, NULL);
+	if(switch_thread_cond_timedwait(tts_session->wait_object,tts_session->flag_mutex,5000*1000) != APR_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n");
+	}
+	switch_mutex_unlock(tts_session->flag_mutex);
+	if(!tts_session->control_channel) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No synthesizer channel available\n");
+		return SWITCH_STATUS_FALSE;
+	}
+
+	tts_session->flags = *flags;
+	sh->private_info = tts_session;
+	return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t openmrcp_tts_close(switch_speech_handle_t *sh, switch_speech_flag_t *flags)
+{
+	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
+	mrcp_client_context_t *context = tts_session->profile->mrcp_context;
+
+	/* terminate tts session */
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "terminate tts_session\n");
+	switch_set_flag_locked(tts_session, FLAG_TERMINATING);
+	mrcp_client_context_session_terminate(context,tts_session->client_session);
+	return SWITCH_STATUS_SUCCESS;	
+}
+
+static switch_status_t openmrcp_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
+{
+	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
+	mrcp_client_context_t *context = tts_session->profile->mrcp_context;
+
+	if(!tts_session->control_channel) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no synthesizer channel too feed tts\n");
+		return SWITCH_STATUS_FALSE;
+	}
+	
+	synth_speak(context, tts_session, text); 
+	
+	switch_clear_flag(tts_session,FLAG_FEED_STARTED);
+	return SWITCH_STATUS_SUCCESS;	
+}
+
+/**
+ * Freeswitch calls this when its ready to read datalen bytes of data.
+ * 
+ * TODO: check the blocking flag passed in flags and act accordingly  
+ *       (see mod_cepstral.c)
+ */
+static switch_status_t openmrcp_read_tts(switch_speech_handle_t *sh, void *data, size_t *datalen, uint32_t *rate, switch_speech_flag_t *flags)
+{
+	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
+	size_t return_len=0;
+	media_frame_t media_frame;
+	audio_source_t *audio_source;
+
+	if (switch_test_flag(tts_session, FLAG_HAS_MESSAGE)) {
+		mrcp_message_t *message = tts_session->mrcp_message_last_rcvd;
+		tts_session->mrcp_message_last_rcvd = NULL;
+		switch_clear_flag_locked(tts_session, FLAG_HAS_MESSAGE);
+
+		if (message->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE) {
+			if (message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS && 
+				message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "error code received [%d]\n", message->start_line.status_code);
+				return SWITCH_STATUS_BREAK;
+			}
+		} 
+		else if (message->start_line.message_type == MRCP_MESSAGE_TYPE_EVENT) {
+			if (message->start_line.method_id == SYNTHESIZER_SPEAK_COMPLETE) {
+				/* tell fs we are done */
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FLAG_SPEAK_COMPLETE\n");
+				return SWITCH_STATUS_BREAK;
+			}
+		}
+	}
+
+	audio_source = mrcp_client_audio_source_get(tts_session->audio_channel);
+	if(!audio_source) {
+		return SWITCH_STATUS_BREAK;
+	}
+
+	if (!switch_test_flag(tts_session, FLAG_FEED_STARTED)) {
+		switch_set_flag(tts_session, FLAG_FEED_STARTED);  // shouldn't this use set_flag_locked? -tl
+		if(audio_source->method_set->open) {
+			audio_source->method_set->open(audio_source);
+		}
+	}
+
+	/* sampling rate and frame size should be retrieved from audio source */
+	*rate = 8000;
+	media_frame.codec_frame.size = 160;
+	while(return_len < *datalen) {
+		media_frame.codec_frame.buffer = (char*)data + return_len;
+		audio_source->method_set->read_frame(audio_source,&media_frame);
+		if(media_frame.type != MEDIA_FRAME_TYPE_AUDIO) {
+			memset(media_frame.codec_frame.buffer,0,media_frame.codec_frame.size);
+		}
+		return_len += media_frame.codec_frame.size;
+	}
+	*datalen = return_len;
+	return SWITCH_STATUS_SUCCESS;	
+}
+
+
+static void openmrcp_flush_tts(switch_speech_handle_t *sh)
+{
+	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
+	mrcp_client_context_t *context = tts_session->profile->mrcp_context;
+
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "flush_tts called\n");
+	synth_stop(context,tts_session); // TODO
+}
+
+static void openmrcp_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
+{
+
+}
+
+static void openmrcp_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val)
+{
+
+}
+
+static void openmrcp_float_param_tts(switch_speech_handle_t *sh, char *param, double val)
+{
+
+}
+
+
+static switch_status_t do_config()
+{
+	char *cf = "mod_openmrcp.conf";
+	const char *asr_profile_name = NULL;
+	const char *tts_profile_name = NULL;
+	switch_xml_t cfg, xml, settings, profiles, xprofile, param;
+	openmrcp_profile_t *mrcp_profile;
+	openmrcp_client_options_t *mrcp_options;
+
+	if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
+		return SWITCH_STATUS_TERM;
+	}
+
+	mrcp_logger.priority = MRCP_PRIO_EMERGENCY;
+	if ((settings = switch_xml_child(cfg, "settings"))) {
+		for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+			const char *var = switch_xml_attr_soft(param, "name");
+			const char *val = switch_xml_attr_soft(param, "value");
+
+			if (!strcasecmp(var, "asr_default_profile")) {
+				asr_profile_name = val;
+			} else if (!strcasecmp(var, "tts_default_profile")) {
+				tts_profile_name = val;
+			} else if (!strcasecmp(var, "log_level")) {
+				mrcp_logger.priority = atoi(val);
+			}
+		}
+	}
+	else {
+		goto error;
+	}
+	if ((profiles = switch_xml_child(cfg, "profiles"))) {
+		for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
+			const char *profile_name = switch_xml_attr_soft(xprofile, "name");
+			mrcp_profile = switch_core_alloc(openmrcp_module.pool,sizeof(openmrcp_profile_t));
+			mrcp_profile->mrcp_client = NULL;
+			mrcp_profile->mrcp_context = NULL;
+			mrcp_profile->name = "noname";
+			if(profile_name) {
+				mrcp_profile->name = switch_core_strdup(openmrcp_module.pool,profile_name);
+			}
+
+			mrcp_options = openmrcp_client_options_create(openmrcp_module.pool);
+			for (param = switch_xml_child(xprofile, "param"); param; param = param->next) {
+				const char *var = switch_xml_attr_soft(param, "name");
+				const char *val = switch_xml_attr_soft(param, "value");
+
+				if (!strcasecmp(var, "proto_version")) {
+					mrcp_options->proto_version =(mrcp_version_t) atoi(val);
+				}
+				else if (!strcasecmp(var, "client_ip")) {
+					mrcp_options->client_ip = switch_core_strdup(openmrcp_module.pool,val);
+				} else if (!strcasecmp(var, "server_ip")) {
+					mrcp_options->server_ip = switch_core_strdup(openmrcp_module.pool,val);
+				} else if (!strcasecmp(var, "client_port")) {
+					mrcp_options->client_port = (apr_port_t) atoi(val);
+				} else if (!strcasecmp(var, "server_port")) {
+					mrcp_options->server_port = (apr_port_t) atoi(val);
+				} else if (!strcasecmp(var, "rtp_port_min")) {
+					mrcp_options->rtp_port_min = (apr_port_t) atoi(val);
+				} else if (!strcasecmp(var, "rtp_port_max")) {
+					mrcp_options->rtp_port_max = (apr_port_t) atoi(val);
+				}
+			}
+			mrcp_profile->mrcp_options = mrcp_options;
+
+			/* add profile */
+			if (!switch_core_hash_find(openmrcp_module.profile_hash, mrcp_profile->name)) {
+				switch_core_hash_insert(openmrcp_module.profile_hash, mrcp_profile->name, mrcp_profile);
+
+				/* try to set default asr profile */
+				if (!openmrcp_module.asr_profile) {
+					if (asr_profile_name) {
+						if (!strcasecmp(mrcp_profile->name,asr_profile_name)) {
+							openmrcp_module.asr_profile = mrcp_profile;
+						}
+					}
+					else {
+						openmrcp_module.asr_profile = mrcp_profile;
+					}
+				}
+				/* try to set default tts profile */
+				if (!openmrcp_module.tts_profile) {
+					if (tts_profile_name) {
+						if (!strcasecmp(mrcp_profile->name,tts_profile_name)) {
+							openmrcp_module.tts_profile = mrcp_profile;
+						}
+					}
+					else {
+						openmrcp_module.tts_profile = mrcp_profile;
+					}
+				}
+			}
+		}
+	}
+	else {
+		goto error;
+	}
+
+	switch_xml_free(xml);
+	return SWITCH_STATUS_SUCCESS;
+
+ error:
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to load module configuration\n");
+	switch_xml_free(xml);
+	return SWITCH_STATUS_TERM;
+
+}
+
+static switch_status_t openmrcp_profile_run(openmrcp_profile_t *profile)
+{
+	mrcp_client_event_handler_t *mrcp_event_handler;
+	mrcp_client_t *mrcp_client;
+	mrcp_client_context_t *mrcp_context;
+	
+	/*!
+	Perform one-time initialization of mrcp client library
+	*/
+	mrcp_event_handler = switch_core_alloc(openmrcp_module.pool,sizeof(mrcp_client_event_handler_t));
+	mrcp_event_handler->on_session_initiate = openmrcp_on_session_initiate;
+	mrcp_event_handler->on_session_terminate = openmrcp_on_session_terminate;
+	mrcp_event_handler->on_channel_add = openmrcp_on_channel_add;
+	mrcp_event_handler->on_channel_remove = openmrcp_on_channel_remove;
+	mrcp_event_handler->on_channel_modify = openmrcp_on_channel_modify;
+
+	// create client context, which must be passed to client engine 
+	mrcp_context = mrcp_client_context_create(&openmrcp_module,mrcp_event_handler);
+	if(!mrcp_context) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "mrcp_client_context creation failed\n");
+		return SWITCH_STATUS_GENERR;
+	}
+	profile->mrcp_context = mrcp_context;
+
+	// this basically starts a thread that pulls events from the event queue
+	// and handles them 
+	mrcp_client = openmrcp_client_start(profile->mrcp_options,mrcp_context);
+	if(!mrcp_client) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "openmrcp_client_start FAILED\n");
+		mrcp_client_context_destroy(mrcp_context);
+		return SWITCH_STATUS_GENERR;
+	}
+	profile->mrcp_client = mrcp_client;
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+static switch_status_t openmrcp_init()
+{
+	/* one-time mrcp global initialization */
+	mrcp_global_init();
+
+	openmrcp_module.pool = mrcp_global_pool_get();
+	openmrcp_module.asr_profile = NULL;
+	openmrcp_module.tts_profile = NULL;
+
+	switch_core_hash_init(&openmrcp_module.profile_hash,openmrcp_module.pool);
+
+	/* read config */
+	if (do_config() != SWITCH_STATUS_SUCCESS) {
+		return SWITCH_STATUS_FALSE;
+	}
+
+	/* run default asr/tts profiles */
+	if(openmrcp_module.asr_profile) {
+		openmrcp_profile_run(openmrcp_module.asr_profile);
+	}
+	if(openmrcp_module.tts_profile && openmrcp_module.tts_profile != openmrcp_module.asr_profile) {
+		openmrcp_profile_run(openmrcp_module.tts_profile);
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t openmrcp_destroy()
+{
+	/* destroy asr/tts profiles */
+	if(openmrcp_module.asr_profile) {
+		/* shutdown client engine */
+		openmrcp_client_shutdown(openmrcp_module.asr_profile->mrcp_client);
+		/* destroy client context */
+		mrcp_client_context_destroy(openmrcp_module.asr_profile->mrcp_context);
+		if(openmrcp_module.tts_profile == openmrcp_module.asr_profile) {
+			openmrcp_module.tts_profile = NULL;
+		}
+		openmrcp_module.asr_profile = NULL;
+	}
+	if(openmrcp_module.tts_profile) {
+		/* shutdown client engine */
+		openmrcp_client_shutdown(openmrcp_module.tts_profile->mrcp_client);
+		/* destroy client context */
+		mrcp_client_context_destroy(openmrcp_module.tts_profile->mrcp_context);
+		openmrcp_module.tts_profile = NULL;
+	}
+
+	switch_core_hash_destroy(openmrcp_module.profile_hash);
+	openmrcp_module.profile_hash = NULL;
+
+	/* one-time mrcp global destroy */
+	mrcp_global_destroy();
+	return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_openmrcp_load)
+{
+	switch_speech_interface_t *speech_interface;
+	switch_asr_interface_t *asr_interface;
+
+	/* connect my internal structure to the blank pointer passed to me */
+	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+	speech_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SPEECH_INTERFACE);
+	speech_interface->interface_name = "openmrcp";
+	speech_interface->speech_open = openmrcp_tts_open;
+	speech_interface->speech_close = openmrcp_tts_close;
+	speech_interface->speech_feed_tts = openmrcp_feed_tts;
+	speech_interface->speech_read_tts = openmrcp_read_tts;
+	speech_interface->speech_flush_tts = openmrcp_flush_tts;
+	speech_interface->speech_text_param_tts = openmrcp_text_param_tts;
+	speech_interface->speech_numeric_param_tts = openmrcp_numeric_param_tts;
+	speech_interface->speech_float_param_tts = openmrcp_float_param_tts;
+	asr_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ASR_INTERFACE);
+	asr_interface->interface_name = "openmrcp";
+	asr_interface->asr_open = openmrcp_asr_open;
+	asr_interface->asr_load_grammar = openmrcp_asr_load_grammar;
+	asr_interface->asr_unload_grammar = openmrcp_asr_unload_grammar;
+	asr_interface->asr_close = openmrcp_asr_close;
+	asr_interface->asr_feed = openmrcp_asr_feed;
+	asr_interface->asr_resume = openmrcp_asr_resume;
+	asr_interface->asr_pause = openmrcp_asr_pause;
+	asr_interface->asr_check_results = openmrcp_asr_check_results;
+	asr_interface->asr_get_results = openmrcp_asr_get_results;
+
+	/* initialize openmrcp */
+	if (openmrcp_init() != SWITCH_STATUS_SUCCESS) {
+		return SWITCH_STATUS_FALSE;		
+	}
+
+	/* indicate that the module should continue to be loaded */
+	return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_openmrcp_shutdown)
+{
+	/* destroy openmrcp */
+	openmrcp_destroy();
+	return SWITCH_STATUS_SUCCESS;
+}

Modified: freeswitch/trunk/src/mod/endpoints/mod_wanpipe/testapp.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_wanpipe/testapp.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_wanpipe/testapp.c	Fri Sep 21 14:49:14 2007
@@ -1,448 +1,448 @@
-/*****************************************************************************
-* aft_api.c	AFT T1/E1: HDLC API Sample Code
-*
-* Author(s):	Nenad Corbic <ncorbic at sangoma.com>
-*
-* Copyright:	(c) 2003-2004 Sangoma Technologies 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 of the License, or (at your option) any later version.
-* ============================================================================
-*/
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <linux/if_wanpipe.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <linux/if.h>
-#include <linux/wanpipe_defines.h>
-#include <linux/wanpipe_cfg.h>
-#include <linux/wanpipe.h>
-#include <libsangoma.h>
-#include "lib_api.h"
-
-#define MAX_TX_DATA     5000	/* Size of tx data */  
-#define MAX_FRAMES 	5000     /* Number of frames to transmit */  
-
-#define MAX_RX_DATA	5000
-
-unsigned short Rx_lgth;
-
-unsigned char Rx_data[MAX_RX_DATA];
-unsigned char Tx_data[MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t)];
-
-/* Prototypes */
-int MakeConnection(void);
-void handle_span_chan( void);
-void sig_end(int sigid);
-
-int dev_fd;
-FILE *tx_fd=NULL,*rx_fd=NULL;	
-wanpipe_tdm_api_t tdm_api; 
-
-
-/***************************************************
-* HANDLE SOCKET 
-*
-*   o Read a socket 
-*   o Cast data received to api_rx_element_t data type 
-*   o The received packet contains 16 bytes header 
-*
-*	------------------------------------------
-*      |  16 bytes      |        X bytes        ...
-*	------------------------------------------
-* 	   Header              Data
-*
-* o Data structures:
-* ------------------
-* typedef struct {
-* 	union {
-* 		struct {
-* 			unsigned char	_event_type;
-* 			unsigned char	_rbs_rx_bits;
-* 			unsigned int	_time_stamp;
-* 		}wp_event;
-* 		struct {
-* 			unsigned char	_rbs_rx_bits;
-* 			unsigned int	_time_stamp;
-* 		}wp_rx;
-* 		unsigned char	reserved[16];
-* 	}wp_rx_hdr_u;
-* #define wp_api_event_type		wp_rx_hdr_u.wp_event._event_type
-* #define wp_api_event_rbs_rx_bits 	wp_rx_hdr_u.wp_event._rbs_rx_bits
-* #define wp_api_event_time_stamp 	wp_rx_hdr_u.wp_event._time_stamp
-* } wp_tdm_api_rx_hdr_t;
-* 
-* typedef struct {
-*         wp_tdm_api_rx_hdr_t	hdr;
-*         unsigned char  		data[1];
-* } wp_tdm_api_rx_element_t;
-* 
-* typedef struct {
-* 	union {
-* 		struct {
-* 			unsigned char	_rbs_rx_bits;
-* 			unsigned int	_time_stamp;
-* 		}wp_tx;
-* 		unsigned char	reserved[16];
-* 	}wp_tx_hdr_u;
-* #define wp_api_time_stamp 	wp_tx_hdr_u.wp_tx._time_stamp
-* } wp_tdm_api_tx_hdr_t;
-* 
-* typedef struct {
-*         wp_tdm_api_tx_hdr_t	hdr;
-*         unsigned char  		data[1];
-* } wp_tdm_api_tx_element_t;
-*                     
-* #define WPTDM_A_BIT 0x08
-* #define WPTDM_B_BIT 0x04
-* #define WPTDM_C_BIT 0x02
-* #define WPTDM_D_BIT 0x01
-*
-*/
-
-void handle_span_chan(void) 
-{
-	unsigned int Rx_count,Tx_count,Tx_length;
-	wp_tdm_api_rx_element_t* api_rx_el;
-	wp_tdm_api_tx_element_t * api_tx_el;
-	fd_set 	ready,write,oob;
-	int err,i;
-	
-#if 0
-	int rlen;
-	int stream_sync=0;
-#endif
-	
-	Rx_count = 0;
-	Tx_count = 0;
-
-	if (tdm_api.wp_tdm_cmd.hdlc) {
-                Tx_length = tx_size;
-	} else {
-		Tx_length = tdm_api.wp_tdm_cmd.usr_mtu_mru;
-	}
-	
-	printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i\n",
-			read_enable,write_enable,tx_cnt,tx_size,tx_delay);	
-
-	/* Initialize the Tx Data buffer */
-	memset(&Tx_data[0],0,MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t));
-
-	/* Cast the Tx data packet with the tx element
-	 * structure.  We must insert a 16 byte
-	 * driver header, which driver will remove 
-	 * before passing packet out the physical port */
-	api_tx_el = (wp_tdm_api_tx_element_t*)&Tx_data[0];
-	
-
-	/* Create a Tx packet based on user info, or
-	 * by deafult incrementing number starting from 0 */
-	for (i=0;i<Tx_length;i++){
-		if (tx_data == -1){
-			api_tx_el->data[i] = (unsigned char)i;
-		}else{
-#if 0
-			api_tx_el->data[i] = (unsigned char)tx_data+(i%4);
-#else
-			api_tx_el->data[i] = (unsigned char)tx_data;
-#endif
-		}
-	}
-
-    	sangoma_tdm_enable_rxhook_events(dev_fd, &tdm_api);
-
-	/* Main Rx Tx OOB routine */
-	for(;;) {	
-
-		/* Initialize all select() descriptors */
-		FD_ZERO(&ready);
-		FD_ZERO(&write);
-		FD_ZERO(&oob);
-		FD_SET(dev_fd,&oob);
-		FD_SET(dev_fd,&ready);
-
-		if (write_enable){
-		     FD_SET(dev_fd,&write);
-		}
-
-		/* Select will block, until:
-		 * 	1: OOB event, link level change
-		 * 	2: Rx data available
-		 * 	3: Interface able to Tx */
-		
-  		if(select(dev_fd + 1,&ready, &write, &oob, NULL)){
-
-			fflush(stdout);	
-		   	if (FD_ISSET(dev_fd,&oob)){
-		
-				/* An OOB event is pending, usually indicating
-				 * a link level change */
-				
-				err=sangoma_tdm_read_event(dev_fd,&tdm_api);
-
-				if(err < 0 ) {
-					printf("Failed to receive OOB %i , %i\n", Rx_count, err);
-					err = ioctl(dev_fd,SIOC_WANPIPE_SOCK_STATE,0);
-					printf("Sock state is %s\n",
-							(err == 0) ? "CONNECTED" : 
-							(err == 1) ? "DISCONNECTED" :
-							 "CONNECTING");
-					break;
-				}
-					
-				printf("GOT OOB EXCEPTION CMD Exiting\n");
-			}
-		  
-			
-          	if (FD_ISSET(dev_fd,&ready)){
-
-				/* An Rx packet is pending
-				 * 	1: Read the rx packet into the Rx_data
-				 * 	   buffer. Confirm len > 0
-				 *
-				 * 	2: Cast Rx_data to the api_rx_element.
-				 * 	   Thus, removing a 16 byte header
-				 * 	   attached by the driver.
-				 *
-				 * 	3. Check error_flag:
-				 * 		CRC,Abort..etc 
-				 */
-
-				memset(Rx_data, 0, sizeof(Rx_data));
-
-				err = sangoma_readmsg_tdm(dev_fd,
-							Rx_data, 
-							sizeof(wp_tdm_api_rx_hdr_t),
-							&Rx_data[sizeof(wp_tdm_api_rx_hdr_t)],
-							MAX_RX_DATA, 0);   
-
-
-				if (!read_enable){
-					goto bitstrm_skip_read;
-				}
-
-				/* err indicates bytes received */
-				if(err <= 0) {
-					printf("\nError receiving data\n");
-					break;
-				}
-
-				api_rx_el = (wp_tdm_api_rx_element_t*)&Rx_data[0];
-
-				/* Check the packet length */
-				Rx_lgth = err;
-				if(Rx_lgth<=0) {
-					printf("\nShort frame received (%d)\n",
-						Rx_lgth);
-					return;
-				}
-
-#if 0
-				if (api_rx_el->data[0] == tx_data && api_rx_el->data[1] == (tx_data+1)){
-					if (!stream_sync){
-						printf("GOT SYNC %x\n",api_rx_el->data[0]);
-					}
-					stream_sync=1;
-				}else{
-					if (stream_sync){
-						printf("OUT OF SYNC: %x\n",api_rx_el->data[0]);
-					}
-				}
-#endif					
-
-				++Rx_count;
-
-				if (verbose){
-#if 0
-					printf("Received %i Length = %i\n", 
-							Rx_count,Rx_lgth);
-
-					printf("Data: ");
-					for(i=0;i<Rx_lgth; i ++) {
-						printf("0x%02X ", api_rx_el->data[i]);
-					}
-					printf("\n");
-#endif
-				}else{
-					//putchar('R');
-				}
-
-
-#if 0
-				switch(api_rx_el->hdr.wp_api_event_type){
-				case WP_TDM_EVENT_DTMF:
-					printf("DTMV Event: %c (%s:%s)!\n",
-						api_rx_el->hdr.wp_api_event_dtmf_digit,
-						(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_ROUT)?"ROUT":"SOUT",
-						(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_PRESET)?"PRESET":"STOP");		
-					break;
-				case WP_TDM_EVENT_RXHOOK:
-					printf("RXHOOK Event: %s!\n",
-						(api_rx_el->hdr.wp_api_event_rxhook_state&WP_TDM_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
-					break;
-				case WP_TDM_EVENT_RING:
-					printf("RING Event: %s!\n",
-						(api_rx_el->hdr.wp_api_event_ring_state&WP_TDM_EVENT_RING_PRESENT)?"PRESENT":"STOP");
-					break;
-				}
-#endif
-
-				if (rx_cnt > 0  && Rx_count >= rx_cnt){
-					break;
-				}
-bitstrm_skip_read:
-;
-		   	}
-		
-		   	if (FD_ISSET(dev_fd,&write)){
-
-
-				err = sangoma_writemsg_tdm(dev_fd,
-						       Tx_data,16, 
-						       &Tx_data[16], Tx_length, 
-						       0);
-				if (err <= 0){
-					if (errno == EBUSY){
-						if (verbose){
-							printf("Sock busy try again!\n");
-						}
-						/* Socket busy try sending again !*/
-					}else{
-						printf("Faild to send %i \n",errno);
-						perror("Send: ");
-						break;
-					}
-				}else{
-
-					++Tx_count;
-					
-					if (verbose){
-						//printf("Packet sent: Sent %i : %i\n",
-						//	err,Tx_count);
-					}else{
-						//putchar('T');
-					}
-				}
-		   	}
-
-			if (tx_delay){
-				usleep(tx_delay);
-			}
-
-			if (tx_cnt && tx_size && Tx_count >= tx_cnt && !(files_used & TX_FILE_USED)){
-			
-				write_enable=0;
-				if (rx_cnt > 0){
-					/* Dont break let rx finish */
-				}else{
-					break;
-				}
-			}
-		}
-	}
-
-    	sangoma_tdm_disable_rxhook_events(dev_fd, &tdm_api);
-	if (tx_fd){
-		fclose(tx_fd);
-	}
-	if (rx_fd){
-		fclose(rx_fd);
-	}
-	close (dev_fd);
-	return;
-
-} 
-
-int rxhook_event (int fd, unsigned char state)
-{
-	printf("%d: RXHOOK Event: %s!\n",
-		fd, (state & WAN_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
-	return 0;
-}
-
-/***************************************************************
- * Main:
- *
- *    o Make a socket connection to the driver.
- *    o Call handle_span_chan() to read the socket 
- *
- **************************************************************/
-
-
-int main(int argc, char* argv[])
-{
-	int proceed;
-
-	proceed=init_args(argc,argv);
-	if (proceed != WAN_TRUE){
-		usage(argv[0]);
-		return -1;
-	}
-
-	signal(SIGINT,&sig_end);
-	memset(&tdm_api,0,sizeof(tdm_api));
-	tdm_api.wp_tdm_event.wp_rxhook_event = &rxhook_event;
-	
-	printf("TDM RXHOOK PTR = %p\n",tdm_api.wp_tdm_event.wp_rxhook_event);
-	
-	dev_fd =-1;
-	  
-	dev_fd = sangoma_open_tdmapi_span_chan(atoi(card_name),atoi(if_name));
-	if( dev_fd < 0){
-		printf("Failed to open span chan (%s:%s:%d:%d)\n",
-					card_name, if_name,
-					atoi(card_name),atoi(if_name));
-		exit (1);
-	}
-	printf("HANDLING SPAN %i CHAN %i FD=%i\n",
-		atoi(card_name),atoi(if_name),dev_fd);
-		
-	sangoma_tdm_set_codec(dev_fd,&tdm_api,WP_NONE);
-	sangoma_get_full_cfg(dev_fd, &tdm_api);
-		
-	handle_span_chan();
-	close(dev_fd);
-	return 0;
-
-	return 0;
-};
-
-
-void sig_end(int sigid)
-{
-
-	printf("Got Signal %i\n",sigid);
-	
-	sangoma_tdm_disable_rxhook_events(dev_fd, &tdm_api);
-
-	if (tx_fd){
-		fclose(tx_fd);
-	}
-	if (rx_fd){
-		fclose(rx_fd);
-	}
-
-	if (dev_fd){
-		close (dev_fd);
-	}
-    	
-
-	exit(1);
-}
-
-
-
+/*****************************************************************************
+* aft_api.c	AFT T1/E1: HDLC API Sample Code
+*
+* Author(s):	Nenad Corbic <ncorbic at sangoma.com>
+*
+* Copyright:	(c) 2003-2004 Sangoma Technologies 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 of the License, or (at your option) any later version.
+* ============================================================================
+*/
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <linux/if_wanpipe.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <linux/if.h>
+#include <linux/wanpipe_defines.h>
+#include <linux/wanpipe_cfg.h>
+#include <linux/wanpipe.h>
+#include <libsangoma.h>
+#include "lib_api.h"
+
+#define MAX_TX_DATA     5000	/* Size of tx data */  
+#define MAX_FRAMES 	5000     /* Number of frames to transmit */  
+
+#define MAX_RX_DATA	5000
+
+unsigned short Rx_lgth;
+
+unsigned char Rx_data[MAX_RX_DATA];
+unsigned char Tx_data[MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t)];
+
+/* Prototypes */
+int MakeConnection(void);
+void handle_span_chan( void);
+void sig_end(int sigid);
+
+int dev_fd;
+FILE *tx_fd=NULL,*rx_fd=NULL;	
+wanpipe_tdm_api_t tdm_api; 
+
+
+/***************************************************
+* HANDLE SOCKET 
+*
+*   o Read a socket 
+*   o Cast data received to api_rx_element_t data type 
+*   o The received packet contains 16 bytes header 
+*
+*	------------------------------------------
+*      |  16 bytes      |        X bytes        ...
+*	------------------------------------------
+* 	   Header              Data
+*
+* o Data structures:
+* ------------------
+* typedef struct {
+* 	union {
+* 		struct {
+* 			unsigned char	_event_type;
+* 			unsigned char	_rbs_rx_bits;
+* 			unsigned int	_time_stamp;
+* 		}wp_event;
+* 		struct {
+* 			unsigned char	_rbs_rx_bits;
+* 			unsigned int	_time_stamp;
+* 		}wp_rx;
+* 		unsigned char	reserved[16];
+* 	}wp_rx_hdr_u;
+* #define wp_api_event_type		wp_rx_hdr_u.wp_event._event_type
+* #define wp_api_event_rbs_rx_bits 	wp_rx_hdr_u.wp_event._rbs_rx_bits
+* #define wp_api_event_time_stamp 	wp_rx_hdr_u.wp_event._time_stamp
+* } wp_tdm_api_rx_hdr_t;
+* 
+* typedef struct {
+*         wp_tdm_api_rx_hdr_t	hdr;
+*         unsigned char  		data[1];
+* } wp_tdm_api_rx_element_t;
+* 
+* typedef struct {
+* 	union {
+* 		struct {
+* 			unsigned char	_rbs_rx_bits;
+* 			unsigned int	_time_stamp;
+* 		}wp_tx;
+* 		unsigned char	reserved[16];
+* 	}wp_tx_hdr_u;
+* #define wp_api_time_stamp 	wp_tx_hdr_u.wp_tx._time_stamp
+* } wp_tdm_api_tx_hdr_t;
+* 
+* typedef struct {
+*         wp_tdm_api_tx_hdr_t	hdr;
+*         unsigned char  		data[1];
+* } wp_tdm_api_tx_element_t;
+*                     
+* #define WPTDM_A_BIT 0x08
+* #define WPTDM_B_BIT 0x04
+* #define WPTDM_C_BIT 0x02
+* #define WPTDM_D_BIT 0x01
+*
+*/
+
+void handle_span_chan(void) 
+{
+	unsigned int Rx_count,Tx_count,Tx_length;
+	wp_tdm_api_rx_element_t* api_rx_el;
+	wp_tdm_api_tx_element_t * api_tx_el;
+	fd_set 	ready,write,oob;
+	int err,i;
+	
+#if 0
+	int rlen;
+	int stream_sync=0;
+#endif
+	
+	Rx_count = 0;
+	Tx_count = 0;
+
+	if (tdm_api.wp_tdm_cmd.hdlc) {
+                Tx_length = tx_size;
+	} else {
+		Tx_length = tdm_api.wp_tdm_cmd.usr_mtu_mru;
+	}
+	
+	printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i\n",
+			read_enable,write_enable,tx_cnt,tx_size,tx_delay);	
+
+	/* Initialize the Tx Data buffer */
+	memset(&Tx_data[0],0,MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t));
+
+	/* Cast the Tx data packet with the tx element
+	 * structure.  We must insert a 16 byte
+	 * driver header, which driver will remove 
+	 * before passing packet out the physical port */
+	api_tx_el = (wp_tdm_api_tx_element_t*)&Tx_data[0];
+	
+
+	/* Create a Tx packet based on user info, or
+	 * by deafult incrementing number starting from 0 */
+	for (i=0;i<Tx_length;i++){
+		if (tx_data == -1){
+			api_tx_el->data[i] = (unsigned char)i;
+		}else{
+#if 0
+			api_tx_el->data[i] = (unsigned char)tx_data+(i%4);
+#else
+			api_tx_el->data[i] = (unsigned char)tx_data;
+#endif
+		}
+	}
+
+    	sangoma_tdm_enable_rxhook_events(dev_fd, &tdm_api);
+
+	/* Main Rx Tx OOB routine */
+	for(;;) {	
+
+		/* Initialize all select() descriptors */
+		FD_ZERO(&ready);
+		FD_ZERO(&write);
+		FD_ZERO(&oob);
+		FD_SET(dev_fd,&oob);
+		FD_SET(dev_fd,&ready);
+
+		if (write_enable){
+		     FD_SET(dev_fd,&write);
+		}
+
+		/* Select will block, until:
+		 * 	1: OOB event, link level change
+		 * 	2: Rx data available
+		 * 	3: Interface able to Tx */
+		
+  		if(select(dev_fd + 1,&ready, &write, &oob, NULL)){
+
+			fflush(stdout);	
+		   	if (FD_ISSET(dev_fd,&oob)){
+		
+				/* An OOB event is pending, usually indicating
+				 * a link level change */
+				
+				err=sangoma_tdm_read_event(dev_fd,&tdm_api);
+
+				if(err < 0 ) {
+					printf("Failed to receive OOB %i , %i\n", Rx_count, err);
+					err = ioctl(dev_fd,SIOC_WANPIPE_SOCK_STATE,0);
+					printf("Sock state is %s\n",
+							(err == 0) ? "CONNECTED" : 
+							(err == 1) ? "DISCONNECTED" :
+							 "CONNECTING");
+					break;
+				}
+					
+				printf("GOT OOB EXCEPTION CMD Exiting\n");
+			}
+		  
+			
+          	if (FD_ISSET(dev_fd,&ready)){
+
+				/* An Rx packet is pending
+				 * 	1: Read the rx packet into the Rx_data
+				 * 	   buffer. Confirm len > 0
+				 *
+				 * 	2: Cast Rx_data to the api_rx_element.
+				 * 	   Thus, removing a 16 byte header
+				 * 	   attached by the driver.
+				 *
+				 * 	3. Check error_flag:
+				 * 		CRC,Abort..etc 
+				 */
+
+				memset(Rx_data, 0, sizeof(Rx_data));
+
+				err = sangoma_readmsg_tdm(dev_fd,
+							Rx_data, 
+							sizeof(wp_tdm_api_rx_hdr_t),
+							&Rx_data[sizeof(wp_tdm_api_rx_hdr_t)],
+							MAX_RX_DATA, 0);   
+
+
+				if (!read_enable){
+					goto bitstrm_skip_read;
+				}
+
+				/* err indicates bytes received */
+				if(err <= 0) {
+					printf("\nError receiving data\n");
+					break;
+				}
+
+				api_rx_el = (wp_tdm_api_rx_element_t*)&Rx_data[0];
+
+				/* Check the packet length */
+				Rx_lgth = err;
+				if(Rx_lgth<=0) {
+					printf("\nShort frame received (%d)\n",
+						Rx_lgth);
+					return;
+				}
+
+#if 0
+				if (api_rx_el->data[0] == tx_data && api_rx_el->data[1] == (tx_data+1)){
+					if (!stream_sync){
+						printf("GOT SYNC %x\n",api_rx_el->data[0]);
+					}
+					stream_sync=1;
+				}else{
+					if (stream_sync){
+						printf("OUT OF SYNC: %x\n",api_rx_el->data[0]);
+					}
+				}
+#endif					
+
+				++Rx_count;
+
+				if (verbose){
+#if 0
+					printf("Received %i Length = %i\n", 
+							Rx_count,Rx_lgth);
+
+					printf("Data: ");
+					for(i=0;i<Rx_lgth; i ++) {
+						printf("0x%02X ", api_rx_el->data[i]);
+					}
+					printf("\n");
+#endif
+				}else{
+					//putchar('R');
+				}
+
+
+#if 0
+				switch(api_rx_el->hdr.wp_api_event_type){
+				case WP_TDM_EVENT_DTMF:
+					printf("DTMV Event: %c (%s:%s)!\n",
+						api_rx_el->hdr.wp_api_event_dtmf_digit,
+						(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_ROUT)?"ROUT":"SOUT",
+						(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_PRESET)?"PRESET":"STOP");		
+					break;
+				case WP_TDM_EVENT_RXHOOK:
+					printf("RXHOOK Event: %s!\n",
+						(api_rx_el->hdr.wp_api_event_rxhook_state&WP_TDM_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
+					break;
+				case WP_TDM_EVENT_RING:
+					printf("RING Event: %s!\n",
+						(api_rx_el->hdr.wp_api_event_ring_state&WP_TDM_EVENT_RING_PRESENT)?"PRESENT":"STOP");
+					break;
+				}
+#endif
+
+				if (rx_cnt > 0  && Rx_count >= rx_cnt){
+					break;
+				}
+bitstrm_skip_read:
+;
+		   	}
+		
+		   	if (FD_ISSET(dev_fd,&write)){
+
+
+				err = sangoma_writemsg_tdm(dev_fd,
+						       Tx_data,16, 
+						       &Tx_data[16], Tx_length, 
+						       0);
+				if (err <= 0){
+					if (errno == EBUSY){
+						if (verbose){
+							printf("Sock busy try again!\n");
+						}
+						/* Socket busy try sending again !*/
+					}else{
+						printf("Faild to send %i \n",errno);
+						perror("Send: ");
+						break;
+					}
+				}else{
+
+					++Tx_count;
+					
+					if (verbose){
+						//printf("Packet sent: Sent %i : %i\n",
+						//	err,Tx_count);
+					}else{
+						//putchar('T');
+					}
+				}
+		   	}
+
+			if (tx_delay){
+				usleep(tx_delay);
+			}
+
+			if (tx_cnt && tx_size && Tx_count >= tx_cnt && !(files_used & TX_FILE_USED)){
+			
+				write_enable=0;
+				if (rx_cnt > 0){
+					/* Dont break let rx finish */
+				}else{
+					break;
+				}
+			}
+		}
+	}
+
+    	sangoma_tdm_disable_rxhook_events(dev_fd, &tdm_api);
+	if (tx_fd){
+		fclose(tx_fd);
+	}
+	if (rx_fd){
+		fclose(rx_fd);
+	}
+	close (dev_fd);
+	return;
+
+} 
+
+int rxhook_event (int fd, unsigned char state)
+{
+	printf("%d: RXHOOK Event: %s!\n",
+		fd, (state & WAN_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
+	return 0;
+}
+
+/***************************************************************
+ * Main:
+ *
+ *    o Make a socket connection to the driver.
+ *    o Call handle_span_chan() to read the socket 
+ *
+ **************************************************************/
+
+
+int main(int argc, char* argv[])
+{
+	int proceed;
+
+	proceed=init_args(argc,argv);
+	if (proceed != WAN_TRUE){
+		usage(argv[0]);
+		return -1;
+	}
+
+	signal(SIGINT,&sig_end);
+	memset(&tdm_api,0,sizeof(tdm_api));
+	tdm_api.wp_tdm_event.wp_rxhook_event = &rxhook_event;
+	
+	printf("TDM RXHOOK PTR = %p\n",tdm_api.wp_tdm_event.wp_rxhook_event);
+	
+	dev_fd =-1;
+	  
+	dev_fd = sangoma_open_tdmapi_span_chan(atoi(card_name),atoi(if_name));
+	if( dev_fd < 0){
+		printf("Failed to open span chan (%s:%s:%d:%d)\n",
+					card_name, if_name,
+					atoi(card_name),atoi(if_name));
+		exit (1);
+	}
+	printf("HANDLING SPAN %i CHAN %i FD=%i\n",
+		atoi(card_name),atoi(if_name),dev_fd);
+		
+	sangoma_tdm_set_codec(dev_fd,&tdm_api,WP_NONE);
+	sangoma_get_full_cfg(dev_fd, &tdm_api);
+		
+	handle_span_chan();
+	close(dev_fd);
+	return 0;
+
+	return 0;
+};
+
+
+void sig_end(int sigid)
+{
+
+	printf("Got Signal %i\n",sigid);
+	
+	sangoma_tdm_disable_rxhook_events(dev_fd, &tdm_api);
+
+	if (tx_fd){
+		fclose(tx_fd);
+	}
+	if (rx_fd){
+		fclose(rx_fd);
+	}
+
+	if (dev_fd){
+		close (dev_fd);
+	}
+    	
+
+	exit(1);
+}
+
+
+

Modified: freeswitch/trunk/src/mod/languages/mod_perl/perlibs.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/perlibs.h	(original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/perlibs.h	Fri Sep 21 14:49:14 2007
@@ -1 +1 @@
-#define PERL_LIB "C:\\perl\\lib\\CORE\\perl58.lib"
+#define PERL_LIB "C:\\perl\\lib\\CORE\\perl58.lib"

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.vcproj
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.vcproj	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.vcproj	Fri Sep 21 14:49:14 2007
@@ -1,205 +1,205 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="mod_spidermonkey_socket"
-	ProjectGUID="{028C7278-05D7-4E18-82FE-BE231B844F41}"
-	RootNamespace="mod_spidermonkey_socket"
-	Keyword="Win32Proj"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
-			CharacterSet="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\js\src&quot;;&quot;$(InputDir)..\..\..\..\libs\js\nsprpub\pr\include&quot;;&quot;$(InputDir)..\mod_spidermonkey&quot;"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;XP_WIN;DEBUG;_X86_=1;JSFILE;EXPORT_JS_API;HAVE_CURL;CURL_STATICLIB;JS_THREADSAFE"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				WarningLevel="4"
-				WarnAsError="true"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkLibraryDependencies="true"
-				AdditionalOptions="&quot;..\..\..\..\libs\win32\js\debug\js32.lib&quot; &quot;..\..\..\..\libs\win32\apr\debug\libapr-1.lib&quot; &quot;..\..\..\..\w32\library\debug\freeswitchcore.lib&quot; &quot;..\..\..\..\libs\win32\debug\libetpan.lib&quot; &quot;..\mod_spidermonkey\debug\mod_spidermonkey.lib&quot;"
-				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;..\..\..\..\libs\nspr-4.6.1.winnt5.$(OutDir)\nspr-4.6.1\lib&quot;"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				ImportLibrary="$(OutDir)/mod_spidermonkey_socket.lib"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="2"
-			CharacterSet="1"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_SPIDERMONKEY_SOCKET_EXPORTS"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-			>
-			<File
-				RelativePath=".\mod_spidermonkey_socket.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-			>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="mod_spidermonkey_socket"
+	ProjectGUID="{028C7278-05D7-4E18-82FE-BE231B844F41}"
+	RootNamespace="mod_spidermonkey_socket"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\js\src&quot;;&quot;$(InputDir)..\..\..\..\libs\js\nsprpub\pr\include&quot;;&quot;$(InputDir)..\mod_spidermonkey&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;XP_WIN;DEBUG;_X86_=1;JSFILE;EXPORT_JS_API;HAVE_CURL;CURL_STATICLIB;JS_THREADSAFE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkLibraryDependencies="true"
+				AdditionalOptions="&quot;..\..\..\..\libs\win32\js\debug\js32.lib&quot; &quot;..\..\..\..\libs\win32\apr\debug\libapr-1.lib&quot; &quot;..\..\..\..\w32\library\debug\freeswitchcore.lib&quot; &quot;..\..\..\..\libs\win32\debug\libetpan.lib&quot; &quot;..\mod_spidermonkey\debug\mod_spidermonkey.lib&quot;"
+				OutputFile="$(SolutionDir)$(OutDir)/mod/$(InputName).dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\libs\nspr-4.6.1.winnt5.$(OutDir)\nspr-4.6.1\lib&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/mod_spidermonkey_socket.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_SPIDERMONKEY_SOCKET_EXPORTS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\mod_spidermonkey_socket.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Fri Sep 21 14:49:14 2007
@@ -355,9 +355,9 @@
 #ifdef WIN32
 	SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
 #else
-	if(nice(-10)!= -10) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not set nice level\n");
-	}
+	if(nice(-10)!= -10) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not set nice level\n");
+	}
 #endif
 
 #define USE_MLOCKALL

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Sep 21 14:49:14 2007
@@ -893,17 +893,17 @@
 
 
 		switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL);
-
-		/* If HANGUP_AFTER_BRIDGE is set to 'true', SWITCH_SIGNAL_BRIDGE_VARIABLE 
-		 * will not have a value, so we need to check SWITCH_BRIDGE_VARIABLE */
-
-		uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE);
-		
-		if(!uuid) {
-			uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
-		}
-
-		if (uuid && (other_session = switch_core_session_locate(uuid))) {
+
+		/* If HANGUP_AFTER_BRIDGE is set to 'true', SWITCH_SIGNAL_BRIDGE_VARIABLE 
+		 * will not have a value, so we need to check SWITCH_BRIDGE_VARIABLE */
+
+		uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE);
+		
+		if(!uuid) {
+			uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
+		}
+
+		if (uuid && (other_session = switch_core_session_locate(uuid))) {
 			switch_channel_set_variable(other_channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL);
 			switch_core_session_rwunlock(other_session);
 		}
@@ -918,9 +918,9 @@
 
 			switch_channel_set_variable(channel, SWITCH_BRIDGE_VARIABLE, NULL);
 			switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
-
-			/* If we are transferring the CALLER out of the bridge, we do not want to hang up on them */
-			switch_channel_set_variable(channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "false");
+
+			/* If we are transferring the CALLER out of the bridge, we do not want to hang up on them */
+			switch_channel_set_variable(channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "false");
 
 			switch_channel_hangup(other_channel, SWITCH_CAUSE_BLIND_TRANSFER);
 			switch_ivr_media(uuid, SMF_NONE);



More information about the Freeswitch-svn mailing list