From: Michael Jerris Date: Thu, 26 Feb 2009 16:26:25 +0000 (+0000) Subject: update to snapshot spandsp-20090226 plus 2 typo fixes X-Git-Tag: v1.0.4~1812 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71893423d0a3b3ee8e940a2177ab5407b037b341;p=thirdparty%2Ffreeswitch.git update to snapshot spandsp-20090226 plus 2 typo fixes git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12294 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/libs/spandsp/src/Makefile.am b/libs/spandsp/src/Makefile.am index 250b21785f..dc3553031b 100644 --- a/libs/spandsp/src/Makefile.am +++ b/libs/spandsp/src/Makefile.am @@ -16,7 +16,7 @@ ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## -## $Id: Makefile.am,v 1.126 2009/02/21 05:39:08 steveu Exp $ +## $Id: Makefile.am,v 1.127 2009/02/25 15:30:21 steveu Exp $ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) diff --git a/libs/spandsp/src/msvc/config.h b/libs/spandsp/src/msvc/config.h index ff82b907a7..f1bdab324f 100644 --- a/libs/spandsp/src/msvc/config.h +++ b/libs/spandsp/src/msvc/config.h @@ -10,7 +10,7 @@ * * This file is released in the public domain. * - * $Id: config.h,v 1.3 2009/02/10 13:06:47 steveu Exp $ + * $Id: config.h,v 1.4 2009/02/25 15:30:21 steveu Exp $ */ #if !defined(_MSVC_CONFIG_H_) @@ -37,13 +37,10 @@ #define SPANDSP_USE_EXPORT_CAPABILITY 1 - #define PACKAGE "spandsp" #define VERSION "0.0.6" - - -// Win32/DevStudio compatibility stuff +/* Win32/DevStudio compatibility stuff */ #ifdef _MSC_VER @@ -83,5 +80,4 @@ #endif - #endif diff --git a/libs/spandsp/src/msvc/inttypes.h b/libs/spandsp/src/msvc/inttypes.h index a39d60948b..e119f328b6 100644 --- a/libs/spandsp/src/msvc/inttypes.h +++ b/libs/spandsp/src/msvc/inttypes.h @@ -19,7 +19,6 @@ extern "C" { #endif - typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; @@ -28,6 +27,7 @@ typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; + #define INT16_MAX 0x7fff #define INT16_MIN (-INT16_MAX - 1) diff --git a/libs/spandsp/src/msvc/spandsp.h b/libs/spandsp/src/msvc/spandsp.h index 8c2a57245c..0dddf14ffb 100644 --- a/libs/spandsp/src/msvc/spandsp.h +++ b/libs/spandsp/src/msvc/spandsp.h @@ -33,14 +33,13 @@ #define __inline__ __inline #pragma warning(disable:4200) - #undef SPANDSP_USE_FIXED_POINT #undef SPANDSP_MISALIGNED_ACCESS_FAILS #define SPANDSP_USE_EXPORT_CAPABILITY 1 #include -#include +#include #include #include #include diff --git a/libs/spandsp/src/msvc/sys/time.h b/libs/spandsp/src/msvc/sys/time.h index 5312d9f68c..864891bc28 100644 --- a/libs/spandsp/src/msvc/sys/time.h +++ b/libs/spandsp/src/msvc/sys/time.h @@ -12,9 +12,10 @@ * */ -struct timeval { - long tv_sec; - long tv_usec; -}; +struct timeval +{ + long int tv_sec; + long int tv_usec; +}; extern void gettimeofday(struct timeval *tv, void *tz); diff --git a/libs/spandsp/src/spandsp/bit_operations.h b/libs/spandsp/src/spandsp/bit_operations.h index 1db4b3b460..44da5ff871 100644 --- a/libs/spandsp/src/spandsp/bit_operations.h +++ b/libs/spandsp/src/spandsp/bit_operations.h @@ -22,7 +22,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: bit_operations.h,v 1.24 2009/01/31 08:48:11 steveu Exp $ + * $Id: bit_operations.h,v 1.25 2009/02/24 14:14:03 steveu Exp $ */ /*! \file */ @@ -56,13 +56,48 @@ static __inline__ int top_bit(unsigned int bits) : [res] "=&r" (res) : [bits] "r" (bits)); return 31 - res; -#elif defined(_M_IX86) // Visual Studio x86 +#elif defined(_M_IX86) + /* Visual Studio i386 */ __asm { xor eax, eax dec eax bsr eax, bits } +#elif defined(_M_X64) + /* Visual Studio x86_64 */ + /* TODO: Need the appropriate x86_64 code */ + int res; + + if (bits == 0) + return -1; + res = 0; + if (bits & 0xFFFF0000) + { + bits &= 0xFFFF0000; + res += 16; + } + if (bits & 0xFF00FF00) + { + bits &= 0xFF00FF00; + res += 8; + } + if (bits & 0xF0F0F0F0) + { + bits &= 0xF0F0F0F0; + res += 4; + } + if (bits & 0xCCCCCCCC) + { + bits &= 0xCCCCCCCC; + res += 2; + } + if (bits & 0xAAAAAAAA) + { + bits &= 0xAAAAAAAA; + res += 1; + } + return res; #else int res; diff --git a/libs/spandsp/src/spandsp/fast_convert.h b/libs/spandsp/src/spandsp/fast_convert.h index 2e794a2701..4c5f8583b0 100644 --- a/libs/spandsp/src/spandsp/fast_convert.h +++ b/libs/spandsp/src/spandsp/fast_convert.h @@ -22,7 +22,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: fast_convert.h,v 1.4 2009/02/21 05:39:09 steveu Exp $ + * $Id: fast_convert.h,v 1.5 2009/02/24 14:14:03 steveu Exp $ */ #if !defined(_SPANDSP_FAST_CONVERT_H_) @@ -231,7 +231,8 @@ extern "C" } #endif -#elif (defined(WIN32) || defined(_WIN32)) && !defined(_WIN64) +#elif defined(_M_IX86) + /* Visual Studio i386 */ /* * Win32 doesn't seem to have the lrint() and lrintf() functions. * Therefore implement inline versions of these functions here. @@ -301,28 +302,19 @@ extern "C" }; return i; } -#elif defined(WIN64) || defined(_WIN64) +#elif defined(_M_X64) + /* Visual Studio x86_64 */ /* x86_64 machines will do best with a simple assignment. */ #include __inline long int lrint(double x) { -#ifdef _M_X64 return (long int)_mm_cvtsd_si64x( _mm_loadu_pd ((const double*)&x) ); -#else -#warning "Not Supported: Replacing with a simple C cast." - return (long int) (x); -#endif } __inline long int lrintf(float x) { -#ifdef _M_X64 return _mm_cvt_ss2si( _mm_load_ss((const float*)&x) ); -#else -#warning "Not Supported: Replacing with a simple C cast." - return (long int) (x); -#endif } __inline long int lfastrint(double x) diff --git a/libs/spandsp/src/spandsp/telephony.h b/libs/spandsp/src/spandsp/telephony.h index 90f23615ec..ca22f62f7c 100644 --- a/libs/spandsp/src/spandsp/telephony.h +++ b/libs/spandsp/src/spandsp/telephony.h @@ -22,13 +22,13 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: telephony.h,v 1.16 2009/02/03 16:28:41 steveu Exp $ + * $Id: telephony.h,v 1.17 2009/02/25 15:30:21 steveu Exp $ */ #if !defined(_SPANDSP_TELEPHONY_H_) #define _SPANDSP_TELEPHONY_H_ -#if defined(WIN32) +#if defined(_M_IX86) || defined(_M_X64) #if defined(LIBSPANDSP_EXPORTS) #define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall #define SPAN_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl diff --git a/libs/spandsp/src/spandsp/version.h b/libs/spandsp/src/spandsp/version.h index 002a2964db..aa86853b43 100644 --- a/libs/spandsp/src/spandsp/version.h +++ b/libs/spandsp/src/spandsp/version.h @@ -30,8 +30,8 @@ /* The date and time of the version are in UTC form. */ -#define SPANDSP_RELEASE_DATE 20090221 -#define SPANDSP_RELEASE_TIME 054406 +#define SPANDSP_RELEASE_DATE 20090226 +#define SPANDSP_RELEASE_TIME 121601 #endif /*- End of file ------------------------------------------------------------*/ diff --git a/libs/spandsp/src/t30.c b/libs/spandsp/src/t30.c index 65b274ae0b..9974f26a70 100644 --- a/libs/spandsp/src/t30.c +++ b/libs/spandsp/src/t30.c @@ -22,7 +22,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: t30.c,v 1.286 2009/02/20 12:34:20 steveu Exp $ + * $Id: t30.c,v 1.288 2009/02/26 12:11:51 steveu Exp $ */ /*! \file */ @@ -5353,18 +5353,21 @@ SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, i The 2.55s maximum seems to limit signalling frames to no more than 95 octets, including FCS, and flag octets (assuming the use of V.21). */ - if (!ok && s->phase != T30_PHASE_C_ECM_RX) + if (!ok) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad CRC received\n"); - /* We either force a resend, or we wait until a resend occurs through a timeout. */ - if ((s->supported_t30_features & T30_SUPPORT_COMMAND_REPEAT)) + if (s->phase != T30_PHASE_C_ECM_RX) { - s->step = 0; - if (s->phase == T30_PHASE_B_RX) - queue_phase(s, T30_PHASE_B_TX); - else - queue_phase(s, T30_PHASE_D_TX); - send_simple_frame(s, T30_CRP); + /* We either force a resend, or we wait until a resend occurs through a timeout. */ + if ((s->supported_t30_features & T30_SUPPORT_COMMAND_REPEAT)) + { + s->step = 0; + if (s->phase == T30_PHASE_B_RX) + queue_phase(s, T30_PHASE_B_TX); + else + queue_phase(s, T30_PHASE_D_TX); + send_simple_frame(s, T30_CRP); + } } return; } diff --git a/libs/spandsp/test-data/etsi/fax/Makefile.am b/libs/spandsp/test-data/etsi/fax/Makefile.am index 0242f5590a..6d2152d8ff 100644 --- a/libs/spandsp/test-data/etsi/fax/Makefile.am +++ b/libs/spandsp/test-data/etsi/fax/Makefile.am @@ -16,7 +16,7 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## -## $Id: Makefile.am,v 1.3 2009/02/20 12:34:20 steveu Exp $ +## $Id: Makefile.am,v 1.4 2009/02/25 17:52:51 steveu Exp $ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) @@ -37,12 +37,16 @@ ETSI_TEST_PAGES = etsi_300_242_a4_diago1.tif \ EXTRA_DIST = +MAINTAINERCLEANFILES = Makefile.in + +LIBDIR = -L$(top_builddir)/src + nobase_data_DATA = ${ETSI_TEST_PAGES} noinst_PROGRAMS = generate_etsi_300_242_pages generate_etsi_300_242_pages_SOURCES = generate_etsi_300_242_pages.c -generate_etsi_300_242_pages_LDADD = -lspandsp -ltiff +generate_etsi_300_242_pages_LDADD = $(LIBDIR) -lspandsp -ltiff clean: rm -f *.tif *.g3 diff --git a/libs/spandsp/test-data/itu/fax/Makefile.am b/libs/spandsp/test-data/itu/fax/Makefile.am index 2ea7793e08..25b1ed24a9 100644 --- a/libs/spandsp/test-data/itu/fax/Makefile.am +++ b/libs/spandsp/test-data/itu/fax/Makefile.am @@ -16,7 +16,7 @@ ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## -## $Id: Makefile.am,v 1.4 2009/02/20 12:34:20 steveu Exp $ +## $Id: Makefile.am,v 1.5 2009/02/25 17:52:52 steveu Exp $ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) @@ -97,6 +97,8 @@ MIXED_SIZE_PAGES = R1200_1200_A4.tif \ EXTRA_DIST = ${ITU_TEST_PAGES_PBM} +MAINTAINERCLEANFILES = Makefile.in + nobase_data_DATA = itutests.tif \ ${ITU_TEST_PAGES} \ dithered.tif \