## 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.116 2008/12/12 13:18:21 steveu Exp $
+## $Id: Makefile.am,v 1.118 2009/01/30 05:35:18 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
libspandsp.dsp \
libspandsp.sln \
libspandsp.vcproj \
+ msvc/config.h \
msvc/gettimeofday.c \
msvc/inttypes.h \
msvc/tgmath.h \
msvc/msvcproj.foot \
msvc/vc8proj.head \
msvc/vc8proj.foot \
- msvc/config.h \
spandsp/private/README
INCLUDES = -I$(top_builddir)
* 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.34 2009/01/29 01:41:05 steveu Exp $
+ * $Id: bell_r2_mf.c,v 1.35 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
if ((len = strlen(digits)) == 0)
return 0;
}
- if ((space = queue_free_space(&s->queue.queue)) < len)
+ if ((space = queue_free_space(&s->queue.queue)) < (size_t) len)
return len - space;
if (queue_write(&s->queue.queue, (const uint8_t *) digits, len) >= 0)
return 0;
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: dtmf.c,v 1.47 2009/01/28 03:41:26 steveu Exp $
+ * $Id: dtmf.c,v 1.48 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file dtmf.h */
if ((len = strlen(digits)) == 0)
return 0;
}
- if ((space = queue_free_space(&s->queue.queue)) < len)
+ if ((space = queue_free_space(&s->queue.queue)) < (size_t) len)
return len - space;
if (queue_write(&s->queue.queue, (const uint8_t *) digits, len) >= 0)
return 0;
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fsk.c,v 1.49 2009/01/28 03:41:26 steveu Exp $
+ * $Id: fsk.c,v 1.50 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
}
/*- End of function --------------------------------------------------------*/
-int fsk_tx(fsk_tx_state_t *s, int16_t *amp, int len)
+int fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len)
{
int sample;
int bit;
* Computer Science, Speech Group
* Chengxiang Lu and Alex Hauptmann
*
- * $Id: g722.c,v 1.5 2009/01/28 03:41:26 steveu Exp $
+ * $Id: g722.c,v 1.6 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
wd32 = ((p ^ s->p[0]) & 0x8000) ? wd1 : -wd1;
if (wd32 > 32767)
wd32 = 32767;
- wd3 = (((p ^ s->p[1]) & 0x8000) ? -128 : 128)
- + (wd32 >> 7)
- + (((int32_t) s->a[1]*(int32_t) 32512) >> 15);
+ wd3 = (int16_t) ((((p ^ s->p[1]) & 0x8000) ? -128 : 128)
+ + (wd32 >> 7)
+ + (((int32_t) s->a[1]*(int32_t) 32512) >> 15));
if (abs(wd3) > 12288)
wd3 = (wd3 < 0) ? -12288 : 12288;
ap[1] = wd3;
/* Block 2L, INVQAL */
wd2 = qm4[wd1];
- dlow = ((int32_t) s->band[0].det*(int32_t) wd2) >> 15;
+ dlow = (int16_t) (((int32_t) s->band[0].det*(int32_t) wd2) >> 15);
/* Block 3L, LOGSCL */
wd2 = rl42[wd1];
wd1 = 0;
else if (wd1 > 18432)
wd1 = 18432;
- s->band[0].nb = wd1;
+ s->band[0].nb = (int16_t) wd1;
/* Block 3L, SCALEL */
wd1 = (s->band[0].nb >> 6) & 31;
wd2 = 8 - (s->band[0].nb >> 11);
wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2);
- s->band[0].det = wd3 << 2;
+ s->band[0].det = (int16_t) (wd3 << 2);
block4(&s->band[0], dlow);
{
/* Block 2H, INVQAH */
wd2 = qm2[ihigh];
- dhigh = ((int32_t) s->band[1].det*(int32_t) wd2) >> 15;
+ dhigh = (int16_t) (((int32_t) s->band[1].det*(int32_t) wd2) >> 15);
/* Block 5H, RECONS */
/* Block 6H, LIMIT */
rhigh = saturate15(dhigh + s->band[1].s);
wd1 = 0;
else if (wd1 > 22528)
wd1 = 22528;
- s->band[1].nb = wd1;
+ s->band[1].nb = (int16_t) wd1;
/* Block 3H, SCALEH */
wd1 = (s->band[1].nb >> 6) & 31;
wd2 = 10 - (s->band[1].nb >> 11);
wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2);
- s->band[1].det = wd3 << 2;
+ s->band[1].det = (int16_t) (wd3 << 2);
block4(&s->band[1], dhigh);
}
else
{
/* Apply the QMF to build the final signal */
- s->x[s->ptr] = rlow + rhigh;
- s->y[s->ptr] = rlow - rhigh;
+ s->x[s->ptr] = (int16_t) (rlow + rhigh);
+ s->y[s->ptr] = (int16_t) (rlow - rhigh);
if (++s->ptr >= 12)
s->ptr = 0;
amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr) >> 12);
s->ptr = 0;
sumodd = vec_circular_dot_prodi16(s->x, qmf_coeffs_fwd, 12, s->ptr);
sumeven = vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr);
- xlow = (sumeven + sumodd) >> 13;
- xhigh = (sumeven - sumodd) >> 13;
+ xlow = (int16_t) ((sumeven + sumodd) >> 13);
+ xhigh = (int16_t) ((sumeven - sumodd) >> 13);
}
}
/* Block 1L, SUBTRA */
/* Block 2L, INVQAL */
ril = ilow >> 2;
wd2 = qm4[ril];
- dlow = ((int32_t) s->band[0].det*(int32_t) wd2) >> 15;
+ dlow = (int16_t) (((int32_t) s->band[0].det*(int32_t) wd2) >> 15);
/* Block 3L, LOGSCL */
il4 = rl42[ril];
wd = ((int32_t) s->band[0].nb*(int32_t) 127) >> 7;
- s->band[0].nb = wd + wl[il4];
+ s->band[0].nb = (int16_t) (wd + wl[il4]);
if (s->band[0].nb < 0)
s->band[0].nb = 0;
else if (s->band[0].nb > 18432)
wd1 = (s->band[0].nb >> 6) & 31;
wd2 = 8 - (s->band[0].nb >> 11);
wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2);
- s->band[0].det = wd3 << 2;
+ s->band[0].det = (int16_t) (wd3 << 2);
block4(&s->band[0], dlow);
/* Block 2H, INVQAH */
wd2 = qm2[ihigh];
- dhigh = ((int32_t) s->band[1].det*(int32_t) wd2) >> 15;
+ dhigh = (int16_t) (((int32_t) s->band[1].det*(int32_t) wd2) >> 15);
/* Block 3H, LOGSCH */
ih2 = rh2[ihigh];
wd = ((int32_t) s->band[1].nb*(int32_t) 127) >> 7;
- s->band[1].nb = wd + wh[ih2];
+ s->band[1].nb = (int16_t) (wd + wh[ih2]);
if (s->band[1].nb < 0)
s->band[1].nb = 0;
else if (s->band[1].nb > 22528)
wd1 = (s->band[1].nb >> 6) & 31;
wd2 = 10 - (s->band[1].nb >> 11);
wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2);
- s->band[1].det = wd3 << 2;
+ s->band[1].det = (int16_t) (wd3 << 2);
block4(&s->band[1], dhigh);
code = ((ihigh << 6) | ilow) >> (8 - s->bits_per_sample);
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: hdlc.c,v 1.64 2009/01/05 13:48:31 steveu Exp $
+ * $Id: hdlc.c,v 1.66 2009/01/30 07:19:25 steveu Exp $
*/
/*! \file */
int hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len)
{
- int i;
+ size_t i;
int x;
for (i = 0; i < max_len; i++)
{
if ((x = hdlc_tx_get_byte(s)) == SIG_STATUS_END_OF_DATA)
return i;
- buf[i] = x;
+ buf[i] = (uint8_t) x;
}
- return i;
+ return (int) i;
}
/*- End of function --------------------------------------------------------*/
# End Source File\r
# Begin Source File\r
\r
-SOURCE=.\msvc/gettimeofday.c\r
+SOURCE=.\.\msvc\gettimeofday.c\r
# End Source File\r
# End Group\r
# Begin Group "Header Files"\r
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: modem_connect_tones.c,v 1.31 2009/01/28 03:41:27 steveu Exp $
+ * $Id: modem_connect_tones.c,v 1.32 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
int16_t amp[],
int len)
{
- int mod;
+ int16_t mod;
int i;
int xlen;
}
for ( ; i < len; i++)
{
- mod = s->level + dds_mod(&s->mod_phase, s->mod_phase_rate, s->mod_level, 0);
+ mod = (int16_t) (s->level + dds_mod(&s->mod_phase, s->mod_phase_rate, s->mod_level, 0));
amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, mod, 0);
}
s->duration_timer -= len;
s->hop_timer = ms_to_samples(450);
s->tone_phase += 0x80000000;
}
- mod = s->level + dds_mod(&s->mod_phase, s->mod_phase_rate, s->mod_level, 0);
+ mod = (int16_t) (s->level + dds_mod(&s->mod_phase, s->mod_phase_rate, s->mod_level, 0));
amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, mod, 0);
}
s->duration_timer -= len;
*
* This file is released in the public domain.
*
+ * $Id: config.h,v 1.1 2009/01/29 18:30:14 steveu Exp $
*/
-#if !defined(_SPANDSP_CONFIG_H_)
-#define _SPANDSP_CONFIG_H_
+#if !defined(_MSVC_CONFIG_H_)
+#define _MSVC_CONFIG_H_
#define HAVE_SINF
#define HAVE_COSF
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: sig_tone.c,v 1.28 2009/01/28 03:41:27 steveu Exp $
+ * $Id: sig_tone.c,v 1.29 2009/01/30 07:19:25 steveu Exp $
*/
/*! \file */
this isn't used in low tone detect mode, but we must keep notch_zl
rolling along. */
s->tone[j].notch_zl = ((s->tone[j].notch_zl*s->desc->notch_slugi) >> 15)
- + ((abs(notched_signal)*s->desc->notch_slugp) >> 15);
+ + ((abs((int) notched_signal)*s->desc->notch_slugp) >> 15);
/* Mow the grass to weed out the noise! */
mown_notch[j] = s->tone[0].notch_zl & s->desc->notch_threshold;
}
#endif
/* Leaky integrate the bandpassed data */
s->broad_zl = ((s->broad_zl*s->desc->broad_slugi) >> 15)
- + ((abs(bandpass_signal)*s->desc->broad_slugp) >> 15);
+ + ((abs((int) bandpass_signal)*s->desc->broad_slugp) >> 15);
/* For the broad band receiver we use a simple linear threshold! */
if (s->tone_present)
/* Modulus and leaky integrate the data */
s->broad_zl = ((s->broad_zl*s->desc->unfiltered_slugi) >> 15)
- + ((abs(amp[i])*s->desc->unfiltered_slugp) >> 15);
+ + ((abs((int) amp[i])*s->desc->unfiltered_slugp) >> 15);
/* Mow the grass to weed out the noise! */
mown_bandpass = s->broad_zl & s->desc->unfiltered_threshold;
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fsk.h,v 1.32 2008/10/13 13:14:00 steveu Exp $
+ * $Id: fsk.h,v 1.33 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
\param len The number of samples to be generated.
\return The number of samples actually generated.
*/
-int fsk_tx(fsk_tx_state_t *s, int16_t *amp, int len);
+int fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len);
/*! Get the current received signal power.
\param s The modem context.
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fsk.h,v 1.1 2008/10/13 13:14:01 steveu Exp $
+ * $Id: fsk.h,v 1.2 2009/01/29 18:30:14 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_FSK_H_)
void *status_user_data;
int32_t phase_rates[2];
- int scaling;
+ int16_t scaling;
int32_t current_phase_rate;
uint32_t phase_acc;
int baud_frac;
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: g726.h,v 1.2 2008/11/16 12:20:57 steveu Exp $
+ * $Id: g726.h,v 1.3 2009/01/29 18:30:14 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_G726_H_)
/*! The external coding, for tandem operation */
int ext_coding;
/*! The number of bits per sample */
- unsigned int bits_per_sample;
+ int bits_per_sample;
/*! One of the G.726_PACKING_xxx options */
int packing;
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: modem_connect_tones.h,v 1.1 2008/10/13 13:14:01 steveu Exp $
+ * $Id: modem_connect_tones.h,v 1.2 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
int32_t tone_phase_rate;
uint32_t tone_phase;
- int level;
+ int16_t level;
/*! \brief Countdown to the next phase hop */
int hop_timer;
/*! \brief Maximum duration timer */
int duration_timer;
uint32_t mod_phase;
int32_t mod_phase_rate;
- int mod_level;
+ int16_t mod_level;
};
/*!
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: sig_tone.h,v 1.1 2008/11/30 13:08:42 steveu Exp $
+ * $Id: sig_tone.h,v 1.2 2009/01/30 07:19:25 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_SIG_TONE_H_)
sig_tone_descriptor_t *desc;
/*! The scaling values for the high and low level tones */
- int32_t tone_scaling[2];
+ int16_t tone_scaling[2];
/*! The sample timer, used to switch between the high and low level tones. */
int high_low_timer;
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t30.h,v 1.2 2009/01/03 13:02:31 steveu Exp $
+ * $Id: t30.h,v 1.3 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
partial pages still to come. */
int ecm_at_page_end;
int next_tx_step;
- int next_rx_step;
+ /* The FCF for the next receive step */
+ uint8_t next_rx_step;
/*! \brief Image file name for image reception. */
char rx_file[256];
/*! \brief The last page we are prepared accept for a received image file. -1 means no restriction. */
int ecm_allowed;
/*! \brief the FCF2 field of the last PPS message we received. */
- int last_pps_fcf2;
+ uint8_t last_pps_fcf2;
/*! \brief The number of the first ECM frame which we do not currently received correctly. For
a partial page received correctly, this will be one greater than the number of frames it
contains. */
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20090129
-#define SPANDSP_RELEASE_TIME 014346
+#define SPANDSP_RELEASE_DATE 20090130
+#define SPANDSP_RELEASE_TIME 102456
#endif
/*- End of file ------------------------------------------------------------*/
* 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.279 2009/01/29 01:41:06 steveu Exp $
+ * $Id: t30.c,v 1.280 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
}
/*- End of function --------------------------------------------------------*/
-static int check_next_tx_step(t30_state_t *s)
+static uint8_t check_next_tx_step(t30_state_t *s)
{
int more;
static void process_state_f_doc_ecm(t30_state_t *s, const uint8_t *msg, int len)
{
- int fcf2;
+ uint8_t fcf2;
/* This actually handles 2 states - _DOC_ECM and _POST_DOC_ECM - as they are very similar */
switch (msg[2] & 0xFE)
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_gateway.c,v 1.151 2009/01/28 03:41:27 steveu Exp $
+ * $Id: t38_gateway.c,v 1.152 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
if (s->bit_no)
{
/* There is a fractional octet in progress. We might as well send every last bit we can. */
- s->data[s->data_ptr++] = s->bit_stream << (8 - s->bit_no);
+ s->data[s->data_ptr++] = (uint8_t) (s->bit_stream << (8 - s->bit_no));
}
t38_core_send_data(&t->t38x.t38, t->t38x.current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, s->data, s->data_ptr, t->t38x.t38.data_end_tx_count);
s->out_octets += s->data_ptr;
* 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.130 2009/01/29 01:41:06 steveu Exp $
+ * $Id: v17rx.c,v 1.131 2009/01/30 10:22:23 steveu Exp $
*/
/*! \file */
int i;
int step;
int16_t x;
- int32_t diff;
+ int16_t diff;
complexf_t z;
complexf_t zz;
complexf_t sample;
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 = (int32_t) x - s->last_sample;
+ /* There could be oveflow here, but it isn't a problem in practice */
+ diff = x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */
* 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.114 2009/01/29 01:41:06 steveu Exp $
+ * $Id: v27ter_rx.c,v 1.115 2009/01/30 10:22:23 steveu Exp $
*/
/*! \file */
int i;
int step;
int16_t x;
- int32_t diff;
+ int16_t diff;
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t z;
complexi16_t zz;
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 = (int32_t) x - s->last_sample;
+ /* There could be oveflow here, but it isn't a problem in practice */
+ diff = x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */
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;
+ /* There could be oveflow here, but it isn't a problem in practice */
diff = x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
* 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.151 2009/01/29 01:41:06 steveu Exp $
+ * $Id: v29rx.c,v 1.152 2009/01/30 10:22:23 steveu Exp $
*/
/*! \file */
int i;
int step;
int16_t x;
- int32_t diff;
+ int16_t diff;
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t z;
complexi16_t zz;
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 = (int32_t) x - s->last_sample;
+ /* There could be oveflow here, but it isn't a problem in practice */
+ diff = x - s->last_sample;
power = power_meter_update(&(s->power), diff);
#if defined(IAXMODEM_STUFF)
/* Quick power drop fudge */
## 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.108 2008/11/30 10:17:31 steveu Exp $
+## $Id: Makefile.am,v 1.109 2009/01/30 05:35:18 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
line_model_tests \
logging_tests \
lpc10_tests \
+ make_g168_css \
modem_connect_tones_tests \
modem_echo_tests \
- make_g168_css \
noise_tests \
oki_adpcm_tests \
playout_tests \