update to snapshot spandsp-20090129

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11548 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-01-29 04:00:33 +00:00
parent 88ecf6d17f
commit c3facf7d57
18 changed files with 65 additions and 44 deletions

View File

@ -23,7 +23,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: adsi.c,v 1.67 2009/01/28 03:41:26 steveu Exp $
* $Id: adsi.c,v 1.68 2009/01/29 01:41:05 steveu Exp $
*/
/*! \file */
@ -1045,7 +1045,7 @@ int adsi_add_field(adsi_tx_state_t *s, uint8_t *msg, int len, uint8_t field_type
if (field_type != CLIP_DTMF_HASH_UNSPECIFIED)
msg[len++] = field_type;
memcpy(msg + len, field_body, field_len);
msg[len + field_len] = x;
msg[len + field_len] = (uint8_t) x;
len += (field_len + 1);
}
break;

View File

@ -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: bell_r2_mf.c,v 1.33 2009/01/28 03:41:26 steveu Exp $
* $Id: bell_r2_mf.c,v 1.34 2009/01/29 01:41:05 steveu Exp $
*/
/*! \file */
@ -628,7 +628,7 @@ bell_mf_rx_state_t *bell_mf_rx_init(bell_mf_rx_state_t *s,
if (!initialised)
{
for (i = 0; i < 6; i++)
make_goertzel_descriptor(&bell_mf_detect_desc[i], bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&bell_mf_detect_desc[i], (float) bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK);
initialised = TRUE;
}
s->digits_callback = callback;
@ -805,8 +805,8 @@ r2_mf_rx_state_t *r2_mf_rx_init(r2_mf_rx_state_t *s,
{
for (i = 0; i < 6; i++)
{
make_goertzel_descriptor(&mf_fwd_detect_desc[i], r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&mf_back_detect_desc[i], r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&mf_fwd_detect_desc[i], (float) r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&mf_back_detect_desc[i], (float) r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
}
initialised = TRUE;
}

View File

@ -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: dds_int.c,v 1.13 2009/01/28 03:41:26 steveu Exp $
* $Id: dds_int.c,v 1.14 2009/01/29 01:41:05 steveu Exp $
*/
/*! \file */
@ -202,15 +202,15 @@ float dds_frequency(int32_t phase_rate)
}
/*- End of function --------------------------------------------------------*/
int dds_scaling_dbm0(float level)
int16_t dds_scaling_dbm0(float level)
{
return (int) (powf(10.0f, (level - DBM0_MAX_SINE_POWER)/20.0f)*32767.0f);
return (int16_t) (powf(10.0f, (level - DBM0_MAX_SINE_POWER)/20.0f)*32767.0f);
}
/*- End of function --------------------------------------------------------*/
int dds_scaling_dbov(float level)
int16_t dds_scaling_dbov(float level)
{
return (int) (powf(10.0f, (level - DBOV_MAX_SINE_POWER)/20.0f)*32767.0f);
return (int16_t) (powf(10.0f, (level - DBOV_MAX_SINE_POWER)/20.0f)*32767.0f);
}
/*- End of function --------------------------------------------------------*/

View File

@ -25,7 +25,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: floating_fudge.h,v 1.5 2008/08/03 03:44:00 steveu Exp $
* $Id: floating_fudge.h,v 1.6 2009/01/29 01:41:05 steveu Exp $
*/
#if !defined(_FLOATING_FUDGE_H_)
@ -354,6 +354,23 @@ static __inline__ float log10f(float x)
return i;
}
__inline float rintf(float flt)
{
_asm
{ fld flt
frndint
}
}
__inline double rint(double dbl)
{
__asm
{
fld dbl
frndint
}
}
__inline long int lfastrint(double x)
{
long int i;

View File

@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="src; src\spandsp; src\msvc;..\libtiff\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_MATH_H;HAVE_TGMATH_H"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -51,6 +51,7 @@
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CompileAs="1"
DisableSpecificWarnings="4127"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -119,12 +120,13 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="src; src\spandsp; src\msvc;..\libtiff\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_MATH_H;HAVE_TGMATH_H"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4127"
/>
<Tool
Name="VCManagedResourceCompilerTool"

View File

@ -42,7 +42,6 @@ echo_can_adaption_mode
echo_can_update
fax_rx
fax_tx
fax_set_flush_handler
fax_init
fax_release
fsk_tx_init
@ -119,7 +118,8 @@ queue_read
queue_write
queue_read_msg
queue_write_msg
sig_tone_init
sig_tone_rx_init
sig_tone_tx_init
sig_tone_rx
sig_tone_tx
super_tone_rx_make_descriptor

View File

@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="src; src\spandsp; src\msvc;..\libtiff\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_MATH_H;HAVE_TGMATH_H"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -51,6 +51,7 @@
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CompileAs="1"
DisableSpecificWarnings="4127"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -119,12 +120,13 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="src; src\spandsp; src\msvc;..\libtiff\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_MATH_H;HAVE_TGMATH_H"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4127"
/>
<Tool
Name="VCManagedResourceCompilerTool"

View File

@ -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: queue.c,v 1.25 2009/01/05 13:48:31 steveu Exp $
* $Id: queue.c,v 1.26 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -351,10 +351,10 @@ int queue_write_msg(queue_state_t *s, const uint8_t *buf, int len)
if ((real_len = optr - iptr - 1) < 0)
real_len += s->len;
/*endif*/
if (real_len < len + sizeof(uint16_t))
if (real_len < len + (int) sizeof(uint16_t))
return -1;
/*endif*/
real_len = len + sizeof(uint16_t);
real_len = len + (int) sizeof(uint16_t);
to_end = s->len - iptr;
lenx = (uint16_t) len;

View File

@ -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: dds.h,v 1.21 2008/09/11 15:13:42 steveu Exp $
* $Id: dds.h,v 1.22 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -51,13 +51,13 @@ float dds_frequency(int32_t phase_rate);
\param level The desired signal level, in dBm0.
\return The scaling factor.
*/
int dds_scaling_dbm0(float level);
int16_t dds_scaling_dbm0(float level);
/*! \brief Find the scaling factor needed to achieve a specified level in dBmov.
\param level The desired signal level, in dBmov.
\return The scaling factor.
*/
int dds_scaling_dbov(float level);
int16_t dds_scaling_dbov(float level);
/*! \brief Find the amplitude for a particular phase.
\param phase The desired phase 32 bit phase.

View File

@ -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: t38_core.h,v 1.33 2009/01/23 16:07:14 steveu Exp $
* $Id: t38_core.h,v 1.34 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -333,7 +333,7 @@ t38_core_state_t *t38_core_init(t38_core_state_t *s,
t38_rx_data_handler_t *rx_data_handler,
t38_rx_missing_handler_t *rx_missing_handler,
void *rx_user_data,
t38_tx_packet_handler_t tx_packet_handler,
t38_tx_packet_handler_t *tx_packet_handler,
void *tx_packet_user_data);
#if defined(__cplusplus)

View File

@ -30,8 +30,8 @@
/* The date and time of the version are in UTC form. */
#define SPANDSP_RELEASE_DATE 20090128
#define SPANDSP_RELEASE_TIME 034417
#define SPANDSP_RELEASE_DATE 20090129
#define SPANDSP_RELEASE_TIME 014346
#endif
/*- End of file ------------------------------------------------------------*/

View File

@ -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.278 2009/01/28 03:41:27 steveu Exp $
* $Id: t30.c,v 1.279 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -628,7 +628,7 @@ static int get_partial_ecm_page(t30_state_t *s)
s->ecm_at_page_end = TRUE;
return i;
}
s->ecm_len[i] = (int16_t) 4 + len;
s->ecm_len[i] = (int16_t) (4 + len);
}
/* We filled the entire buffer */
s->ecm_frames = 256;

View File

@ -25,7 +25,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: t31.c,v 1.136 2009/01/28 03:41:27 steveu Exp $
* $Id: t31.c,v 1.137 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -373,7 +373,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
t31_state_t *s;
t31_t38_front_end_state_t *fe;
#if defined(_MSC_VER)
uint8_t *buf2 = (uint8_t *) alloca(len);
uint8_t *buf2 = (uint8_t *) _alloca(len);
#else
uint8_t buf2[len];
#endif
@ -1444,7 +1444,7 @@ static void t31_v21_rx(t31_state_t *s)
s->hdlc_tx.len = 0;
s->dled = FALSE;
fsk_rx_init(&(s->audio.modems.v21_rx), &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &(s->audio.modems.hdlc_rx));
fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -39.09);
fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -39.09f);
s->at_state.transmit = TRUE;
}
/*- End of function --------------------------------------------------------*/
@ -2233,7 +2233,7 @@ static void t31_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_d
hdlc_rx_init(&s->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, user_data);
hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data);
fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
fsk_rx_signal_cutoff(&s->v21_rx, -39.09);
fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
v17_rx_init(&s->v17_rx, 14400, non_ecm_put_bit, user_data);
v17_tx_init(&s->v17_tx, 14400, s->use_tep, non_ecm_get_bit, user_data);

View File

@ -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: t38_terminal.c,v 1.119 2009/01/28 03:41:27 steveu Exp $
* $Id: t38_terminal.c,v 1.120 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -278,7 +278,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
t38_terminal_state_t *s;
t38_terminal_front_end_state_t *fe;
#if defined(_MSC_VER)
uint8_t *buf2 = (uint8_t *) alloca(len);
uint8_t *buf2 = (uint8_t *) _alloca(len);
#else
uint8_t buf2[len];
#endif

View File

@ -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: time_scale.c,v 1.27 2009/01/28 03:41:27 steveu Exp $
* $Id: time_scale.c,v 1.28 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -274,7 +274,7 @@ int time_scale(time_scale_state_t *s, int16_t out[], int16_t in[], int len)
int time_scale_max_output_len(time_scale_state_t *s, int input_len)
{
return input_len*s->playout_rate + s->min_pitch + 1;
return (int) (input_len*s->playout_rate + s->min_pitch + 1);
}
/*- End of function --------------------------------------------------------*/
/*- End of file ------------------------------------------------------------*/

View File

@ -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: v17rx.c,v 1.129 2009/01/28 03:41:27 steveu Exp $
* $Id: v17rx.c,v 1.130 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -984,7 +984,7 @@ int v17_rx(v17_rx_state_t *s, const int16_t amp[], int len)
We need to measure the power with the DC blocked, but not using
a slow to respond DC blocker. Use the most elementary HPF. */
x = amp[i] >> 1;
diff = x - s->last_sample;
diff = (int32_t) x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */

View File

@ -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: v27ter_rx.c,v 1.113 2009/01/28 03:41:27 steveu Exp $
* $Id: v27ter_rx.c,v 1.114 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -772,7 +772,7 @@ int v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len)
We need to measure the power with the DC blocked, but not using
a slow to respond DC blocker. Use the most elementary HPF. */
x = amp[i] >> 1;
diff = x - s->last_sample;
diff = (int32_t) x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */

View File

@ -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: v29rx.c,v 1.150 2009/01/28 03:41:27 steveu Exp $
* $Id: v29rx.c,v 1.151 2009/01/29 01:41:06 steveu Exp $
*/
/*! \file */
@ -858,7 +858,7 @@ int v29_rx(v29_rx_state_t *s, const int16_t amp[], int len)
We need to measure the power with the DC blocked, but not using
a slow to respond DC blocker. Use the most elementary HPF. */
x = amp[i] >> 1;
diff = x - s->last_sample;
diff = (int32_t) x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */