update to snapshot spandsp-20090130

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11563 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-01-30 17:00:50 +00:00
parent 8ba68ed14f
commit 60e498affd
23 changed files with 81 additions and 75 deletions

View File

@ -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.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)
@ -28,6 +28,7 @@ EXTRA_DIST = floating_fudge.h \
libspandsp.dsp \
libspandsp.sln \
libspandsp.vcproj \
msvc/config.h \
msvc/gettimeofday.c \
msvc/inttypes.h \
msvc/tgmath.h \
@ -38,7 +39,6 @@ EXTRA_DIST = floating_fudge.h \
msvc/msvcproj.foot \
msvc/vc8proj.head \
msvc/vc8proj.foot \
msvc/config.h \
spandsp/private/README
INCLUDES = -I$(top_builddir)

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.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 */
@ -312,7 +312,7 @@ size_t bell_mf_tx_put(bell_mf_tx_state_t *s, const char *digits, int len)
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;

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: 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 */
@ -485,7 +485,7 @@ size_t dtmf_tx_put(dtmf_tx_state_t *s, const char *digits, int len)
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;

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: 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 */
@ -149,7 +149,7 @@ fsk_tx_state_t *fsk_tx_init(fsk_tx_state_t *s,
}
/*- 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;

View File

@ -28,7 +28,7 @@
* 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 */
@ -204,9 +204,9 @@ static void block4(g722_band_t *s, int16_t dx)
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;
@ -351,7 +351,7 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
/* 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];
@ -361,13 +361,13 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
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);
@ -375,7 +375,7 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
{
/* 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);
@ -388,13 +388,13 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
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);
}
@ -413,8 +413,8 @@ int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[]
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);
@ -509,8 +509,8 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
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 */
@ -530,12 +530,12 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
/* 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)
@ -545,7 +545,7 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
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);
@ -567,12 +567,12 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
/* 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)
@ -582,7 +582,7 @@ int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[]
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);

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: 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 */
@ -527,16 +527,16 @@ int hdlc_tx_get_bit(hdlc_tx_state_t *s)
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 --------------------------------------------------------*/

View File

@ -397,7 +397,7 @@ SOURCE=.\vector_int.c
# End Source File
# Begin Source File
SOURCE=.\msvc/gettimeofday.c
SOURCE=.\.\msvc\gettimeofday.c
# End Source File
# End Group
# Begin Group "Header Files"

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: 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 */
@ -90,7 +90,7 @@ int modem_connect_tones_tx(modem_connect_tones_tx_state_t *s,
int16_t amp[],
int len)
{
int mod;
int16_t mod;
int i;
int xlen;
@ -165,7 +165,7 @@ int modem_connect_tones_tx(modem_connect_tones_tx_state_t *s,
}
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;
@ -186,7 +186,7 @@ int modem_connect_tones_tx(modem_connect_tones_tx_state_t *s,
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;

View File

@ -10,10 +10,11 @@
*
* 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

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: 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 */
@ -457,7 +457,7 @@ int sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len)
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;
}
@ -505,7 +505,7 @@ int sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len)
#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)
@ -557,7 +557,7 @@ int sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len)
/* 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;

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: 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 */
@ -170,7 +170,7 @@ void fsk_tx_set_modem_status_handler(fsk_tx_state_t *s, modem_tx_status_func_t h
\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.

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: 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_)
@ -46,7 +46,7 @@ struct fsk_tx_state_s
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;

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: 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_)
@ -44,7 +44,7 @@ struct g726_state_s
/*! 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;

View File

@ -24,7 +24,7 @@
* 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 */
@ -42,14 +42,14 @@ struct modem_connect_tones_tx_state_s
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;
};
/*!

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: 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_)
@ -121,7 +121,7 @@ struct sig_tone_tx_state_s
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;

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.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 */
@ -236,7 +236,8 @@ struct t30_state_s
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. */
@ -264,7 +265,7 @@ struct t30_state_s
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. */

View File

@ -30,8 +30,8 @@
/* 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 ------------------------------------------------------------*/

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.279 2009/01/29 01:41:06 steveu Exp $
* $Id: t30.c,v 1.280 2009/01/29 18:30:14 steveu Exp $
*/
/*! \file */
@ -568,7 +568,7 @@ static void release_resources(t30_state_t *s)
}
/*- 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;
@ -3107,7 +3107,7 @@ static void process_state_f_post_doc_non_ecm(t30_state_t *s, const uint8_t *msg,
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)

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: 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 */
@ -1605,7 +1605,7 @@ static void non_ecm_push_residue(t38_gateway_state_t *t)
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;

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.130 2009/01/29 01:41:06 steveu Exp $
* $Id: v17rx.c,v 1.131 2009/01/30 10:22:23 steveu Exp $
*/
/*! \file */
@ -960,7 +960,7 @@ int v17_rx(v17_rx_state_t *s, const int16_t amp[], int len)
int i;
int step;
int16_t x;
int32_t diff;
int16_t diff;
complexf_t z;
complexf_t zz;
complexf_t sample;
@ -984,7 +984,8 @@ 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 = (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 */

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.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 */
@ -746,7 +746,7 @@ int v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len)
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;
@ -772,7 +772,8 @@ 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 = (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 */
@ -893,6 +894,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;
/* 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)

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.151 2009/01/29 01:41:06 steveu Exp $
* $Id: v29rx.c,v 1.152 2009/01/30 10:22:23 steveu Exp $
*/
/*! \file */
@ -834,7 +834,7 @@ int v29_rx(v29_rx_state_t *s, const int16_t amp[], int len)
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;
@ -858,7 +858,8 @@ 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 = (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 */

View File

@ -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.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)
@ -64,9 +64,9 @@ noinst_PROGRAMS = adsi_tests \
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 \