[commit] r11612 - in freeswitch/trunk/libs/spandsp: spandsp-sim src src/msvc src/spandsp tests
Author: mikej Date: Tue Feb 3 12:50:18 2009 New Revision: 11612 Log: update to snapshot spandsp-20090204 Added: freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/g1050.c freeswitch/trunk/libs/spandsp/spandsp-sim/line_model.c freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c freeswitch/trunk/libs/spandsp/spandsp-sim/rfc2198_sim.c freeswitch/trunk/libs/spandsp/spandsp-sim/test_utils.c freeswitch/trunk/libs/spandsp/src/Makefile.am freeswitch/trunk/libs/spandsp/src/adsi.c freeswitch/trunk/libs/spandsp/src/async.c freeswitch/trunk/libs/spandsp/src/at_interpreter.c freeswitch/trunk/libs/spandsp/src/awgn.c freeswitch/trunk/libs/spandsp/src/bell_r2_mf.c freeswitch/trunk/libs/spandsp/src/bert.c freeswitch/trunk/libs/spandsp/src/bit_operations.c freeswitch/trunk/libs/spandsp/src/bitstream.c freeswitch/trunk/libs/spandsp/src/complex_filters.c freeswitch/trunk/libs/spandsp/src/complex_vector_float.c freeswitch/trunk/libs/spandsp/src/complex_vector_int.c freeswitch/trunk/libs/spandsp/src/crc.c freeswitch/trunk/libs/spandsp/src/dds_float.c freeswitch/trunk/libs/spandsp/src/dds_int.c freeswitch/trunk/libs/spandsp/src/dtmf.c freeswitch/trunk/libs/spandsp/src/echo.c freeswitch/trunk/libs/spandsp/src/fax.c freeswitch/trunk/libs/spandsp/src/floating_fudge.h freeswitch/trunk/libs/spandsp/src/fsk.c freeswitch/trunk/libs/spandsp/src/g711.c freeswitch/trunk/libs/spandsp/src/g722.c freeswitch/trunk/libs/spandsp/src/g726.c freeswitch/trunk/libs/spandsp/src/gsm0610_decode.c freeswitch/trunk/libs/spandsp/src/gsm0610_encode.c freeswitch/trunk/libs/spandsp/src/gsm0610_long_term.c freeswitch/trunk/libs/spandsp/src/gsm0610_lpc.c freeswitch/trunk/libs/spandsp/src/gsm0610_preprocess.c freeswitch/trunk/libs/spandsp/src/gsm0610_rpe.c freeswitch/trunk/libs/spandsp/src/gsm0610_short_term.c freeswitch/trunk/libs/spandsp/src/hdlc.c freeswitch/trunk/libs/spandsp/src/ima_adpcm.c freeswitch/trunk/libs/spandsp/src/libspandsp.dsp freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj freeswitch/trunk/libs/spandsp/src/logging.c freeswitch/trunk/libs/spandsp/src/lpc10_decode.c freeswitch/trunk/libs/spandsp/src/lpc10_encode.c freeswitch/trunk/libs/spandsp/src/lpc10_voicing.c freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c freeswitch/trunk/libs/spandsp/src/modem_echo.c freeswitch/trunk/libs/spandsp/src/msvc/config.h freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h freeswitch/trunk/libs/spandsp/src/noise.c freeswitch/trunk/libs/spandsp/src/oki_adpcm.c freeswitch/trunk/libs/spandsp/src/playout.c freeswitch/trunk/libs/spandsp/src/plc.c freeswitch/trunk/libs/spandsp/src/power_meter.c freeswitch/trunk/libs/spandsp/src/queue.c freeswitch/trunk/libs/spandsp/src/schedule.c freeswitch/trunk/libs/spandsp/src/sig_tone.c freeswitch/trunk/libs/spandsp/src/silence_gen.c freeswitch/trunk/libs/spandsp/src/spandsp.h.in freeswitch/trunk/libs/spandsp/src/spandsp/adsi.h freeswitch/trunk/libs/spandsp/src/spandsp/async.h freeswitch/trunk/libs/spandsp/src/spandsp/at_interpreter.h freeswitch/trunk/libs/spandsp/src/spandsp/awgn.h freeswitch/trunk/libs/spandsp/src/spandsp/bell_r2_mf.h freeswitch/trunk/libs/spandsp/src/spandsp/bert.h freeswitch/trunk/libs/spandsp/src/spandsp/bitstream.h freeswitch/trunk/libs/spandsp/src/spandsp/complex_filters.h freeswitch/trunk/libs/spandsp/src/spandsp/dtmf.h freeswitch/trunk/libs/spandsp/src/spandsp/echo.h freeswitch/trunk/libs/spandsp/src/spandsp/fax.h freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h freeswitch/trunk/libs/spandsp/src/spandsp/fsk.h freeswitch/trunk/libs/spandsp/src/spandsp/g711.h freeswitch/trunk/libs/spandsp/src/spandsp/g722.h freeswitch/trunk/libs/spandsp/src/spandsp/g726.h freeswitch/trunk/libs/spandsp/src/spandsp/gsm0610.h freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h freeswitch/trunk/libs/spandsp/src/spandsp/ima_adpcm.h freeswitch/trunk/libs/spandsp/src/spandsp/lpc10.h freeswitch/trunk/libs/spandsp/src/spandsp/modem_connect_tones.h freeswitch/trunk/libs/spandsp/src/spandsp/modem_echo.h freeswitch/trunk/libs/spandsp/src/spandsp/noise.h freeswitch/trunk/libs/spandsp/src/spandsp/oki_adpcm.h freeswitch/trunk/libs/spandsp/src/spandsp/playout.h freeswitch/trunk/libs/spandsp/src/spandsp/plc.h freeswitch/trunk/libs/spandsp/src/spandsp/power_meter.h freeswitch/trunk/libs/spandsp/src/spandsp/queue.h freeswitch/trunk/libs/spandsp/src/spandsp/saturated.h freeswitch/trunk/libs/spandsp/src/spandsp/schedule.h freeswitch/trunk/libs/spandsp/src/spandsp/sig_tone.h freeswitch/trunk/libs/spandsp/src/spandsp/silence_gen.h freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_rx.h freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_tx.h freeswitch/trunk/libs/spandsp/src/spandsp/t30.h freeswitch/trunk/libs/spandsp/src/spandsp/t30_api.h freeswitch/trunk/libs/spandsp/src/spandsp/t30_logging.h freeswitch/trunk/libs/spandsp/src/spandsp/t31.h freeswitch/trunk/libs/spandsp/src/spandsp/t38_core.h freeswitch/trunk/libs/spandsp/src/spandsp/t38_gateway.h freeswitch/trunk/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h freeswitch/trunk/libs/spandsp/src/spandsp/t38_terminal.h freeswitch/trunk/libs/spandsp/src/spandsp/t4.h freeswitch/trunk/libs/spandsp/src/spandsp/telephony.h freeswitch/trunk/libs/spandsp/src/spandsp/time_scale.h freeswitch/trunk/libs/spandsp/src/spandsp/tone_detect.h freeswitch/trunk/libs/spandsp/src/spandsp/tone_generate.h freeswitch/trunk/libs/spandsp/src/spandsp/v17rx.h freeswitch/trunk/libs/spandsp/src/spandsp/v17tx.h freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_tx.h freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h freeswitch/trunk/libs/spandsp/src/spandsp/v29tx.h freeswitch/trunk/libs/spandsp/src/spandsp/v42.h freeswitch/trunk/libs/spandsp/src/spandsp/v42bis.h freeswitch/trunk/libs/spandsp/src/spandsp/v8.h freeswitch/trunk/libs/spandsp/src/spandsp/version.h freeswitch/trunk/libs/spandsp/src/super_tone_rx.c freeswitch/trunk/libs/spandsp/src/super_tone_tx.c freeswitch/trunk/libs/spandsp/src/t30.c freeswitch/trunk/libs/spandsp/src/t30_api.c freeswitch/trunk/libs/spandsp/src/t30_logging.c freeswitch/trunk/libs/spandsp/src/t31.c freeswitch/trunk/libs/spandsp/src/t35.c freeswitch/trunk/libs/spandsp/src/t38_core.c freeswitch/trunk/libs/spandsp/src/t38_gateway.c freeswitch/trunk/libs/spandsp/src/t38_non_ecm_buffer.c freeswitch/trunk/libs/spandsp/src/t38_terminal.c freeswitch/trunk/libs/spandsp/src/t4.c freeswitch/trunk/libs/spandsp/src/time_scale.c freeswitch/trunk/libs/spandsp/src/tone_detect.c freeswitch/trunk/libs/spandsp/src/tone_generate.c freeswitch/trunk/libs/spandsp/src/v17rx.c freeswitch/trunk/libs/spandsp/src/v17tx.c freeswitch/trunk/libs/spandsp/src/v22bis_rx.c freeswitch/trunk/libs/spandsp/src/v22bis_tx.c freeswitch/trunk/libs/spandsp/src/v27ter_rx.c freeswitch/trunk/libs/spandsp/src/v27ter_tx.c freeswitch/trunk/libs/spandsp/src/v29rx.c freeswitch/trunk/libs/spandsp/src/v29tx.c freeswitch/trunk/libs/spandsp/src/v42.c freeswitch/trunk/libs/spandsp/src/v42bis.c freeswitch/trunk/libs/spandsp/src/v8.c freeswitch/trunk/libs/spandsp/src/vector_float.c freeswitch/trunk/libs/spandsp/src/vector_int.c freeswitch/trunk/libs/spandsp/tests/t31_tests.c Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/g1050.c ============================================================================== --- freeswitch/trunk/libs/spandsp/spandsp-sim/g1050.c (original) +++ freeswitch/trunk/libs/spandsp/spandsp-sim/g1050.c Tue Feb 3 12:50:18 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: g1050.c,v 1.12 2009/01/31 08:48:10 steveu Exp $ + * $Id: g1050.c,v 1.13 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) @@ -37,7 +37,6 @@ #include <stdio.h> #include <fcntl.h> #include <audiofile.h> -#include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include <tgmath.h> #endif @@ -45,6 +44,7 @@ #define GEN_CONST #include <math.h> #endif +#include "floating_fudge.h" #include "spandsp.h" #include "spandsp/g1050.h" Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/line_model.c ============================================================================== --- freeswitch/trunk/libs/spandsp/spandsp-sim/line_model.c (original) +++ freeswitch/trunk/libs/spandsp/spandsp-sim/line_model.c Tue Feb 3 12:50:18 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: line_model.c,v 1.7 2008/11/30 10:17:30 steveu Exp $ + * $Id: line_model.c,v 1.8 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) @@ -37,7 +37,6 @@ #include <stdio.h> #include <fcntl.h> #include <audiofile.h> -#include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include <tgmath.h> #endif @@ -45,6 +44,7 @@ #define GEN_CONST #include <math.h> #endif +#include "floating_fudge.h" #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c ============================================================================== --- freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c (original) +++ freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c Tue Feb 3 12:50:18 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: make_line_models.c,v 1.7 2008/07/25 13:56:54 steveu Exp $ + * $Id: make_line_models.c,v 1.8 2009/02/03 16:28:39 steveu Exp $ */ /*! \page make_line_models_page Telephony line model construction @@ -41,18 +41,18 @@ #include <string.h> #include <stdio.h> #include <stdlib.h> -#include "floating_fudge.h" -#if defined(HAVE_FFTW3_H) -#include <fftw3.h> -#else -#include <fftw.h> -#endif #if defined(HAVE_TGMATH_H) #include <tgmath.h> #endif #if defined(HAVE_MATH_H) #include <math.h> #endif +#include "floating_fudge.h" +#if defined(HAVE_FFTW3_H) +#include <fftw3.h> +#else +#include <fftw.h> +#endif #include "spandsp.h" Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/rfc2198_sim.c ============================================================================== --- freeswitch/trunk/libs/spandsp/spandsp-sim/rfc2198_sim.c (original) +++ freeswitch/trunk/libs/spandsp/spandsp-sim/rfc2198_sim.c Tue Feb 3 12:50:18 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: rfc2198_sim.c,v 1.6 2008/07/02 14:48:25 steveu Exp $ + * $Id: rfc2198_sim.c,v 1.7 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) @@ -37,7 +37,6 @@ #include <stdio.h> #include <fcntl.h> #include <audiofile.h> -#include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include <tgmath.h> #endif @@ -45,6 +44,7 @@ #define GEN_CONST #include <math.h> #endif +#include "floating_fudge.h" #include "spandsp.h" #include "spandsp/g1050.h" Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/test_utils.c ============================================================================== --- freeswitch/trunk/libs/spandsp/spandsp-sim/test_utils.c (original) +++ freeswitch/trunk/libs/spandsp/spandsp-sim/test_utils.c Tue Feb 3 12:50:18 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: test_utils.c,v 1.11 2009/01/31 08:48:10 steveu Exp $ + * $Id: test_utils.c,v 1.12 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -35,13 +35,13 @@ #include <inttypes.h> #include <string.h> #include <stdio.h> -#include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include <tgmath.h> #endif #if defined(HAVE_MATH_H) #include <math.h> #endif +#include "floating_fudge.h" #include <time.h> #include <fcntl.h> #include <audiofile.h> Modified: freeswitch/trunk/libs/spandsp/src/Makefile.am ============================================================================== --- freeswitch/trunk/libs/spandsp/src/Makefile.am (original) +++ freeswitch/trunk/libs/spandsp/src/Makefile.am Tue Feb 3 12:50:18 2009 @@ -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.121 2009/01/31 12:24:11 steveu Exp $ +## $Id: Makefile.am,v 1.122 2009/02/03 16:33:13 steveu Exp $ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) @@ -143,6 +143,7 @@ spandsp/dds.h \ spandsp/dtmf.h \ spandsp/echo.h \ + spandsp/fast_convert.h \ spandsp/fax.h \ spandsp/fax_modems.h \ spandsp/fir.h \ Modified: freeswitch/trunk/libs/spandsp/src/adsi.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/adsi.c (original) +++ freeswitch/trunk/libs/spandsp/src/adsi.c Tue Feb 3 12:50:18 2009 @@ -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.68 2009/01/29 01:41:05 steveu Exp $ + * $Id: adsi.c,v 1.69 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include <assert.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/complex.h" @@ -412,9 +413,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(adsi_rx_state_t *) adsi_rx_init(adsi_rx_state_t *s, - int standard, - put_msg_func_t put_msg, - void *user_data) + int standard, + put_msg_func_t put_msg, + void *user_data) { if (s == NULL) { @@ -490,10 +491,10 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) adsi_tx_set_preamble(adsi_tx_state_t *s, - int preamble_len, - int preamble_ones_len, - int postamble_ones_len, - int stop_bits) + int preamble_len, + int preamble_ones_len, + int postamble_ones_len, + int stop_bits) { if (preamble_len < 0) { Modified: freeswitch/trunk/libs/spandsp/src/async.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/async.c (original) +++ freeswitch/trunk/libs/spandsp/src/async.c Tue Feb 3 12:50:18 2009 @@ -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: async.c,v 1.15 2009/01/05 13:48:31 steveu Exp $ + * $Id: async.c,v 1.16 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -73,12 +73,12 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s, - int data_bits, - int parity, - int stop_bits, - int use_v14, - put_byte_func_t put_byte, - void *user_data) + int data_bits, + int parity, + int stop_bits, + int use_v14, + put_byte_func_t put_byte, + void *user_data) { if (s == NULL) { @@ -103,7 +103,7 @@ } /*- End of function --------------------------------------------------------*/ -void async_rx_put_bit(void *user_data, int bit) +SPAN_DECLARE(void) async_rx_put_bit(void *user_data, int bit) { async_rx_state_t *s; @@ -185,12 +185,12 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s, - int data_bits, - int parity, - int stop_bits, - int use_v14, - get_byte_func_t get_byte, - void *user_data) + int data_bits, + int parity, + int stop_bits, + int use_v14, + get_byte_func_t get_byte, + void *user_data) { if (s == NULL) { @@ -216,7 +216,7 @@ } /*- End of function --------------------------------------------------------*/ -int async_tx_get_bit(void *user_data) +SPAN_DECLARE(int) async_tx_get_bit(void *user_data) { async_tx_state_t *s; int bit; Modified: freeswitch/trunk/libs/spandsp/src/at_interpreter.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/at_interpreter.c (original) +++ freeswitch/trunk/libs/spandsp/src/at_interpreter.c Tue Feb 3 12:50:18 2009 @@ -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: at_interpreter.c,v 1.34 2009/01/16 15:13:16 steveu Exp $ + * $Id: at_interpreter.c,v 1.35 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -5292,10 +5292,10 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(at_state_t *) at_init(at_state_t *s, - at_tx_handler_t *at_tx_handler, - void *at_tx_user_data, - at_modem_control_handler_t *modem_control_handler, - void *modem_control_user_data) + at_tx_handler_t *at_tx_handler, + void *at_tx_user_data, + at_modem_control_handler_t *modem_control_handler, + void *modem_control_user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/awgn.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/awgn.c (original) +++ freeswitch/trunk/libs/spandsp/src/awgn.c Tue Feb 3 12:50:18 2009 @@ -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: awgn.c,v 1.20 2009/01/28 03:41:26 steveu Exp $ + * $Id: awgn.c,v 1.21 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -57,6 +57,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/awgn.h" Modified: freeswitch/trunk/libs/spandsp/src/bell_r2_mf.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/bell_r2_mf.c (original) +++ freeswitch/trunk/libs/spandsp/src/bell_r2_mf.c Tue Feb 3 12:50:18 2009 @@ -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.36 2009/01/31 08:48:10 steveu Exp $ + * $Id: bell_r2_mf.c,v 1.37 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -45,6 +45,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/queue.h" #include "spandsp/dc_restore.h" #include "spandsp/complex.h" @@ -612,8 +613,8 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s, - digits_rx_callback_t callback, - void *user_data) + digits_rx_callback_t callback, + void *user_data) { int i; static int initialised = FALSE; @@ -785,9 +786,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s, - int fwd, - tone_report_func_t callback, - void *user_data) + int fwd, + tone_report_func_t callback, + void *user_data) { int i; static int initialised = FALSE; Modified: freeswitch/trunk/libs/spandsp/src/bert.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/bert.c (original) +++ freeswitch/trunk/libs/spandsp/src/bert.c Tue Feb 3 12:50:18 2009 @@ -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: bert.c,v 1.30 2008/11/30 13:44:35 steveu Exp $ + * $Id: bert.c,v 1.31 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) Modified: freeswitch/trunk/libs/spandsp/src/bit_operations.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/bit_operations.c (original) +++ freeswitch/trunk/libs/spandsp/src/bit_operations.c Tue Feb 3 12:50:18 2009 @@ -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.c,v 1.15 2008/06/28 01:13:08 steveu Exp $ + * $Id: bit_operations.c,v 1.16 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -69,7 +69,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(__x86_64__) -uint64_t bit_reverse_8bytes(uint64_t x) +SPAN_DECLARE(uint64_t) bit_reverse_8bytes(uint64_t x) { x = ((x & 0xF0F0F0F0F0F0F0F0LLU) >> 4) | ((x & 0x0F0F0F0F0F0F0F0FLLU) << 4); x = ((x & 0xCCCCCCCCCCCCCCCCLLU) >> 2) | ((x & 0x3333333333333333LLU) << 2); Modified: freeswitch/trunk/libs/spandsp/src/bitstream.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/bitstream.c (original) +++ freeswitch/trunk/libs/spandsp/src/bitstream.c Tue Feb 3 12:50:18 2009 @@ -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: bitstream.c,v 1.16 2009/01/05 13:48:31 steveu Exp $ + * $Id: bitstream.c,v 1.17 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -41,7 +41,7 @@ #include "spandsp/private/bitstream.h" -void bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits) +SPAN_DECLARE(void) bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits) { value &= ((1 << bits) - 1); if (s->residue + bits <= 32) @@ -58,7 +58,7 @@ } /*- End of function --------------------------------------------------------*/ -void bitstream_put2(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits) +SPAN_DECLARE(void) bitstream_put2(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits) { value &= ((1 << bits) - 1); if (s->residue + bits <= 32) @@ -74,7 +74,7 @@ } /*- End of function --------------------------------------------------------*/ -uint32_t bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits) +SPAN_DECLARE(uint32_t) bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits) { uint32_t x; @@ -90,7 +90,7 @@ } /*- End of function --------------------------------------------------------*/ -uint32_t bitstream_get2(bitstream_state_t *s, const uint8_t **c, int bits) +SPAN_DECLARE(uint32_t) bitstream_get2(bitstream_state_t *s, const uint8_t **c, int bits) { uint32_t x; @@ -105,7 +105,7 @@ } /*- End of function --------------------------------------------------------*/ -void bitstream_flush(bitstream_state_t *s, uint8_t **c) +SPAN_DECLARE(void) bitstream_flush(bitstream_state_t *s, uint8_t **c) { if (s->residue > 0) { @@ -115,7 +115,7 @@ } /*- End of function --------------------------------------------------------*/ -void bitstream_flush2(bitstream_state_t *s, uint8_t **c) +SPAN_DECLARE(void) bitstream_flush2(bitstream_state_t *s, uint8_t **c) { if (s->residue > 0) { @@ -125,7 +125,7 @@ } /*- End of function --------------------------------------------------------*/ -bitstream_state_t *bitstream_init(bitstream_state_t *s) +SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s) { if (s == NULL) return NULL; Modified: freeswitch/trunk/libs/spandsp/src/complex_filters.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/complex_filters.c (original) +++ freeswitch/trunk/libs/spandsp/src/complex_filters.c Tue Feb 3 12:50:18 2009 @@ -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: complex_filters.c,v 1.15 2009/01/31 08:48:10 steveu Exp $ + * $Id: complex_filters.c,v 1.16 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) @@ -53,17 +53,20 @@ } return fi; } +/*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) filter_delete(filter_t *fi) { if (fi) free(fi); } +/*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) filter_step(filter_t *fi, float x) { return fi->fs->fsf(fi, x); } +/*- End of function --------------------------------------------------------*/ SPAN_DECLARE(cfilter_t *) cfilter_create(fspec_t *fs) { @@ -85,6 +88,7 @@ } return cfi; } +/*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi) { @@ -94,6 +98,7 @@ filter_delete(cfi->imf); } } +/*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) cfilter_step(cfilter_t *cfi, const complexf_t *z) { @@ -103,3 +108,5 @@ cc.im = filter_step(cfi->imf, z->im); return cc; } +/*- End of function --------------------------------------------------------*/ +/*- End of file ------------------------------------------------------------*/ Modified: freeswitch/trunk/libs/spandsp/src/complex_vector_float.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/complex_vector_float.c (original) +++ freeswitch/trunk/libs/spandsp/src/complex_vector_float.c Tue Feb 3 12:50:18 2009 @@ -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: complex_vector_float.c,v 1.14 2009/01/28 03:41:26 steveu Exp $ + * $Id: complex_vector_float.c,v 1.15 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -135,7 +135,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void cvec_mull(complexl_t z[], const complexl_t x[], const complexl_t y[], int n) +SPAN_DECLARE(void) cvec_mull(complexl_t z[], const complexl_t x[], const complexl_t y[], int n) { int i; @@ -179,7 +179,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -complexl_t cvec_dot_prodl(const complexl_t x[], const complexl_t y[], int n) +SPAN_DECLARE(complexl_t) cvec_dot_prodl(const complexl_t x[], const complexl_t y[], int n) { int i; complexl_t z; Modified: freeswitch/trunk/libs/spandsp/src/complex_vector_int.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/complex_vector_int.c (original) +++ freeswitch/trunk/libs/spandsp/src/complex_vector_int.c Tue Feb 3 12:50:18 2009 @@ -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: complex_vector_int.c,v 1.6 2009/01/28 03:41:26 steveu Exp $ + * $Id: complex_vector_int.c,v 1.7 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/crc.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/crc.c (original) +++ freeswitch/trunk/libs/spandsp/src/crc.c Tue Feb 3 12:50:18 2009 @@ -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: crc.c,v 1.5 2009/01/05 13:48:31 steveu Exp $ + * $Id: crc.c,v 1.6 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/dds_float.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/dds_float.c (original) +++ freeswitch/trunk/libs/spandsp/src/dds_float.c Tue Feb 3 12:50:18 2009 @@ -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_float.c,v 1.10 2009/01/28 03:41:26 steveu Exp $ + * $Id: dds_float.c,v 1.11 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/dds_int.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/dds_int.c (original) +++ freeswitch/trunk/libs/spandsp/src/dds_int.c Tue Feb 3 12:50:18 2009 @@ -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.14 2009/01/29 01:41:05 steveu Exp $ + * $Id: dds_int.c,v 1.15 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/dtmf.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/dtmf.c (original) +++ freeswitch/trunk/libs/spandsp/src/dtmf.c Tue Feb 3 12:50:18 2009 @@ -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.49 2009/01/31 08:48:10 steveu Exp $ + * $Id: dtmf.c,v 1.50 2009/02/03 16:28:39 steveu Exp $ */ /*! \file dtmf.h */ @@ -46,6 +46,7 @@ #include <fcntl.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/queue.h" #include "spandsp/complex.h" #include "spandsp/dds.h" @@ -251,7 +252,7 @@ /* Avoid reporting multiple no digit conditions on flaky hits */ if (s->in_digit || hit) { - i = (s->in_digit && !hit) ? -99 : lrintf(log10f(s->energy)*10.0f - DTMF_POWER_OFFSET + DBM0_MAX_POWER); + i = (s->in_digit && !hit) ? -99 : lfastrintf(log10f(s->energy)*10.0f - DTMF_POWER_OFFSET + DBM0_MAX_POWER); s->realtime_callback(s->realtime_callback_data, hit, i, 0); } } @@ -322,8 +323,8 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dtmf_rx_set_realtime_callback(dtmf_rx_state_t *s, - tone_report_func_t callback, - void *user_data) + tone_report_func_t callback, + void *user_data) { s->realtime_callback = callback; s->realtime_callback_data = user_data; @@ -331,10 +332,10 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dtmf_rx_parms(dtmf_rx_state_t *s, - int filter_dialtone, - int twist, - int reverse_twist, - int threshold) + int filter_dialtone, + int twist, + int reverse_twist, + int threshold) { float x; @@ -359,8 +360,8 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(dtmf_rx_state_t *) dtmf_rx_init(dtmf_rx_state_t *s, - digits_rx_callback_t callback, - void *user_data) + digits_rx_callback_t callback, + void *user_data) { int i; static int initialised = FALSE; Modified: freeswitch/trunk/libs/spandsp/src/echo.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/echo.c (original) +++ freeswitch/trunk/libs/spandsp/src/echo.c Tue Feb 3 12:50:18 2009 @@ -27,7 +27,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: echo.c,v 1.30 2009/01/28 03:41:26 steveu Exp $ + * $Id: echo.c,v 1.31 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -95,6 +95,7 @@ #include <stdio.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/saturated.h" #include "spandsp/dc_restore.h" Modified: freeswitch/trunk/libs/spandsp/src/fax.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/fax.c (original) +++ freeswitch/trunk/libs/spandsp/src/fax.c Tue Feb 3 12:50:18 2009 @@ -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: fax.c,v 1.84 2009/01/28 03:41:26 steveu Exp $ + * $Id: fax.c,v 1.85 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/floating_fudge.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/floating_fudge.h (original) +++ freeswitch/trunk/libs/spandsp/src/floating_fudge.h Tue Feb 3 12:50:18 2009 @@ -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.6 2009/01/29 01:41:05 steveu Exp $ + * $Id: floating_fudge.h,v 1.7 2009/02/03 16:28:39 steveu Exp $ */ #if !defined(_FLOATING_FUDGE_H_) @@ -130,367 +130,6 @@ } #endif -/* The following code, to handle issues with lrint() and lrintf() on various - * platforms, is adapted from similar code in libsndfile, which is: - * - * Copyright (C) 2001-2004 Erik de Castro Lopo <erikd@mega-nerd.com> - * - * This program 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 program 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. - */ - -/* - * On Intel Pentium processors (especially PIII and probably P4), converting - * from float to int is very slow. To meet the C specs, the code produced by - * most C compilers targeting Pentium needs to change the FPU rounding mode - * before the float to int conversion is performed. - * - * Changing the FPU rounding mode causes the FPU pipeline to be flushed. It - * is this flushing of the pipeline which is so slow. - * - * Fortunately the ISO C99 specification defines the functions lrint, lrintf, - * llrint and llrintf which fix this problem as a side effect. - * - * On Unix-like systems, the configure process should have detected the - * presence of these functions. If they weren't found we have to replace them - * here with a standard C cast. - */ - -/* - * The C99 prototypes for these functions are as follows: - * - * int rintf(float x); - * int rint(double x); - * long int lrintf(float x); - * long int lrint(double x); - * long long int llrintf(float x); - * long long int llrint(double x); - * - * The presence of the required functions are detected during the configure - * process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in - * the config file. - */ - -#if defined(__CYGWIN__) - /* - * CYGWIN has lrint and lrintf functions, but they are slow and buggy: - * http://sourceware.org/ml/cygwin/2005-06/msg00153.html - * http://sourceware.org/ml/cygwin/2005-09/msg00047.html - * The latest version of cygwin seems to have made no effort to fix this. - * These replacement functions (pulled from the Public Domain MinGW - * math.h header) replace the native versions. - */ - static __inline__ long int lrint(double x) - { - long int retval; - - __asm__ __volatile__ - ( - "fistpl %0" - : "=m" (retval) - : "t" (x) - : "st" - ); - - return retval; - } - - static __inline__ long int lrintf(float x) - { - long int retval; - - __asm__ __volatile__ - ( - "fistpl %0" - : "=m" (retval) - : "t" (x) - : "st" - ); - return retval; - } - - static __inline__ long int lfastrint(double x) - { - long int retval; - - __asm__ __volatile__ - ( - "fistpl %0" - : "=m" (retval) - : "t" (x) - : "st" - ); - - return retval; - } - - static __inline__ long int lfastrintf(float x) - { - long int retval; - - __asm__ __volatile__ - ( - "fistpl %0" - : "=m" (retval) - : "t" (x) - : "st" - ); - return retval; - } -#elif defined(HAVE_LRINT) && defined(HAVE_LRINTF) - -#if defined(__i386__) - /* These routines are guaranteed fast on an i386 machine. Using the built in - lrint() and lrintf() should be similar, but they may not always be enabled. - Sometimes, especially with "-O0", you might get slow calls to routines. */ - static __inline__ long int lfastrint(double x) - { - long int retval; - - __asm__ __volatile__ - ( - "fistpl %0" - : "=m" (retval) - : "t" (x) - : "st" - ); - - return retval; - } - - static __inline__ long int lfastrintf(float x) - { - long int retval; - - __asm__ __volatile__ - ( - "fistpl %0" - : "=m" (retval) - : "t" (x) - : "st" - ); - return retval; - } -#elif defined(__x86_64__) - /* On an x86_64 machine, the fastest thing seems to be a pure assignment from a - double or float to an int. It looks like the design on the x86_64 took account - of the default behaviour specified for C. */ - static __inline__ long int lfastrint(double x) - { - return (long int) (x); - } - - static __inline__ long int lfastrintf(float x) - { - return (long int) (x); - } -#elif defined(__ppc__) || defined(__powerpc__) - static __inline__ long int lfastrint(register double x) - { - int res[2]; - - __asm__ __volatile__ - ( - "fctiw %1, %1\n\t" - "stfd %1, %0" - : "=m" (res) /* Output */ - : "f" (x) /* Input */ - : "memory" - ); - - return res[1]; - } - - static __inline__ long int lfastrintf(register float x) - { - int res[2]; - - __asm__ __volatile__ - ( - "fctiw %1, %1\n\t" - "stfd %1, %0" - : "=m" (res) /* Output */ - : "f" (x) /* Input */ - : "memory" - ); - - return res[1]; - } -#endif - -#elif defined(WIN32) || defined(_WIN32) - /* - * Win32 doesn't seem to have the lrint() and lrintf() functions. - * Therefore implement inline versions of these functions here. - */ - __inline long int lrint(double x) - { - long int i; - - _asm - { - fld x - fistp i - }; - return i; - } - - __inline long int lrintf(float x) - { - long int i; - - _asm - { - fld x - fistp i - }; - 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; - - _asm - { - fld x - fistp i - }; - return i; - } - - __inline long int lfastrintf(float x) - { - long int i; - - _asm - { - fld x - fistp i - }; - return i; - } -#elif defined(WIN64) || defined(_WIN64) - /* - * Win64 machines will do best with a simple assignment. - */ - __inline long int lfastrint(double x) - { - return (long int) (x); - } - - __inline long int lfastrintf(float x) - { - return (long int) (x); - } -#elif defined(__MWERKS__) && defined(macintosh) - /* This MacOS 9 solution was provided by Stephane Letz */ - - long int __inline__ lfastrint(register double x) - { - long int res[2]; - - asm - { - fctiw x, x - stfd x, res - } - return res[1]; - } - - long int __inline__ lfastrintf(register float x) - { - long int res[2]; - - asm - { - fctiw x, x - stfd x, res - } - return res[1]; - } - -#elif defined(__MACH__) && defined(__APPLE__) && (defined(__ppc__) || defined(__powerpc__)) - /* For Apple Mac OS/X - do recent versions still need this? */ - - static __inline__ long int lfastrint(register double x) - { - int res[2]; - - __asm__ __volatile__ - ( - "fctiw %1, %1\n\t" - "stfd %1, %0" - : "=m" (res) /* Output */ - : "f" (x) /* Input */ - : "memory" - ); - - return res[1]; - } - - static __inline__ long int lfastrintf(register float x) - { - int res[2]; - - __asm__ __volatile__ - ( - "fctiw %1, %1\n\t" - "stfd %1, %0" - : "=m" (res) /* Output */ - : "f" (x) /* Input */ - : "memory" - ); - - return res[1]; - } -#else - /* There is nothing else to do, but use a simple casting operation, instead of a real - rint() type function. Since we are only trying to use rint() to speed up conversions, - the accuracy issues related to changing the rounding scheme are of little concern - to us. */ - - #if !defined(__sgi) - #warning "No usable lrint() and lrintf() functions available." - #warning "Replacing these functions with a simple C cast." - #endif - - static __inline__ long int lfastrint(double x) - { - return (long int) (x); - } - - static __inline__ long int lfastrintf(float x) - { - return (long int) (x); - } - -#endif - #if defined(__cplusplus) } #endif Modified: freeswitch/trunk/libs/spandsp/src/fsk.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/fsk.c (original) +++ freeswitch/trunk/libs/spandsp/src/fsk.c Tue Feb 3 12:50:18 2009 @@ -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.50 2009/01/29 18:30:14 steveu Exp $ + * $Id: fsk.c,v 1.51 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -121,9 +121,9 @@ }; SPAN_DECLARE(fsk_tx_state_t *) fsk_tx_init(fsk_tx_state_t *s, - const fsk_spec_t *spec, - get_bit_func_t get_bit, - void *user_data) + const fsk_spec_t *spec, + get_bit_func_t get_bit, + void *user_data) { if (s == NULL) { @@ -231,10 +231,10 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(fsk_rx_state_t *) fsk_rx_init(fsk_rx_state_t *s, - const fsk_spec_t *spec, - int sync_mode, - put_bit_func_t put_bit, - void *user_data) + const fsk_spec_t *spec, + int sync_mode, + put_bit_func_t put_bit, + void *user_data) { int chop; Modified: freeswitch/trunk/libs/spandsp/src/g711.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/g711.c (original) +++ freeswitch/trunk/libs/spandsp/src/g711.c Tue Feb 3 12:50:18 2009 @@ -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: g711.c,v 1.14 2009/01/28 03:41:26 steveu Exp $ + * $Id: g711.c,v 1.15 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -98,9 +98,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_decode(g711_state_t *s, - int16_t amp[], - const uint8_t g711_data[], - int g711_bytes) + int16_t amp[], + const uint8_t g711_data[], + int g711_bytes) { int i; @@ -122,9 +122,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_encode(g711_state_t *s, - uint8_t g711_data[], - const int16_t amp[], - int len) + uint8_t g711_data[], + const int16_t amp[], + int len) { int i; @@ -146,9 +146,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_transcode(g711_state_t *s, - uint8_t g711_out[], - const uint8_t g711_in[], - int g711_bytes) + uint8_t g711_out[], + const uint8_t g711_in[], + int g711_bytes) { int i; Modified: freeswitch/trunk/libs/spandsp/src/g722.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/g722.c (original) +++ freeswitch/trunk/libs/spandsp/src/g722.c Tue Feb 3 12:50:18 2009 @@ -28,7 +28,7 @@ * Computer Science, Speech Group * Chengxiang Lu and Alex Hauptmann * - * $Id: g722.c,v 1.6 2009/01/29 18:30:14 steveu Exp $ + * $Id: g722.c,v 1.7 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -49,6 +49,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/vector_int.h" #include "spandsp/g722.h" Modified: freeswitch/trunk/libs/spandsp/src/g726.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/g726.c (original) +++ freeswitch/trunk/libs/spandsp/src/g726.c Tue Feb 3 12:50:18 2009 @@ -48,7 +48,7 @@ * 2550 Garcia Avenue * Mountain View, California 94043 * - * $Id: g726.c,v 1.26 2009/01/28 03:41:26 steveu Exp $ + * $Id: g726.c,v 1.27 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -1065,9 +1065,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g726_decode(g726_state_t *s, - int16_t amp[], - const uint8_t g726_data[], - int g726_bytes) + int16_t amp[], + const uint8_t g726_data[], + int g726_bytes) { int i; int samples; @@ -1121,9 +1121,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g726_encode(g726_state_t *s, - uint8_t g726_data[], - const int16_t amp[], - int len) + uint8_t g726_data[], + const int16_t amp[], + int len) { int i; int g726_bytes; Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_decode.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_decode.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_decode.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_decode.c,v 1.24 2009/01/28 03:41:26 steveu Exp $ + * $Id: gsm0610_decode.c,v 1.25 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #include <memory.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_encode.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_encode.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_encode.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_encode.c,v 1.28 2009/01/28 03:41:26 steveu Exp $ + * $Id: gsm0610_encode.c,v 1.29 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #include <memory.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_long_term.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_long_term.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_long_term.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_long_term.c,v 1.20 2009/01/28 03:41:26 steveu Exp $ + * $Id: gsm0610_long_term.c,v 1.21 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include <stdlib.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_lpc.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_lpc.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_lpc.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_lpc.c,v 1.27 2009/01/28 03:41:26 steveu Exp $ + * $Id: gsm0610_lpc.c,v 1.28 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #include <memory.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/bit_operations.h" #include "spandsp/saturated.h" Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_preprocess.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_preprocess.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_preprocess.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_preprocess.c,v 1.16 2009/01/28 03:41:27 steveu Exp $ + * $Id: gsm0610_preprocess.c,v 1.17 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include <stdlib.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_rpe.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_rpe.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_rpe.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_rpe.c,v 1.24 2009/01/28 03:41:27 steveu Exp $ + * $Id: gsm0610_rpe.c,v 1.25 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include <stdlib.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" Modified: freeswitch/trunk/libs/spandsp/src/gsm0610_short_term.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/gsm0610_short_term.c (original) +++ freeswitch/trunk/libs/spandsp/src/gsm0610_short_term.c Tue Feb 3 12:50:18 2009 @@ -25,7 +25,7 @@ * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html * - * $Id: gsm0610_short_term.c,v 1.18 2009/01/28 03:41:27 steveu Exp $ + * $Id: gsm0610_short_term.c,v 1.19 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include <stdlib.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" Modified: freeswitch/trunk/libs/spandsp/src/hdlc.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/hdlc.c (original) +++ freeswitch/trunk/libs/spandsp/src/hdlc.c Tue Feb 3 12:50:18 2009 @@ -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.68 2009/01/31 09:47:59 steveu Exp $ + * $Id: hdlc.c,v 1.69 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -296,11 +296,11 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s, - int crc32, - int report_bad_frames, - int framing_ok_threshold, - hdlc_frame_handler_t handler, - void *user_data) + int crc32, + int report_bad_frames, + int framing_ok_threshold, + hdlc_frame_handler_t handler, + void *user_data) { if (s == NULL) { @@ -319,7 +319,7 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_rx_get_stats(hdlc_rx_state_t *s, - hdlc_rx_stats_t *t) + hdlc_rx_stats_t *t) { t->bytes = s->rx_bytes; t->good_frames = s->rx_frames; @@ -547,11 +547,11 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s, - int crc32, - int inter_frame_flags, - int progressive, - hdlc_underflow_handler_t handler, - void *user_data) + int crc32, + int inter_frame_flags, + int progressive, + hdlc_underflow_handler_t handler, + void *user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/ima_adpcm.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/ima_adpcm.c (original) +++ freeswitch/trunk/libs/spandsp/src/ima_adpcm.c Tue Feb 3 12:50:18 2009 @@ -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: ima_adpcm.c,v 1.33 2009/01/28 03:41:27 steveu Exp $ + * $Id: ima_adpcm.c,v 1.34 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -44,6 +44,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/ima_adpcm.h" #include "spandsp/private/ima_adpcm.h" @@ -299,9 +300,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ima_adpcm_decode(ima_adpcm_state_t *s, - int16_t amp[], - const uint8_t ima_data[], - int ima_bytes) + int16_t amp[], + const uint8_t ima_data[], + int ima_bytes) { int i; int j; @@ -415,9 +416,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ima_adpcm_encode(ima_adpcm_state_t *s, - uint8_t ima_data[], - const int16_t amp[], - int len) + uint8_t ima_data[], + const int16_t amp[], + int len) { int i; int bytes; Modified: freeswitch/trunk/libs/spandsp/src/libspandsp.dsp ============================================================================== --- freeswitch/trunk/libs/spandsp/src/libspandsp.dsp (original) +++ freeswitch/trunk/libs/spandsp/src/libspandsp.dsp Tue Feb 3 12:50:18 2009 @@ -479,6 +479,10 @@ # End Source File # Begin Source File +SOURCE=.\spandsp/fast_convert.h +# End Source File +# Begin Source File + SOURCE=.\spandsp/fax.h # End Source File # Begin Source File Modified: freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj ============================================================================== --- freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj (original) +++ freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj Tue Feb 3 12:50:18 2009 @@ -178,822 +178,217 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > - <File - RelativePath="adsi.c" - > - </File> - <File - RelativePath="async.c" - > - </File> - <File - RelativePath="at_interpreter.c" - > - </File> - <File - RelativePath="awgn.c" - > - </File> - <File - RelativePath="bell_r2_mf.c" - > - </File> - <File - RelativePath="bert.c" - > - </File> - <File - RelativePath="bit_operations.c" - > - </File> - <File - RelativePath="bitstream.c" - > - </File> - <File - RelativePath="complex_filters.c" - > - </File> - <File - RelativePath="complex_vector_float.c" - > - </File> - <File - RelativePath="complex_vector_int.c" - > - </File> - <File - RelativePath="crc.c" - > - </File> - <File - RelativePath="dds_float.c" - > - </File> - <File - RelativePath="dds_int.c" - > - </File> - <File - RelativePath="dtmf.c" - > - </File> - <File - RelativePath="echo.c" - > - </File> - <File - RelativePath="fax.c" - > - </File> - <File - RelativePath="fsk.c" - > - </File> - <File - RelativePath="g711.c" - > - </File> - <File - RelativePath="g722.c" - > - </File> - <File - RelativePath="g726.c" - > - </File> - <File - RelativePath=".\msvc\gettimeofday.c" - > - </File> - <File - RelativePath="gsm0610_decode.c" - > - </File> - <File - RelativePath="gsm0610_encode.c" - > - </File> - <File - RelativePath="gsm0610_long_term.c" - > - </File> - <File - RelativePath="gsm0610_lpc.c" - > - </File> - <File - RelativePath="gsm0610_preprocess.c" - > - </File> - <File - RelativePath="gsm0610_rpe.c" - > - </File> - <File - RelativePath="gsm0610_short_term.c" - > - </File> - <File - RelativePath="hdlc.c" - > - </File> - <File - RelativePath="ima_adpcm.c" - > - </File> - <File - RelativePath="logging.c" - > - </File> - <File - RelativePath="lpc10_analyse.c" - > - </File> - <File - RelativePath="lpc10_decode.c" - > - </File> - <File - RelativePath="lpc10_encode.c" - > - </File> - <File - RelativePath="lpc10_placev.c" - > - </File> - <File - RelativePath="lpc10_voicing.c" - > - </File> - <File - RelativePath="modem_connect_tones.c" - > - </File> - <File - RelativePath="modem_echo.c" - > - </File> - <File - RelativePath="noise.c" - > - </File> - <File - RelativePath="oki_adpcm.c" - > - </File> - <File - RelativePath="playout.c" - > - </File> - <File - RelativePath="plc.c" - > - </File> - <File - RelativePath="power_meter.c" - > - </File> - <File - RelativePath="queue.c" - > - </File> - <File - RelativePath="schedule.c" - > - </File> - <File - RelativePath="sig_tone.c" - > - </File> - <File - RelativePath="silence_gen.c" - > - </File> - <File - RelativePath="super_tone_rx.c" - > - </File> - <File - RelativePath="super_tone_tx.c" - > - </File> - <File - RelativePath="t30.c" - > - </File> - <File - RelativePath="t30_api.c" - > - </File> - <File - RelativePath="t30_logging.c" - > - </File> - <File - RelativePath="t31.c" - > - </File> - <File - RelativePath="t35.c" - > - </File> - <File - RelativePath="t38_core.c" - > - </File> - <File - RelativePath="t38_gateway.c" - > - </File> - <File - RelativePath="t38_non_ecm_buffer.c" - > - </File> - <File - RelativePath="t38_terminal.c" - > - </File> - <File - RelativePath="t4.c" - > - </File> - <File - RelativePath="testcpuid.c" - > - </File> - <File - RelativePath="time_scale.c" - > - </File> - <File - RelativePath="tone_detect.c" - > - </File> - <File - RelativePath="tone_generate.c" - > - </File> - <File - RelativePath="v17rx.c" - > - </File> - <File - RelativePath="v17tx.c" - > - </File> - <File - RelativePath="v22bis_rx.c" - > - </File> - <File - RelativePath="v22bis_tx.c" - > - </File> - <File - RelativePath="v27ter_rx.c" - > - </File> - <File - RelativePath="v27ter_tx.c" - > - </File> - <File - RelativePath="v29rx.c" - > - </File> - <File - RelativePath="v29tx.c" - > - </File> - <File - RelativePath="v42.c" - > - </File> - <File - RelativePath="v42bis.c" - > - </File> - <File - RelativePath="v8.c" - > - </File> - <File - RelativePath="vector_float.c" - > - </File> - <File - RelativePath="vector_int.c" - > - </File> - </Filter> - <Filter - Name="Header Files" - > - <File - RelativePath=".\msvc\spandsp.h" - > - </File> - <File - RelativePath="spandsp/adsi.h" - > - </File> - <File - RelativePath="spandsp/arctan2.h" - > - </File> - <File - RelativePath="spandsp/async.h" - > - </File> - <File - RelativePath="spandsp/at_interpreter.h" - > - </File> - <File - RelativePath="spandsp/awgn.h" - > - </File> - <File - RelativePath="spandsp/bell_r2_mf.h" - > - </File> - <File - RelativePath="spandsp/bert.h" - > - </File> - <File - RelativePath="spandsp/biquad.h" - > - </File> - <File - RelativePath="spandsp/bit_operations.h" - > - </File> - <File - RelativePath="spandsp/bitstream.h" - > - </File> - <File - RelativePath="spandsp/complex.h" - > - </File> - <File - RelativePath="spandsp/complex_filters.h" - > - </File> - <File - RelativePath="spandsp/complex_vector_float.h" - > - </File> - <File - RelativePath="spandsp/complex_vector_int.h" - > - </File> - <File - RelativePath="spandsp/crc.h" - > - </File> - <File - RelativePath="spandsp/dc_restore.h" - > - </File> - <File - RelativePath="spandsp/dds.h" - > - </File> - <File - RelativePath="spandsp/dtmf.h" - > - </File> - <File - RelativePath="spandsp/echo.h" - > - </File> - <File - RelativePath="spandsp/expose.h" - > - </File> - <File - RelativePath="spandsp/fax.h" - > - </File> - <File - RelativePath="spandsp/fax_modems.h" - > - </File> - <File - RelativePath="spandsp/fir.h" - > - </File> - <File - RelativePath="spandsp/fsk.h" - > - </File> - <File - RelativePath="spandsp/g168models.h" - > - </File> - <File - RelativePath="spandsp/g711.h" - > - </File> - <File - RelativePath="spandsp/g722.h" - > - </File> - <File - RelativePath="spandsp/g726.h" - > - </File> - <File - RelativePath="spandsp/gsm0610.h" - > - </File> - <File - RelativePath="spandsp/hdlc.h" - > - </File> - <File - RelativePath="spandsp/ima_adpcm.h" - > - </File> - <File - RelativePath="spandsp/logging.h" - > - </File> - <File - RelativePath="spandsp/lpc10.h" - > - </File> - <File - RelativePath="spandsp/modem_connect_tones.h" - > - </File> - <File - RelativePath="spandsp/modem_echo.h" - > - </File> - <File - RelativePath="spandsp/noise.h" - > - </File> - <File - RelativePath="spandsp/oki_adpcm.h" - > - </File> - <File - RelativePath="spandsp/playout.h" - > - </File> - <File - RelativePath="spandsp/plc.h" - > - </File> - <File - RelativePath="spandsp/power_meter.h" - > - </File> - <File - RelativePath="spandsp/private/adsi.h" - > - </File> - <File - RelativePath="spandsp/private/async.h" - > - </File> - <File - RelativePath="spandsp/private/at_interpreter.h" - > - </File> - <File - RelativePath="spandsp/private/awgn.h" - > - </File> - <File - RelativePath="spandsp/private/bell_r2_mf.h" - > - </File> - <File - RelativePath="spandsp/private/bert.h" - > - </File> - <File - RelativePath="spandsp/private/bitstream.h" - > - </File> - <File - RelativePath="spandsp/private/dtmf.h" - > - </File> - <File - RelativePath="spandsp/private/fax.h" - > - </File> - <File - RelativePath="spandsp/private/fax_modems.h" - > - </File> - <File - RelativePath="spandsp/private/fsk.h" - > - </File> - <File - RelativePath="spandsp/private/g711.h" - > - </File> - <File - RelativePath="spandsp/private/g722.h" - > - </File> - <File - RelativePath="spandsp/private/g726.h" - > - </File> - <File - RelativePath="spandsp/private/gsm0610.h" - > - </File> - <File - RelativePath="spandsp/private/hdlc.h" - > - </File> - <File - RelativePath="spandsp/private/ima_adpcm.h" - > - </File> - <File - RelativePath="spandsp/private/logging.h" - > - </File> - <File - RelativePath="spandsp/private/lpc10.h" - > - </File> - <File - RelativePath="spandsp/private/modem_connect_tones.h" - > - </File> - <File - RelativePath="spandsp/private/noise.h" - > - </File> - <File - RelativePath="spandsp/private/oki_adpcm.h" - > - </File> - <File - RelativePath="spandsp/private/queue.h" - > - </File> - <File - RelativePath="spandsp/private/schedule.h" - > - </File> - <File - RelativePath="spandsp/private/sig_tone.h" - > - </File> - <File - RelativePath="spandsp/private/super_tone_rx.h" - > - </File> - <File - RelativePath="spandsp/private/super_tone_tx.h" - > - </File> - <File - RelativePath="spandsp/private/t30.h" - > - </File> - <File - RelativePath="spandsp/private/t31.h" - > - </File> - <File - RelativePath="spandsp/private/t38_core.h" - > - </File> - <File - RelativePath="spandsp/private/t38_gateway.h" - > - </File> - <File - RelativePath="spandsp/private/t38_non_ecm_buffer.h" - > - </File> - <File - RelativePath="spandsp/private/t38_terminal.h" - > - </File> - <File - RelativePath="spandsp/private/t4.h" - > - </File> - <File - RelativePath="spandsp/private/time_scale.h" - > - </File> - <File - RelativePath="spandsp/private/tone_detect.h" - > - </File> - <File - RelativePath="spandsp/private/tone_generate.h" - > - </File> - <File - RelativePath="spandsp/private/v17rx.h" - > - </File> - <File - RelativePath="spandsp/private/v17tx.h" - > - </File> - <File - RelativePath="spandsp/private/v22bis.h" - > - </File> - <File - RelativePath="spandsp/private/v27ter_rx.h" - > - </File> - <File - RelativePath="spandsp/private/v27ter_tx.h" - > - </File> - <File - RelativePath="spandsp/private/v29rx.h" - > - </File> - <File - RelativePath="spandsp/private/v29tx.h" - > - </File> - <File - RelativePath="spandsp/private/v42.h" - > - </File> - <File - RelativePath="spandsp/private/v42bis.h" - > - </File> - <File - RelativePath="spandsp/private/v8.h" - > - </File> - <File - RelativePath="spandsp/queue.h" - > - </File> - <File - RelativePath="spandsp/saturated.h" - > - </File> - <File - RelativePath="spandsp/schedule.h" - > - </File> - <File - RelativePath="spandsp/sig_tone.h" - > - </File> - <File - RelativePath="spandsp/silence_gen.h" - > - </File> - <File - RelativePath="spandsp/super_tone_rx.h" - > - </File> - <File - RelativePath="spandsp/super_tone_tx.h" - > - </File> - <File - RelativePath="spandsp/t30.h" - > - </File> - <File - RelativePath="spandsp/t30_api.h" - > - </File> - <File - RelativePath="spandsp/t30_fcf.h" - > - </File> - <File - RelativePath="spandsp/t30_logging.h" - > - </File> - <File - RelativePath="spandsp/t31.h" - > - </File> - <File - RelativePath="spandsp/t35.h" - > - </File> - <File - RelativePath="spandsp/t38_core.h" - > - </File> - <File - RelativePath="spandsp/t38_gateway.h" - > - </File> - <File - RelativePath="spandsp/t38_non_ecm_buffer.h" - > - </File> - <File - RelativePath="spandsp/t38_terminal.h" - > - </File> - <File - RelativePath="spandsp/t4.h" - > - </File> - <File - RelativePath="spandsp/telephony.h" - > - </File> - <File - RelativePath="spandsp/time_scale.h" - > - </File> - <File - RelativePath="spandsp/timing.h" - > - </File> - <File - RelativePath="spandsp/tone_detect.h" - > - </File> - <File - RelativePath="spandsp/tone_generate.h" - > - </File> - <File - RelativePath="spandsp/v17rx.h" - > - </File> - <File - RelativePath="spandsp/v17tx.h" - > - </File> - <File - RelativePath="spandsp/v22bis.h" - > - </File> - <File - RelativePath="spandsp/v27ter_rx.h" - > - </File> - <File - RelativePath="spandsp/v27ter_tx.h" - > - </File> - <File - RelativePath="spandsp/v29rx.h" - > - </File> - <File - RelativePath="spandsp/v29tx.h" - > - </File> - <File - RelativePath="spandsp/v42.h" - > - </File> - <File - RelativePath="spandsp/v42bis.h" - > - </File> - <File - RelativePath="spandsp/v8.h" - > - </File> - <File - RelativePath="spandsp/vector_float.h" - > - </File> - <File - RelativePath="spandsp/vector_int.h" - > - </File> - <File - RelativePath="spandsp/version.h" - > - </File> - </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> +<File RelativePath="adsi.c"></File> +<File RelativePath="async.c"></File> +<File RelativePath="at_interpreter.c"></File> +<File RelativePath="awgn.c"></File> +<File RelativePath="bell_r2_mf.c"></File> +<File RelativePath="bert.c"></File> +<File RelativePath="bit_operations.c"></File> +<File RelativePath="bitstream.c"></File> +<File RelativePath="complex_filters.c"></File> +<File RelativePath="complex_vector_float.c"></File> +<File RelativePath="complex_vector_int.c"></File> +<File RelativePath="crc.c"></File> +<File RelativePath="dds_float.c"></File> +<File RelativePath="dds_int.c"></File> +<File RelativePath="dtmf.c"></File> +<File RelativePath="echo.c"></File> +<File RelativePath="fax.c"></File> +<File RelativePath="fsk.c"></File> +<File RelativePath="g711.c"></File> +<File RelativePath="g722.c"></File> +<File RelativePath="g726.c"></File> +<File RelativePath="gsm0610_decode.c"></File> +<File RelativePath="gsm0610_encode.c"></File> +<File RelativePath="gsm0610_long_term.c"></File> +<File RelativePath="gsm0610_lpc.c"></File> +<File RelativePath="gsm0610_preprocess.c"></File> +<File RelativePath="gsm0610_rpe.c"></File> +<File RelativePath="gsm0610_short_term.c"></File> +<File RelativePath="hdlc.c"></File> +<File RelativePath="ima_adpcm.c"></File> +<File RelativePath="logging.c"></File> +<File RelativePath="lpc10_analyse.c"></File> +<File RelativePath="lpc10_decode.c"></File> +<File RelativePath="lpc10_encode.c"></File> +<File RelativePath="lpc10_placev.c"></File> +<File RelativePath="lpc10_voicing.c"></File> +<File RelativePath="modem_echo.c"></File> +<File RelativePath="modem_connect_tones.c"></File> +<File RelativePath="noise.c"></File> +<File RelativePath="oki_adpcm.c"></File> +<File RelativePath="playout.c"></File> +<File RelativePath="plc.c"></File> +<File RelativePath="power_meter.c"></File> +<File RelativePath="queue.c"></File> +<File RelativePath="schedule.c"></File> +<File RelativePath="sig_tone.c"></File> +<File RelativePath="silence_gen.c"></File> +<File RelativePath="super_tone_rx.c"></File> +<File RelativePath="super_tone_tx.c"></File> +<File RelativePath="t4.c"></File> +<File RelativePath="t30.c"></File> +<File RelativePath="t30_api.c"></File> +<File RelativePath="t30_logging.c"></File> +<File RelativePath="t31.c"></File> +<File RelativePath="t35.c"></File> +<File RelativePath="t38_core.c"></File> +<File RelativePath="t38_gateway.c"></File> +<File RelativePath="t38_non_ecm_buffer.c"></File> +<File RelativePath="t38_terminal.c"></File> +<File RelativePath="testcpuid.c"></File> +<File RelativePath="time_scale.c"></File> +<File RelativePath="tone_detect.c"></File> +<File RelativePath="tone_generate.c"></File> +<File RelativePath="v17rx.c"></File> +<File RelativePath="v17tx.c"></File> +<File RelativePath="v22bis_rx.c"></File> +<File RelativePath="v22bis_tx.c"></File> +<File RelativePath="v27ter_rx.c"></File> +<File RelativePath="v27ter_tx.c"></File> +<File RelativePath="v29rx.c"></File> +<File RelativePath="v29tx.c"></File> +<File RelativePath="v42.c"></File> +<File RelativePath="v42bis.c"></File> +<File RelativePath="v8.c"></File> +<File RelativePath="vector_float.c"></File> +<File RelativePath="vector_int.c"></File> +<File RelativePath=".\msvc\gettimeofday.c"></File> +</Filter><Filter Name="Header Files"> +<File RelativePath="spandsp/adsi.h"></File> +<File RelativePath="spandsp/async.h"></File> +<File RelativePath="spandsp/arctan2.h"></File> +<File RelativePath="spandsp/at_interpreter.h"></File> +<File RelativePath="spandsp/awgn.h"></File> +<File RelativePath="spandsp/bell_r2_mf.h"></File> +<File RelativePath="spandsp/bert.h"></File> +<File RelativePath="spandsp/biquad.h"></File> +<File RelativePath="spandsp/bit_operations.h"></File> +<File RelativePath="spandsp/bitstream.h"></File> +<File RelativePath="spandsp/crc.h"></File> +<File RelativePath="spandsp/complex.h"></File> +<File RelativePath="spandsp/complex_filters.h"></File> +<File RelativePath="spandsp/complex_vector_float.h"></File> +<File RelativePath="spandsp/complex_vector_int.h"></File> +<File RelativePath="spandsp/dc_restore.h"></File> +<File RelativePath="spandsp/dds.h"></File> +<File RelativePath="spandsp/dtmf.h"></File> +<File RelativePath="spandsp/echo.h"></File> +<File RelativePath="spandsp/fast_convert.h"></File> +<File RelativePath="spandsp/fax.h"></File> +<File RelativePath="spandsp/fax_modems.h"></File> +<File RelativePath="spandsp/fir.h"></File> +<File RelativePath="spandsp/fsk.h"></File> +<File RelativePath="spandsp/g168models.h"></File> +<File RelativePath="spandsp/g711.h"></File> +<File RelativePath="spandsp/g722.h"></File> +<File RelativePath="spandsp/g726.h"></File> +<File RelativePath="spandsp/gsm0610.h"></File> +<File RelativePath="spandsp/hdlc.h"></File> +<File RelativePath="spandsp/ima_adpcm.h"></File> +<File RelativePath="spandsp/logging.h"></File> +<File RelativePath="spandsp/lpc10.h"></File> +<File RelativePath="spandsp/modem_echo.h"></File> +<File RelativePath="spandsp/modem_connect_tones.h"></File> +<File RelativePath="spandsp/noise.h"></File> +<File RelativePath="spandsp/oki_adpcm.h"></File> +<File RelativePath="spandsp/playout.h"></File> +<File RelativePath="spandsp/plc.h"></File> +<File RelativePath="spandsp/power_meter.h"></File> +<File RelativePath="spandsp/queue.h"></File> +<File RelativePath="spandsp/saturated.h"></File> +<File RelativePath="spandsp/schedule.h"></File> +<File RelativePath="spandsp/sig_tone.h"></File> +<File RelativePath="spandsp/silence_gen.h"></File> +<File RelativePath="spandsp/super_tone_rx.h"></File> +<File RelativePath="spandsp/super_tone_tx.h"></File> +<File RelativePath="spandsp/t4.h"></File> +<File RelativePath="spandsp/t30.h"></File> +<File RelativePath="spandsp/t30_api.h"></File> +<File RelativePath="spandsp/t30_fcf.h"></File> +<File RelativePath="spandsp/t30_logging.h"></File> +<File RelativePath="spandsp/t31.h"></File> +<File RelativePath="spandsp/t35.h"></File> +<File RelativePath="spandsp/t38_core.h"></File> +<File RelativePath="spandsp/t38_gateway.h"></File> +<File RelativePath="spandsp/t38_non_ecm_buffer.h"></File> +<File RelativePath="spandsp/t38_terminal.h"></File> +<File RelativePath="spandsp/telephony.h"></File> +<File RelativePath="spandsp/time_scale.h"></File> +<File RelativePath="spandsp/timing.h"></File> +<File RelativePath="spandsp/tone_detect.h"></File> +<File RelativePath="spandsp/tone_generate.h"></File> +<File RelativePath="spandsp/v17rx.h"></File> +<File RelativePath="spandsp/v17tx.h"></File> +<File RelativePath="spandsp/v22bis.h"></File> +<File RelativePath="spandsp/v27ter_rx.h"></File> +<File RelativePath="spandsp/v27ter_tx.h"></File> +<File RelativePath="spandsp/v29rx.h"></File> +<File RelativePath="spandsp/v29tx.h"></File> +<File RelativePath="spandsp/v42.h"></File> +<File RelativePath="spandsp/v42bis.h"></File> +<File RelativePath="spandsp/v8.h"></File> +<File RelativePath="spandsp/vector_float.h"></File> +<File RelativePath="spandsp/vector_int.h"></File> +<File RelativePath="spandsp/version.h"></File> +<File RelativePath="spandsp/private/adsi.h"></File> +<File RelativePath="spandsp/private/async.h"></File> +<File RelativePath="spandsp/private/at_interpreter.h"></File> +<File RelativePath="spandsp/private/awgn.h"></File> +<File RelativePath="spandsp/private/bell_r2_mf.h"></File> +<File RelativePath="spandsp/private/bert.h"></File> +<File RelativePath="spandsp/private/bitstream.h"></File> +<File RelativePath="spandsp/private/dtmf.h"></File> +<File RelativePath="spandsp/private/fax.h"></File> +<File RelativePath="spandsp/private/fax_modems.h"></File> +<File RelativePath="spandsp/private/fsk.h"></File> +<File RelativePath="spandsp/private/g711.h"></File> +<File RelativePath="spandsp/private/g722.h"></File> +<File RelativePath="spandsp/private/g726.h"></File> +<File RelativePath="spandsp/private/gsm0610.h"></File> +<File RelativePath="spandsp/private/hdlc.h"></File> +<File RelativePath="spandsp/private/ima_adpcm.h"></File> +<File RelativePath="spandsp/private/logging.h"></File> +<File RelativePath="spandsp/private/lpc10.h"></File> +<File RelativePath="spandsp/private/modem_connect_tones.h"></File> +<File RelativePath="spandsp/private/noise.h"></File> +<File RelativePath="spandsp/private/oki_adpcm.h"></File> +<File RelativePath="spandsp/private/queue.h"></File> +<File RelativePath="spandsp/private/schedule.h"></File> +<File RelativePath="spandsp/private/sig_tone.h"></File> +<File RelativePath="spandsp/private/super_tone_rx.h"></File> +<File RelativePath="spandsp/private/super_tone_tx.h"></File> +<File RelativePath="spandsp/private/t30.h"></File> +<File RelativePath="spandsp/private/t31.h"></File> +<File RelativePath="spandsp/private/t38_core.h"></File> +<File RelativePath="spandsp/private/t38_gateway.h"></File> +<File RelativePath="spandsp/private/t38_non_ecm_buffer.h"></File> +<File RelativePath="spandsp/private/t38_terminal.h"></File> +<File RelativePath="spandsp/private/t4.h"></File> +<File RelativePath="spandsp/private/time_scale.h"></File> +<File RelativePath="spandsp/private/tone_detect.h"></File> +<File RelativePath="spandsp/private/tone_generate.h"></File> +<File RelativePath="spandsp/private/v17rx.h"></File> +<File RelativePath="spandsp/private/v17tx.h"></File> +<File RelativePath="spandsp/private/v22bis.h"></File> +<File RelativePath="spandsp/private/v27ter_rx.h"></File> +<File RelativePath="spandsp/private/v27ter_tx.h"></File> +<File RelativePath="spandsp/private/v29rx.h"></File> +<File RelativePath="spandsp/private/v29tx.h"></File> +<File RelativePath="spandsp/private/v42.h"></File> +<File RelativePath="spandsp/private/v42bis.h"></File> +<File RelativePath="spandsp/private/v8.h"></File> +<File RelativePath="spandsp/expose.h"></File> +<File RelativePath="spandsp.h"></File> + </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/libs/spandsp/src/logging.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/logging.c (original) +++ freeswitch/trunk/libs/spandsp/src/logging.c Tue Feb 3 12:50:18 2009 @@ -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: logging.c,v 1.29 2009/01/20 04:24:45 steveu Exp $ + * $Id: logging.c,v 1.30 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -83,7 +83,7 @@ } /*- End of function --------------------------------------------------------*/ -int span_log(logging_state_t *s, int level, const char *format, ...) +SPAN_DECLARE(int) span_log(logging_state_t *s, int level, const char *format, ...) { char msg[1024 + 1]; va_list arg_ptr; Modified: freeswitch/trunk/libs/spandsp/src/lpc10_decode.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/lpc10_decode.c (original) +++ freeswitch/trunk/libs/spandsp/src/lpc10_decode.c Tue Feb 3 12:50:18 2009 @@ -26,7 +26,7 @@ * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. * - * $Id: lpc10_decode.c,v 1.25 2009/01/28 03:41:27 steveu Exp $ + * $Id: lpc10_decode.c,v 1.26 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) @@ -46,6 +46,7 @@ #include <memory.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/lpc10.h" #include "spandsp/private/lpc10.h" @@ -1102,7 +1103,7 @@ synths(s, voice, &pitch, &rms, rc, speech); base = i*LPC10_SAMPLES_PER_FRAME; for (j = 0; j < LPC10_SAMPLES_PER_FRAME; j++) - amp[base + j] = (int16_t) lrintf(32768.0f*speech[j]); + amp[base + j] = (int16_t) lfastrintf(32768.0f*speech[j]); } return len*LPC10_SAMPLES_PER_FRAME; Modified: freeswitch/trunk/libs/spandsp/src/lpc10_encode.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/lpc10_encode.c (original) +++ freeswitch/trunk/libs/spandsp/src/lpc10_encode.c Tue Feb 3 12:50:18 2009 @@ -26,7 +26,7 @@ * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. * - * $Id: lpc10_encode.c,v 1.26 2009/01/28 03:41:27 steveu Exp $ + * $Id: lpc10_encode.c,v 1.27 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) Modified: freeswitch/trunk/libs/spandsp/src/lpc10_voicing.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/lpc10_voicing.c (original) +++ freeswitch/trunk/libs/spandsp/src/lpc10_voicing.c Tue Feb 3 12:50:18 2009 @@ -26,7 +26,7 @@ * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. * - * $Id: lpc10_voicing.c,v 1.17 2009/01/28 03:41:27 steveu Exp $ + * $Id: lpc10_voicing.c,v 1.18 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) @@ -46,6 +46,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/lpc10.h" #include "spandsp/private/lpc10.h" @@ -158,11 +159,11 @@ /* Normalize ZC, LBE, and FBE to old fixed window length of 180. */ /* (The fraction 90/VLEN has a range of 0.58 to 1) */ r2 = (float) (*zc << 1); - *zc = lrintf(r2*(90.0f/vlen)); + *zc = lfastrintf(r2*(90.0f/vlen)); r1 = lp_rms/4*(90.0f/vlen); - *lbe = min(lrintf(r1), 32767); + *lbe = min(lfastrintf(r1), 32767); r1 = ap_rms/4*(90.0f/vlen); - *fbe = min(lrintf(r1), 32767); + *fbe = min(lfastrintf(r1), 32767); } /*- End of function --------------------------------------------------------*/ @@ -323,7 +324,7 @@ /* running average full-band voiced energy to the running average */ /* full-band unvoiced energy. SNR filter has gain of 63. */ r1 = (s->snr + s->fbve/(float) max(s->fbue, 1))*63/64.0f; - s->snr = (float) lrintf(r1); + s->snr = (float) lfastrintf(r1); snr2 = s->snr*s->fbue/max(s->lbue, 1); /* Quantize SNR to SNRL according to VDCL thresholds. */ i1 = nvdcl - 1; @@ -465,18 +466,18 @@ if (s->voibuf[3][half] == 0) { r1 = (s->sfbue*63 + (min(fbe, s->ofbue*3) << 3))/64.0f; - s->sfbue = lrintf(r1); + s->sfbue = lfastrintf(r1); s->fbue = s->sfbue/8; s->ofbue = fbe; r1 = (s->slbue*63 + (min(lbe, s->olbue*3) << 3))/64.0f; - s->slbue = lrintf(r1); + s->slbue = lfastrintf(r1); s->lbue = s->slbue/8; s->olbue = lbe; } else { - s->lbve = lrintf((s->lbve*63 + lbe)/64.0f); - s->fbve = lrintf((s->fbve*63 + fbe)/64.0f); + s->lbve = lfastrintf((s->lbve*63 + lbe)/64.0f); + s->fbve = lfastrintf((s->fbve*63 + fbe)/64.0f); } /* Set dither threshold to yield proper zero crossing rates in the */ /* presence of low frequency noise and low level signal input. */ Modified: freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c (original) +++ freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c Tue Feb 3 12:50:18 2009 @@ -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.32 2009/01/29 18:30:14 steveu Exp $ + * $Id: modem_connect_tones.c,v 1.33 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -45,6 +45,7 @@ #include <stdio.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/dds.h" @@ -87,8 +88,8 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s, - int16_t amp[], - int len) + int16_t amp[], + int len) { int16_t mod; int i; @@ -197,7 +198,7 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(modem_connect_tones_tx_state_t *) modem_connect_tones_tx_init(modem_connect_tones_tx_state_t *s, - int tone_type) + int tone_type) { int alloced; @@ -326,7 +327,7 @@ s->flags_seen = 0; if (++s->flags_seen >= HDLC_FRAMING_OK_THRESHOLD && !s->framing_ok_announced) { - report_tone_state(s, MODEM_CONNECT_TONES_FAX_PREAMBLE, lrintf(fsk_rx_signal_power(&(s->v21rx)))); + report_tone_state(s, MODEM_CONNECT_TONES_FAX_PREAMBLE, lfastrintf(fsk_rx_signal_power(&(s->v21rx)))); s->framing_ok_announced = TRUE; } } @@ -366,7 +367,7 @@ famp = v1 - 1.2994747954630f*s->z1 + s->z2; s->z2 = s->z1; s->z1 = v1; - notched = (int16_t) lrintf(famp); + notched = (int16_t) lfastrintf(famp); /* Estimate the overall energy in the channel, and the energy in the notch (i.e. overall channel energy - tone energy => noise). @@ -379,7 +380,7 @@ if (s->tone_present != MODEM_CONNECT_TONES_FAX_CNG) { if (++s->tone_cycle_duration >= ms_to_samples(415)) - report_tone_state(s, MODEM_CONNECT_TONES_FAX_CNG, lrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); + report_tone_state(s, MODEM_CONNECT_TONES_FAX_CNG, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } } else @@ -409,7 +410,7 @@ famp = v1 + 0.1567596f*s->z1 + s->z2; s->z2 = s->z1; s->z1 = v1; - notched = (int16_t) lrintf(famp); + notched = (int16_t) lfastrintf(famp); /* Estimate the overall energy in the channel, and the energy in the notch (i.e. overall channel energy - tone energy => noise). Use abs instead of multiply for speed (is it really faster?). @@ -442,7 +443,7 @@ if (s->tone_cycle_duration >= ms_to_samples(450 - 25)) { if (++s->good_cycles == 3) - report_tone_state(s, MODEM_CONNECT_TONES_ANS_PR, lrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); + report_tone_state(s, MODEM_CONNECT_TONES_ANS_PR, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } else { @@ -456,7 +457,7 @@ if (s->tone_cycle_duration >= ms_to_samples(550)) { if (s->tone_present == MODEM_CONNECT_TONES_NONE) - report_tone_state(s, MODEM_CONNECT_TONES_ANS, lrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); + report_tone_state(s, MODEM_CONNECT_TONES_ANS, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); s->good_cycles = 0; s->tone_cycle_duration = ms_to_samples(550); } @@ -500,9 +501,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(modem_connect_tones_rx_state_t *) modem_connect_tones_rx_init(modem_connect_tones_rx_state_t *s, - int tone_type, - tone_report_func_t tone_callback, - void *user_data) + int tone_type, + tone_report_func_t tone_callback, + void *user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/modem_echo.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/modem_echo.c (original) +++ freeswitch/trunk/libs/spandsp/src/modem_echo.c Tue Feb 3 12:50:18 2009 @@ -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: modem_echo.c,v 1.24 2009/01/28 03:41:27 steveu Exp $ + * $Id: modem_echo.c,v 1.25 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/msvc/config.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/msvc/config.h (original) +++ freeswitch/trunk/libs/spandsp/src/msvc/config.h Tue Feb 3 12:50:18 2009 @@ -1,7 +1,7 @@ /* * SpanDSP - a series of DSP components for telephony * - * inttypes.h - a fudge for MSVC, which lacks this header + * config.h - a fudge for MSVC, which lacks this header * * Written by Steve Underwood <steveu@coppice.org> * @@ -10,7 +10,7 @@ * * This file is released in the public domain. * - * $Id: config.h,v 1.1 2009/01/29 18:30:14 steveu Exp $ + * $Id: config.h,v 1.2 2009/02/03 16:39:41 steveu Exp $ */ #if !defined(_MSVC_CONFIG_H_) @@ -32,6 +32,8 @@ #define HAVE_MATH_H #define HAVE_TGMATH_H +#define HAVE_LONG_DOUBLE + #define SPANDSP_USE_EXPORT_CAPABILITY 1 #ifdef __cplusplus Modified: freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h (original) +++ freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h Tue Feb 3 12:50:18 2009 @@ -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: spandsp.h.in,v 1.15 2009/01/31 08:48:10 steveu Exp $ + * $Id: spandsp.h.in,v 1.16 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -33,6 +33,7 @@ #undef SPANDSP_USE_FIXED_POINT #undef SPANDSP_MISALIGNED_ACCESS_FAILS +#define SPANDSP_USE_EXPORT_CAPABILITY 1 #include <stdlib.h> #include <inttypes.h> @@ -43,6 +44,7 @@ #include <tiffio.h> #include <spandsp/telephony.h> +#include <spandsp/fast_convert.h> #include <spandsp/logging.h> #include <spandsp/complex.h> #include <spandsp/bit_operations.h> Modified: freeswitch/trunk/libs/spandsp/src/noise.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/noise.c (original) +++ freeswitch/trunk/libs/spandsp/src/noise.c Tue Feb 3 12:50:18 2009 @@ -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: noise.c,v 1.29 2009/01/31 08:48:10 steveu Exp $ + * $Id: noise.c,v 1.30 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -45,6 +45,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/noise.h" Modified: freeswitch/trunk/libs/spandsp/src/oki_adpcm.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/oki_adpcm.c (original) +++ freeswitch/trunk/libs/spandsp/src/oki_adpcm.c Tue Feb 3 12:50:18 2009 @@ -27,7 +27,7 @@ * The actual OKI ADPCM encode and decode method is derived from freely * available code, whose exact origins seem uncertain. * - * $Id: oki_adpcm.c,v 1.30 2009/01/05 13:48:31 steveu Exp $ + * $Id: oki_adpcm.c,v 1.31 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -266,9 +266,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) oki_adpcm_decode(oki_adpcm_state_t *s, - int16_t amp[], - const uint8_t oki_data[], - int oki_bytes) + int16_t amp[], + const uint8_t oki_data[], + int oki_bytes) { int i; int x; @@ -319,9 +319,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) oki_adpcm_encode(oki_adpcm_state_t *s, - uint8_t oki_data[], - const int16_t amp[], - int len) + uint8_t oki_data[], + const int16_t amp[], + int len) { int x; int l; Modified: freeswitch/trunk/libs/spandsp/src/playout.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/playout.c (original) +++ freeswitch/trunk/libs/spandsp/src/playout.c Tue Feb 3 12:50:18 2009 @@ -29,7 +29,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: playout.c,v 1.15 2009/01/05 13:48:31 steveu Exp $ + * $Id: playout.c,v 1.16 2009/02/03 16:28:39 steveu Exp $ */ #if defined(HAVE_CONFIG_H) Modified: freeswitch/trunk/libs/spandsp/src/plc.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/plc.c (original) +++ freeswitch/trunk/libs/spandsp/src/plc.c Tue Feb 3 12:50:18 2009 @@ -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: plc.c,v 1.25 2009/01/28 03:41:27 steveu Exp $ + * $Id: plc.c,v 1.26 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ @@ -45,6 +45,7 @@ #include <limits.h> #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/plc.h" Modified: freeswitch/trunk/libs/spandsp/src/power_meter.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/power_meter.c (original) +++ freeswitch/trunk/libs/spandsp/src/power_meter.c Tue Feb 3 12:50:18 2009 @@ -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: power_meter.c,v 1.26 2009/01/28 03:41:27 steveu Exp $ + * $Id: power_meter.c,v 1.27 2009/02/03 16:28:39 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/queue.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/queue.c (original) +++ freeswitch/trunk/libs/spandsp/src/queue.c Tue Feb 3 12:50:18 2009 @@ -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.27 2009/01/31 08:48:10 steveu Exp $ + * $Id: queue.c,v 1.28 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/schedule.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/schedule.c (original) +++ freeswitch/trunk/libs/spandsp/src/schedule.c Tue Feb 3 12:50:18 2009 @@ -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: schedule.c,v 1.20 2009/01/05 13:48:31 steveu Exp $ + * $Id: schedule.c,v 1.21 2009/02/03 16:28:40 steveu Exp $ */ #if defined(HAVE_CONFIG_H) Modified: freeswitch/trunk/libs/spandsp/src/sig_tone.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/sig_tone.c (original) +++ freeswitch/trunk/libs/spandsp/src/sig_tone.c Tue Feb 3 12:50:18 2009 @@ -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.29 2009/01/30 07:19:25 steveu Exp $ + * $Id: sig_tone.c,v 1.30 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #undef SPANDSP_USE_FIXED_POINT #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/saturated.h" #include "spandsp/complex.h" Modified: freeswitch/trunk/libs/spandsp/src/silence_gen.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/silence_gen.c (original) +++ freeswitch/trunk/libs/spandsp/src/silence_gen.c Tue Feb 3 12:50:18 2009 @@ -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: silence_gen.c,v 1.17 2009/01/28 03:41:27 steveu Exp $ + * $Id: silence_gen.c,v 1.18 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -131,7 +131,7 @@ /* The following dummy routines, to absorb data, don't really have a proper home, so they have been put here. */ -int span_dummy_rx(void *user_data, const int16_t amp[], int len) +SPAN_DECLARE(int) span_dummy_rx(void *user_data, const int16_t amp[], int len) { return 0; } Modified: freeswitch/trunk/libs/spandsp/src/spandsp.h.in ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp.h.in (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp.h.in Tue Feb 3 12:50:18 2009 @@ -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: spandsp.h.in,v 1.15 2009/01/31 08:48:10 steveu Exp $ + * $Id: spandsp.h.in,v 1.16 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -44,6 +44,7 @@ #include <tiffio.h> #include <spandsp/telephony.h> +#include <spandsp/fast_convert.h> #include <spandsp/logging.h> #include <spandsp/complex.h> #include <spandsp/bit_operations.h> Modified: freeswitch/trunk/libs/spandsp/src/spandsp/adsi.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/adsi.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/adsi.h Tue Feb 3 12:50:18 2009 @@ -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: adsi.h,v 1.34 2009/01/31 08:48:11 steveu Exp $ + * $Id: adsi.h,v 1.35 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/async.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/async.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/async.h Tue Feb 3 12:50:18 2009 @@ -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: async.h,v 1.20 2009/01/31 08:48:11 steveu Exp $ + * $Id: async.h,v 1.21 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -151,18 +151,18 @@ \param user_data An opaque pointer. \return A pointer to the initialised context, or NULL if there was a problem. */ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s, - int data_bits, - int parity_bits, - int stop_bits, - int use_v14, - get_byte_func_t get_byte, - void *user_data); + int data_bits, + int parity_bits, + int stop_bits, + int use_v14, + get_byte_func_t get_byte, + void *user_data); /*! Get the next bit of a transmitted serial bit stream. \brief Get the next bit of a transmitted serial bit stream. \param user_data An opaque point which must point to a transmitter context. \return the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended. */ -int async_tx_get_bit(void *user_data); +SPAN_DECLARE(int) async_tx_get_bit(void *user_data); /*! Initialise an asynchronous data receiver context. \brief Initialise an asynchronous data receiver context. @@ -175,12 +175,12 @@ \param user_data An opaque pointer. \return A pointer to the initialised context, or NULL if there was a problem. */ SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s, - int data_bits, - int parity_bits, - int stop_bits, - int use_v14, - put_byte_func_t put_byte, - void *user_data); + int data_bits, + int parity_bits, + int stop_bits, + int use_v14, + put_byte_func_t put_byte, + void *user_data); /*! Accept a bit from a received serial bit stream \brief Accept a bit from a received serial bit stream @@ -191,7 +191,7 @@ - SIG_STATUS_TRAINING_SUCCEEDED - SIG_STATUS_TRAINING_FAILED - SIG_STATUS_END_OF_DATA */ -void async_rx_put_bit(void *user_data, int bit); +SPAN_DECLARE(void) async_rx_put_bit(void *user_data, int bit); #if defined(__cplusplus) } Modified: freeswitch/trunk/libs/spandsp/src/spandsp/at_interpreter.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/at_interpreter.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/at_interpreter.h Tue Feb 3 12:50:18 2009 @@ -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: at_interpreter.h,v 1.21 2009/01/31 08:48:11 steveu Exp $ + * $Id: at_interpreter.h,v 1.22 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -174,10 +174,10 @@ \param modem_control_user_data x. \return A pointer to the AT context, or NULL if there was a problem. */ SPAN_DECLARE(at_state_t *) at_init(at_state_t *s, - at_tx_handler_t *at_tx_handler, - void *at_tx_user_data, - at_modem_control_handler_t *modem_control_handler, - void *modem_control_user_data); + at_tx_handler_t *at_tx_handler, + void *at_tx_user_data, + at_modem_control_handler_t *modem_control_handler, + void *modem_control_user_data); /*! Free an AT interpreter context. \brief Free an AT interpreter context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/awgn.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/awgn.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/awgn.h Tue Feb 3 12:50:18 2009 @@ -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: awgn.h,v 1.16 2009/01/31 08:48:11 steveu Exp $ + * $Id: awgn.h,v 1.17 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/bell_r2_mf.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/bell_r2_mf.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/bell_r2_mf.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.22 2009/01/31 08:48:11 steveu Exp $ + * $Id: bell_r2_mf.h,v 1.23 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -206,8 +206,8 @@ and supplied in callbacks. \return A pointer to the Bell MF receiver context.*/ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s, - digits_rx_callback_t callback, - void *user_data); + digits_rx_callback_t callback, + void *user_data); /*! \brief Free a Bell MF receiver context. \param s The Bell MF receiver context. @@ -238,9 +238,9 @@ and supplied in callbacks. \return A pointer to the R2 MF receiver context. */ SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s, - int fwd, - tone_report_func_t callback, - void *user_data); + int fwd, + tone_report_func_t callback, + void *user_data); /*! \brief Free an R2 MF receiver context. \param s The R2 MF receiver context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/bert.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/bert.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/bert.h Tue Feb 3 12:50:18 2009 @@ -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: bert.h,v 1.21 2009/01/31 08:48:11 steveu Exp $ + * $Id: bert.h,v 1.22 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_BERT_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/bitstream.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/bitstream.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/bitstream.h Tue Feb 3 12:50:18 2009 @@ -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: bitstream.h,v 1.12 2008/11/30 12:45:09 steveu Exp $ + * $Id: bitstream.h,v 1.13 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -50,30 +50,30 @@ \param c A pointer to the bitstream output buffer. \param value The value to be pushed into the output buffer. \param bits The number of bits of value to be pushed. 1 to 25 bits is valid. */ -void bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); +SPAN_DECLARE(void) bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); -void bitstream_put2(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); +SPAN_DECLARE(void) bitstream_put2(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); /*! \brief Get a chunk of bits from the input buffer. \param s A pointer to the bitstream context. \param c A pointer to the bitstream input buffer. \param bits The number of bits of value to be grabbed. 1 to 25 bits is valid. \return The value retrieved from the input buffer. */ -uint32_t bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits); +SPAN_DECLARE(uint32_t) bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits); -uint32_t bitstream_get2(bitstream_state_t *s, const uint8_t **c, int bits); +SPAN_DECLARE(uint32_t) bitstream_get2(bitstream_state_t *s, const uint8_t **c, int bits); /*! \brief Flush any residual bit to the output buffer. \param s A pointer to the bitstream context. \param c A pointer to the bitstream output buffer. */ -void bitstream_flush(bitstream_state_t *s, uint8_t **c); +SPAN_DECLARE(void) bitstream_flush(bitstream_state_t *s, uint8_t **c); -void bitstream_flush2(bitstream_state_t *s, uint8_t **c); +SPAN_DECLARE(void) bitstream_flush2(bitstream_state_t *s, uint8_t **c); /*! \brief Initialise a bitstream context. \param s A pointer to the bitstream context. \return A pointer to the bitstream context. */ -bitstream_state_t *bitstream_init(bitstream_state_t *s); +SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s); #if defined(__cplusplus) } Modified: freeswitch/trunk/libs/spandsp/src/spandsp/complex_filters.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/complex_filters.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/complex_filters.h Tue Feb 3 12:50:18 2009 @@ -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: complex_filters.h,v 1.13 2009/01/31 08:48:11 steveu Exp $ + * $Id: complex_filters.h,v 1.14 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_COMPLEX_FILTERS_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/dtmf.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/dtmf.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/dtmf.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.30 2009/01/31 08:48:11 steveu Exp $ + * $Id: dtmf.h,v 1.31 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_DTMF_H_) @@ -192,8 +192,8 @@ and supplied in callbacks. \return A pointer to the DTMF receiver context. */ SPAN_DECLARE(dtmf_rx_state_t *) dtmf_rx_init(dtmf_rx_state_t *s, - digits_rx_callback_t callback, - void *user_data); + digits_rx_callback_t callback, + void *user_data); /*! \brief Free a DTMF receiver context. \param s The DTMF receiver context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/echo.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/echo.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/echo.h Tue Feb 3 12:50:18 2009 @@ -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: echo.h,v 1.17 2009/01/31 08:48:11 steveu Exp $ + * $Id: echo.h,v 1.18 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Added: freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h Tue Feb 3 12:50:18 2009 @@ -0,0 +1,402 @@ +/* + * SpanDSP - a series of DSP components for telephony + * + * fast_convert.h - Quick ways to convert floating point numbers to integers + * + * Written by Steve Underwood <steveu@coppice.org> + * + * Copyright (C) 2009 Steve Underwood + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1, + * as published by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: fast_convert.h,v 1.1 2009/02/03 16:28:41 steveu Exp $ + */ + +#if !defined(_SPANDSP_FAST_CONVERT_H_) +#define _SPANDSP_FAST_CONVERT_H_ + +#if defined(__cplusplus) +extern "C" +{ +#endif + +/* The following code, to handle issues with lrint() and lrintf() on various + * platforms, is adapted from similar code in libsndfile, which is: + * + * Copyright (C) 2001-2004 Erik de Castro Lopo <erikd@mega-nerd.com> + * + * This program 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 program 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. + */ + +/* + * On Intel Pentium processors (especially PIII and probably P4), converting + * from float to int is very slow. To meet the C specs, the code produced by + * most C compilers targeting Pentium needs to change the FPU rounding mode + * before the float to int conversion is performed. + * + * Changing the FPU rounding mode causes the FPU pipeline to be flushed. It + * is this flushing of the pipeline which is so slow. + * + * Fortunately the ISO C99 specification defines the functions lrint, lrintf, + * llrint and llrintf which fix this problem as a side effect. + * + * On Unix-like systems, the configure process should have detected the + * presence of these functions. If they weren't found we have to replace them + * here with a standard C cast. + */ + +/* + * The C99 prototypes for these functions are as follows: + * + * int rintf(float x); + * int rint(double x); + * long int lrintf(float x); + * long int lrint(double x); + * long long int llrintf(float x); + * long long int llrint(double x); + * + * The presence of the required functions are detected during the configure + * process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in + * the config file. + */ + +#if defined(__CYGWIN__) + /* + * CYGWIN has lrint and lrintf functions, but they are slow and buggy: + * http://sourceware.org/ml/cygwin/2005-06/msg00153.html + * http://sourceware.org/ml/cygwin/2005-09/msg00047.html + * The latest version of cygwin seems to have made no effort to fix this. + * These replacement functions (pulled from the Public Domain MinGW + * math.h header) replace the native versions. + */ +#if 0 + static __inline__ long int lrint(double x) + { + long int retval; + + __asm__ __volatile__ + ( + "fistpl %0" + : "=m" (retval) + : "t" (x) + : "st" + ); + + return retval; + } + + static __inline__ long int lrintf(float x) + { + long int retval; + + __asm__ __volatile__ + ( + "fistpl %0" + : "=m" (retval) + : "t" (x) + : "st" + ); + return retval; + } +#endif + + static __inline__ long int lfastrint(double x) + { + long int retval; + + __asm__ __volatile__ + ( + "fistpl %0" + : "=m" (retval) + : "t" (x) + : "st" + ); + + return retval; + } + + static __inline__ long int lfastrintf(float x) + { + long int retval; + + __asm__ __volatile__ + ( + "fistpl %0" + : "=m" (retval) + : "t" (x) + : "st" + ); + return retval; + } +#elif defined(HAVE_LRINT) && defined(HAVE_LRINTF) + +#if defined(__i386__) + /* These routines are guaranteed fast on an i386 machine. Using the built in + lrint() and lrintf() should be similar, but they may not always be enabled. + Sometimes, especially with "-O0", you might get slow calls to routines. */ + static __inline__ long int lfastrint(double x) + { + long int retval; + + __asm__ __volatile__ + ( + "fistpl %0" + : "=m" (retval) + : "t" (x) + : "st" + ); + + return retval; + } + + static __inline__ long int lfastrintf(float x) + { + long int retval; + + __asm__ __volatile__ + ( + "fistpl %0" + : "=m" (retval) + : "t" (x) + : "st" + ); + return retval; + } +#elif defined(__x86_64__) + /* On an x86_64 machine, the fastest thing seems to be a pure assignment from a + double or float to an int. It looks like the design on the x86_64 took account + of the default behaviour specified for C. */ + static __inline__ long int lfastrint(double x) + { + return (long int) (x); + } + + static __inline__ long int lfastrintf(float x) + { + return (long int) (x); + } +#elif defined(__ppc__) || defined(__powerpc__) + static __inline__ long int lfastrint(register double x) + { + int res[2]; + + __asm__ __volatile__ + ( + "fctiw %1, %1\n\t" + "stfd %1, %0" + : "=m" (res) /* Output */ + : "f" (x) /* Input */ + : "memory" + ); + + return res[1]; + } + + static __inline__ long int lfastrintf(register float x) + { + int res[2]; + + __asm__ __volatile__ + ( + "fctiw %1, %1\n\t" + "stfd %1, %0" + : "=m" (res) /* Output */ + : "f" (x) /* Input */ + : "memory" + ); + + return res[1]; + } +#endif + +#elif defined(WIN32) || defined(_WIN32) + /* + * Win32 doesn't seem to have the lrint() and lrintf() functions. + * Therefore implement inline versions of these functions here. + */ + __inline long int lrint(double x) + { + long int i; + + _asm + { + fld x + fistp i + }; + return i; + } + + __inline long int lrintf(float x) + { + long int i; + + _asm + { + fld x + fistp i + }; + 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; + + _asm + { + fld x + fistp i + }; + return i; + } + + __inline long int lfastrintf(float x) + { + long int i; + + _asm + { + fld x + fistp i + }; + return i; + } +#elif defined(WIN64) || defined(_WIN64) + /* Win64 machines will do best with a simple assignment. */ + + __inline long int lfastrint(double x) + { + return (long int) (x); + } + + __inline long int lfastrintf(float x) + { + return (long int) (x); + } +#elif defined(__MWERKS__) && defined(macintosh) + /* This MacOS 9 solution was provided by Stephane Letz */ + + long int __inline__ lfastrint(register double x) + { + long int res[2]; + + asm + { + fctiw x, x + stfd x, res + } + return res[1]; + } + + long int __inline__ lfastrintf(register float x) + { + long int res[2]; + + asm + { + fctiw x, x + stfd x, res + } + return res[1]; + } +#elif defined(__MACH__) && defined(__APPLE__) && (defined(__ppc__) || defined(__powerpc__)) + /* For Apple Mac OS/X - do recent versions still need this? */ + + static __inline__ long int lfastrint(register double x) + { + int res[2]; + + __asm__ __volatile__ + ( + "fctiw %1, %1\n\t" + "stfd %1, %0" + : "=m" (res) /* Output */ + : "f" (x) /* Input */ + : "memory" + ); + + return res[1]; + } + + static __inline__ long int lfastrintf(register float x) + { + int res[2]; + + __asm__ __volatile__ + ( + "fctiw %1, %1\n\t" + "stfd %1, %0" + : "=m" (res) /* Output */ + : "f" (x) /* Input */ + : "memory" + ); + + return res[1]; + } +#else + /* There is nothing else to do, but use a simple casting operation, instead of a real + rint() type function. Since we are only trying to use rint() to speed up conversions, + the accuracy issues related to changing the rounding scheme are of little concern + to us. */ + + #if !defined(__sgi) + #warning "No usable lrint() and lrintf() functions available." + #warning "Replacing these functions with a simple C cast." + #endif + + static __inline__ long int lfastrint(double x) + { + return (long int) (x); + } + + static __inline__ long int lfastrintf(float x) + { + return (long int) (x); + } +#endif + +#if defined(__cplusplus) +} +#endif + +#endif + +/*- End of file ------------------------------------------------------------*/ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/fax.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/fax.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/fax.h Tue Feb 3 12:50:18 2009 @@ -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: fax.h,v 1.37 2009/01/31 08:48:11 steveu Exp $ + * $Id: fax.h,v 1.38 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h Tue Feb 3 12:50:18 2009 @@ -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: fax_modems.h,v 1.7 2009/01/31 08:48:11 steveu Exp $ + * $Id: fax_modems.h,v 1.8 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/fsk.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/fsk.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/fsk.h Tue Feb 3 12:50:18 2009 @@ -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.34 2009/01/31 08:48:11 steveu Exp $ + * $Id: fsk.h,v 1.35 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -144,9 +144,9 @@ \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(fsk_tx_state_t *) fsk_tx_init(fsk_tx_state_t *s, - const fsk_spec_t *spec, - get_bit_func_t get_bit, - void *user_data); + const fsk_spec_t *spec, + get_bit_func_t get_bit, + void *user_data); /*! Adjust an FSK modem transmit context's power output. \brief Adjust an FSK modem transmit context's power output. @@ -192,10 +192,10 @@ \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(fsk_rx_state_t *) fsk_rx_init(fsk_rx_state_t *s, - const fsk_spec_t *spec, - int sync_mode, - put_bit_func_t put_bit, - void *user_data); + const fsk_spec_t *spec, + int sync_mode, + put_bit_func_t put_bit, + void *user_data); /*! Process a block of received FSK modem audio samples. \brief Process a block of received FSK modem audio samples. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/g711.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/g711.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/g711.h Tue Feb 3 12:50:18 2009 @@ -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: g711.h,v 1.16 2009/01/31 08:48:11 steveu Exp $ + * $Id: g711.h,v 1.17 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/g722.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/g722.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/g722.h Tue Feb 3 12:50:18 2009 @@ -28,7 +28,7 @@ * Computer Science, Speech Group * Chengxiang Lu and Alex Hauptmann * - * $Id: g722.h,v 1.23 2009/01/31 08:48:11 steveu Exp $ + * $Id: g722.h,v 1.24 2009/02/03 16:28:41 steveu Exp $ */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/g726.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/g726.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/g726.h Tue Feb 3 12:50:18 2009 @@ -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.23 2009/01/31 08:48:11 steveu Exp $ + * $Id: g726.h,v 1.24 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/gsm0610.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/gsm0610.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/gsm0610.h Tue Feb 3 12:50:18 2009 @@ -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: gsm0610.h,v 1.19 2009/01/31 08:48:11 steveu Exp $ + * $Id: gsm0610.h,v 1.20 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_GSM0610_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.41 2009/01/31 08:48:11 steveu Exp $ + * $Id: hdlc.h,v 1.42 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -95,11 +95,11 @@ \return A pointer to the HDLC receiver context. */ SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s, - int crc32, - int report_bad_frames, - int framing_ok_threshold, - hdlc_frame_handler_t handler, - void *user_data); + int crc32, + int report_bad_frames, + int framing_ok_threshold, + hdlc_frame_handler_t handler, + void *user_data); /*! \brief Set the maximum frame length for an HDLC receiver context. \param s A pointer to an HDLC receiver context. @@ -151,11 +151,11 @@ \return A pointer to the HDLC transmitter context. */ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s, - int crc32, - int inter_frame_flags, - int progressive, - hdlc_underflow_handler_t handler, - void *user_data); + int crc32, + int inter_frame_flags, + int progressive, + hdlc_underflow_handler_t handler, + void *user_data); /*! \brief Set the maximum frame length for an HDLC transmitter context. \param s A pointer to an HDLC transmitter context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/ima_adpcm.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/ima_adpcm.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/ima_adpcm.h Tue Feb 3 12:50:18 2009 @@ -26,7 +26,7 @@ * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. * - * $Id: ima_adpcm.h,v 1.22 2009/01/31 08:48:11 steveu Exp $ + * $Id: ima_adpcm.h,v 1.23 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -74,8 +74,8 @@ as a chunk. \return A pointer to the IMA ADPCM context, or NULL for error. */ SPAN_DECLARE(ima_adpcm_state_t *) ima_adpcm_init(ima_adpcm_state_t *s, - int variant, - int chunk_size); + int variant, + int chunk_size); /*! Free an IMA ADPCM encode or decode context. \param s The IMA ADPCM context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/lpc10.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/lpc10.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/lpc10.h Tue Feb 3 12:50:18 2009 @@ -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: lpc10.h,v 1.19 2009/01/31 08:48:11 steveu Exp $ + * $Id: lpc10.h,v 1.20 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_LPC10_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/modem_connect_tones.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/modem_connect_tones.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/modem_connect_tones.h Tue Feb 3 12:50:18 2009 @@ -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.20 2009/01/31 08:48:11 steveu Exp $ + * $Id: modem_connect_tones.h,v 1.21 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -105,7 +105,7 @@ \param s The context. */ SPAN_DECLARE(modem_connect_tones_tx_state_t *) modem_connect_tones_tx_init(modem_connect_tones_tx_state_t *s, - int tone_type); + int tone_type); /*! \brief Free an instance of the modem connect tones generator. \param s The context. @@ -148,9 +148,9 @@ \return A pointer to the context. */ SPAN_DECLARE(modem_connect_tones_rx_state_t *) modem_connect_tones_rx_init(modem_connect_tones_rx_state_t *s, - int tone_type, - tone_report_func_t tone_callback, - void *user_data); + int tone_type, + tone_report_func_t tone_callback, + void *user_data); /*! \brief Free an instance of the modem connect tones detector. \param s The context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/modem_echo.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/modem_echo.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/modem_echo.h Tue Feb 3 12:50:18 2009 @@ -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: modem_echo.h,v 1.12 2009/01/31 08:48:11 steveu Exp $ + * $Id: modem_echo.h,v 1.13 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/noise.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/noise.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/noise.h Tue Feb 3 12:50:18 2009 @@ -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: noise.h,v 1.15 2009/01/31 08:48:11 steveu Exp $ + * $Id: noise.h,v 1.16 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/oki_adpcm.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/oki_adpcm.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/oki_adpcm.h Tue Feb 3 12:50:18 2009 @@ -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: oki_adpcm.h,v 1.22 2009/01/31 08:48:11 steveu Exp $ + * $Id: oki_adpcm.h,v 1.23 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -62,7 +62,7 @@ The valid rates are 24000 and 32000. \return A pointer to the Oki ADPCM context, or NULL for error. */ SPAN_DECLARE(oki_adpcm_state_t *) oki_adpcm_init(oki_adpcm_state_t *s, - int bit_rate); + int bit_rate); /*! Free an Oki ADPCM encode or decode context. \param s The Oki ADPCM context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/playout.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/playout.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/playout.h Tue Feb 3 12:50:18 2009 @@ -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: playout.h,v 1.12 2009/01/31 08:48:11 steveu Exp $ + * $Id: playout.h,v 1.13 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_PLAYOUT_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/plc.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/plc.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/plc.h Tue Feb 3 12:50:18 2009 @@ -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: plc.h,v 1.19 2009/01/31 08:48:11 steveu Exp $ + * $Id: plc.h,v 1.20 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/power_meter.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/power_meter.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/power_meter.h Tue Feb 3 12:50:18 2009 @@ -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: power_meter.h,v 1.16 2009/01/31 08:48:11 steveu Exp $ + * $Id: power_meter.h,v 1.17 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_POWER_METER_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/queue.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/queue.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/queue.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.19 2009/01/31 08:48:11 steveu Exp $ + * $Id: queue.h,v 1.20 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/saturated.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/saturated.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/saturated.h Tue Feb 3 12:50:18 2009 @@ -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: saturated.h,v 1.1 2008/09/19 14:02:05 steveu Exp $ + * $Id: saturated.h,v 1.3 2009/02/03 17:25:53 steveu Exp $ */ /*! \file */ @@ -75,7 +75,8 @@ return INT16_MAX; if (famp < (float) INT16_MIN) return INT16_MIN; - return (int16_t) rintf(famp); + //return (int16_t) lfastrintf(famp); + return (int16_t) lrintf(famp); } /*- End of function --------------------------------------------------------*/ @@ -85,7 +86,8 @@ return INT16_MAX; if (damp < (double) INT16_MIN) return INT16_MIN; - return (int16_t) rint(damp); + //return (int16_t) lfastrint(damp); + return (int16_t) lrint(damp); } /*- End of function --------------------------------------------------------*/ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/schedule.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/schedule.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/schedule.h Tue Feb 3 12:50:18 2009 @@ -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: schedule.h,v 1.18 2009/01/31 08:48:11 steveu Exp $ + * $Id: schedule.h,v 1.19 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/sig_tone.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/sig_tone.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/sig_tone.h Tue Feb 3 12:50:18 2009 @@ -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.16 2009/01/31 08:48:11 steveu Exp $ + * $Id: sig_tone.h,v 1.17 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/silence_gen.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/silence_gen.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/silence_gen.h Tue Feb 3 12:50:18 2009 @@ -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: silence_gen.h,v 1.13 2009/01/31 08:48:11 steveu Exp $ + * $Id: silence_gen.h,v 1.14 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_SILENCE_GEN_H_) @@ -117,7 +117,7 @@ \param len The length of the signal buffer \return 0. */ -int span_dummy_rx(void *user_data, const int16_t amp[], int len); +SPAN_DECLARE(int) span_dummy_rx(void *user_data, const int16_t amp[], int len); /*! A dummy routine to use as a signal modifier callback, when we aren't really trying to process the signal. It just returns without affecting Modified: freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_rx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_rx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_rx.h Tue Feb 3 12:50:18 2009 @@ -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: super_tone_rx.h,v 1.19 2009/01/31 08:48:11 steveu Exp $ + * $Id: super_tone_rx.h,v 1.20 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_SUPER_TONE_RX_H_) @@ -111,9 +111,9 @@ \return The supervisory tone detector context. */ SPAN_DECLARE(super_tone_rx_state_t *) super_tone_rx_init(super_tone_rx_state_t *s, - super_tone_rx_descriptor_t *desc, - tone_report_func_t callback, - void *user_data); + super_tone_rx_descriptor_t *desc, + tone_report_func_t callback, + void *user_data); /*! Release a supervisory tone detector. \param s The supervisory tone context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_tx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_tx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/super_tone_tx.h Tue Feb 3 12:50:18 2009 @@ -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: super_tone_tx.h,v 1.15 2009/01/31 08:48:11 steveu Exp $ + * $Id: super_tone_tx.h,v 1.16 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_SUPER_TONE_TX_H_) @@ -51,12 +51,12 @@ #endif SPAN_DECLARE(super_tone_tx_step_t *) super_tone_tx_make_step(super_tone_tx_step_t *s, - float f1, - float l1, - float f2, - float l2, - int length, - int cycles); + float f1, + float l1, + float f2, + float l2, + int length, + int cycles); SPAN_DECLARE(void) super_tone_tx_free(super_tone_tx_step_t *s); Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t30.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t30.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t30.h Tue Feb 3 12:50:18 2009 @@ -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.121 2009/01/31 08:48:11 steveu Exp $ + * $Id: t30.h,v 1.122 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -559,13 +559,13 @@ \param send_hdlc_user_data \return A pointer to the context, or NULL if there was a problem. */ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s, - int calling_party, - t30_set_handler_t *set_rx_type_handler, - void *set_rx_type_user_data, - t30_set_handler_t *set_tx_type_handler, - void *set_tx_type_user_data, - t30_send_hdlc_handler_t *send_hdlc_handler, - void *send_hdlc_user_data); + int calling_party, + t30_set_handler_t *set_rx_type_handler, + void *set_rx_type_user_data, + t30_set_handler_t *set_tx_type_handler, + void *set_tx_type_user_data, + t30_send_hdlc_handler_t *send_hdlc_handler, + void *send_hdlc_user_data); /*! Release a T.30 context. \brief Release a T.30 context. @@ -607,7 +607,7 @@ \brief Get a bit of received non-ECM image data. \param user_data An opaque pointer, which must point to the T.30 context. \return The next bit to transmit. */ -int t30_non_ecm_get_bit(void *user_data); +SPAN_DECLARE(int) t30_non_ecm_get_bit(void *user_data); /*! Get a byte of received non-ECM image data. \brief Get a byte of received non-ECM image data. @@ -627,7 +627,7 @@ \brief Process a bit of received non-ECM image data \param user_data An opaque pointer, which must point to the T.30 context. \param bit The received bit. */ -void t30_non_ecm_put_bit(void *user_data, int bit); +SPAN_DECLARE(void) t30_non_ecm_put_bit(void *user_data, int bit); /*! Process a byte of received non-ECM image data. \brief Process a byte of received non-ECM image data @@ -648,7 +648,7 @@ \param msg The HDLC message. \param len The length of the message, in octets. \param ok TRUE if the frame was received without error. */ -void t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok); +SPAN_DECLARE(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok); /*! Report the passage of time to the T.30 engine. \brief Report the passage of time to the T.30 engine. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t30_api.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t30_api.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t30_api.h Tue Feb 3 12:50:18 2009 @@ -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_api.h,v 1.8 2009/01/31 08:48:11 steveu Exp $ + * $Id: t30_api.h,v 1.9 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t30_logging.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t30_logging.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t30_logging.h Tue Feb 3 12:50:18 2009 @@ -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_logging.h,v 1.3 2009/01/31 08:48:11 steveu Exp $ + * $Id: t30_logging.h,v 1.4 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t31.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t31.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t31.h Tue Feb 3 12:50:18 2009 @@ -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: t31.h,v 1.56 2009/01/31 08:48:11 steveu Exp $ + * $Id: t31.h,v 1.57 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -127,12 +127,12 @@ \param tx_t38_packet_user_data ??? \return A pointer to the T.31 context. */ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s, - at_tx_handler_t *at_tx_handler, - void *at_tx_user_data, - t31_modem_control_handler_t *modem_control_handler, - void *modem_control_user_data, - t38_tx_packet_handler_t *tx_t38_packet_handler, - void *tx_t38_packet_user_data); + at_tx_handler_t *at_tx_handler, + void *at_tx_user_data, + t31_modem_control_handler_t *modem_control_handler, + void *modem_control_user_data, + t38_tx_packet_handler_t *tx_t38_packet_handler, + void *tx_t38_packet_user_data); /*! Release a T.31 context. \brief Release a T.31 context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t38_core.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t38_core.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t38_core.h Tue Feb 3 12:50:18 2009 @@ -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.35 2009/01/31 08:48:11 steveu Exp $ + * $Id: t38_core.h,v 1.36 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -329,12 +329,12 @@ SPAN_DECLARE(logging_state_t *) t38_core_get_logging_state(t38_core_state_t *s); SPAN_DECLARE(t38_core_state_t *) t38_core_init(t38_core_state_t *s, - t38_rx_indicator_handler_t *rx_indicator_handler, - 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, - void *tx_packet_user_data); + t38_rx_indicator_handler_t *rx_indicator_handler, + 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, + void *tx_packet_user_data); #if defined(__cplusplus) } Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t38_gateway.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t38_gateway.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t38_gateway.h Tue Feb 3 12:50:18 2009 @@ -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_gateway.h,v 1.60 2009/01/31 08:48:11 steveu Exp $ + * $Id: t38_gateway.h,v 1.61 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -83,8 +83,8 @@ \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine. \return A pointer to the termination mode T.38 context, or NULL if there was a problem. */ SPAN_DECLARE(t38_gateway_state_t *) t38_gateway_init(t38_gateway_state_t *s, - t38_tx_packet_handler_t *tx_packet_handler, - void *tx_packet_user_data); + t38_tx_packet_handler_t *tx_packet_handler, + void *tx_packet_user_data); /*! Free a gateway mode T.38 context. \brief Free a T.38 context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h Tue Feb 3 12:50:18 2009 @@ -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_non_ecm_buffer.h,v 1.4 2009/01/31 08:48:11 steveu Exp $ + * $Id: t38_non_ecm_buffer.h,v 1.5 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -93,7 +93,7 @@ /*! \brief Get the next bit of data from a T.38 rate adapting non-ECM buffer context. \param user_data The buffer context, cast to a void pointer. \return The next bit, or one of the values indicating a change of modem status. */ -int t38_non_ecm_buffer_get_bit(void *user_data); +SPAN_DECLARE(int) t38_non_ecm_buffer_get_bit(void *user_data); #if defined(__cplusplus) } Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t38_terminal.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t38_terminal.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t38_terminal.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.40 2009/01/31 08:48:11 steveu Exp $ + * $Id: t38_terminal.h,v 1.41 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -95,9 +95,9 @@ \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine. \return A pointer to the termination mode T.38 context, or NULL if there was a problem. */ SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s, - int calling_party, - t38_tx_packet_handler_t *tx_packet_handler, - void *tx_packet_user_data); + int calling_party, + t38_tx_packet_handler_t *tx_packet_handler, + void *tx_packet_user_data); /*! Release a termination mode T.38 context. \brief Release a T.38 context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t4.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/t4.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/t4.h Tue Feb 3 12:50:18 2009 @@ -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: t4.h,v 1.54 2009/01/31 08:48:11 steveu Exp $ + * $Id: t4.h,v 1.55 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/telephony.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/telephony.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/telephony.h Tue Feb 3 12:50:18 2009 @@ -22,30 +22,30 @@ * 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.15 2009/01/31 12:12:21 steveu Exp $ + * $Id: telephony.h,v 1.16 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_TELEPHONY_H_) #define _SPANDSP_TELEPHONY_H_ #if defined(WIN32) -# if defined(LIBSPANDSP_EXPORTS) -# define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall -# define SPAN_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl -# define SPAN_DECLARE_DATA __declspec(dllexport) -# else -# define SPAN_DECLARE(type) __declspec(dllimport) type __stdcall -# define SPAN_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl -# define SPAN_DECLARE_DATA __declspec(dllimport) -# endif -#elif defined(SPANDSP_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__)) -# define SPAN_DECLARE(type) __attribute__((visibility("default"))) type -# define SPAN_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type -# define SPAN_DECLARE_DATA __attribute__((visibility("default"))) +#if defined(LIBSPANDSP_EXPORTS) +#define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall +#define SPAN_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define SPAN_DECLARE_DATA __declspec(dllexport) #else -# define SPAN_DECLARE(type) /**/ type -# define SPAN_DECLARE_NONSTD(type) /**/ type -# define SPAN_DECLARE_DATA /**/ +#define SPAN_DECLARE(type) __declspec(dllimport) type __stdcall +#define SPAN_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define SPAN_DECLARE_DATA __declspec(dllimport) +#endif +#elif defined(SPANDSP_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__)) +#define SPAN_DECLARE(type) __attribute__((visibility("default"))) type +#define SPAN_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type +#define SPAN_DECLARE_DATA __attribute__((visibility("default"))) +#else +#define SPAN_DECLARE(type) /**/ type +#define SPAN_DECLARE_NONSTD(type) /**/ type +#define SPAN_DECLARE_DATA /**/ #endif #define SAMPLE_RATE 8000 Modified: freeswitch/trunk/libs/spandsp/src/spandsp/time_scale.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/time_scale.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/time_scale.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.18 2009/01/31 08:48:11 steveu Exp $ + * $Id: time_scale.h,v 1.19 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_TIME_SCALE_H_) Modified: freeswitch/trunk/libs/spandsp/src/spandsp/tone_detect.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/tone_detect.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/tone_detect.h Tue Feb 3 12:50:18 2009 @@ -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: tone_detect.h,v 1.43 2009/01/31 08:48:11 steveu Exp $ + * $Id: tone_detect.h,v 1.44 2009/02/03 16:28:41 steveu Exp $ */ #if !defined(_SPANDSP_TONE_DETECT_H_) @@ -75,29 +75,29 @@ #endif /*! \brief Create a descriptor for use with either a Goertzel transform */ -void make_goertzel_descriptor(goertzel_descriptor_t *t, - float freq, - int samples); +SPAN_DECLARE(void) make_goertzel_descriptor(goertzel_descriptor_t *t, + float freq, + int samples); /*! \brief Initialise the state of a Goertzel transform. \param s The Goertzel context. If NULL, a context is allocated with malloc. \param t The Goertzel descriptor. \return A pointer to the Goertzel state. */ -goertzel_state_t *goertzel_init(goertzel_state_t *s, - goertzel_descriptor_t *t); +SPAN_DECLARE(goertzel_state_t *) goertzel_init(goertzel_state_t *s, + goertzel_descriptor_t *t); /*! \brief Reset the state of a Goertzel transform. \param s The Goertzel context. */ -void goertzel_reset(goertzel_state_t *s); +SPAN_DECLARE(void) goertzel_reset(goertzel_state_t *s); /*! \brief Update the state of a Goertzel transform. \param s The Goertzel context. \param amp The samples to be transformed. \param samples The number of samples. \return The number of samples unprocessed */ -int goertzel_update(goertzel_state_t *s, - const int16_t amp[], - int samples); +SPAN_DECLARE(int) goertzel_update(goertzel_state_t *s, + const int16_t amp[], + int samples); /*! \brief Evaluate the final result of a Goertzel transform. \param s The Goertzel context. @@ -106,9 +106,9 @@ [Floating point] ((samples_per_goertzel_block*32768.0/1.4142)*10^((x - DBM0_MAX_SINE_POWER)/20.0))^2 [Fixed point] ((samples_per_goertzel_block*256.0/1.4142)*10^((x - DBM0_MAX_SINE_POWER)/20.0))^2 */ #if defined(SPANDSP_USE_FIXED_POINT) -int32_t goertzel_result(goertzel_state_t *s); +SPAN_DECLARE(int32_t) goertzel_result(goertzel_state_t *s); #else -float goertzel_result(goertzel_state_t *s); +SPAN_DECLARE(float) goertzel_result(goertzel_state_t *s); #endif /*! \brief Update the state of a Goertzel transform. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/tone_generate.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/tone_generate.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/tone_generate.h Tue Feb 3 12:50:18 2009 @@ -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: tone_generate.h,v 1.36 2009/01/31 08:48:11 steveu Exp $ + * $Id: tone_generate.h,v 1.37 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v17rx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v17rx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v17rx.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.59 2009/01/31 08:48:11 steveu Exp $ + * $Id: v17rx.h,v 1.60 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v17tx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v17tx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v17tx.h Tue Feb 3 12:50:18 2009 @@ -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: v17tx.h,v 1.38 2009/01/31 08:48:11 steveu Exp $ + * $Id: v17tx.h,v 1.39 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h Tue Feb 3 12:50:18 2009 @@ -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: v22bis.h,v 1.33 2009/01/31 08:48:11 steveu Exp $ + * $Id: v22bis.h,v 1.34 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -145,12 +145,12 @@ \param user_data An opaque pointer, passed in calls to the get and put routines. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s, - int bit_rate, - int guard, - int caller, - get_bit_func_t get_bit, - put_bit_func_t put_bit, - void *user_data); + int bit_rate, + int guard, + int caller, + get_bit_func_t get_bit, + put_bit_func_t put_bit, + void *user_data); /*! Free a V.22bis modem receive context. \brief Free a V.22bis modem receive context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.55 2009/01/31 08:48:11 steveu Exp $ + * $Id: v27ter_rx.h,v 1.56 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_tx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_tx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_tx.h Tue Feb 3 12:50:18 2009 @@ -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_tx.h,v 1.38 2009/01/31 08:48:11 steveu Exp $ + * $Id: v27ter_tx.h,v 1.39 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h Tue Feb 3 12:50:18 2009 @@ -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.h,v 1.66 2009/01/31 08:48:11 steveu Exp $ + * $Id: v29rx.h,v 1.67 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v29tx.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v29tx.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v29tx.h Tue Feb 3 12:50:18 2009 @@ -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: v29tx.h,v 1.36 2009/01/31 08:48:11 steveu Exp $ + * $Id: v29tx.h,v 1.37 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v42.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v42.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v42.h Tue Feb 3 12:50:18 2009 @@ -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: v42.h,v 1.27 2009/01/31 08:48:11 steveu Exp $ + * $Id: v42.h,v 1.28 2009/02/03 16:28:41 steveu Exp $ */ /*! \page v42_page V.42 modem error correction @@ -94,7 +94,7 @@ /*! Accept an HDLC packet */ -void lapm_receive(void *user_data, const uint8_t *buf, int len, int ok); +SPAN_DECLARE(void) lapm_receive(void *user_data, const uint8_t *buf, int len, int ok); /*! Transmit a LAP.M frame */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v42bis.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v42bis.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v42bis.h Tue Feb 3 12:50:18 2009 @@ -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: v42bis.h,v 1.24 2009/01/31 08:48:11 steveu Exp $ + * $Id: v42bis.h,v 1.25 2009/02/03 16:28:41 steveu Exp $ */ /*! \page v42bis_page V.42bis modem data compression @@ -107,15 +107,15 @@ \param max_data_len The maximum length that should be passed to the data handler. \return The V.42bis context. */ SPAN_DECLARE(v42bis_state_t *) v42bis_init(v42bis_state_t *s, - int negotiated_p0, - int negotiated_p1, - int negotiated_p2, - v42bis_frame_handler_t frame_handler, - void *frame_user_data, - int max_frame_len, - v42bis_data_handler_t data_handler, - void *data_user_data, - int max_data_len); + int negotiated_p0, + int negotiated_p1, + int negotiated_p2, + v42bis_frame_handler_t frame_handler, + void *frame_user_data, + int max_frame_len, + v42bis_data_handler_t data_handler, + void *data_user_data, + int max_data_len); /*! Set the compression mode. \param s The V.42bis context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v8.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v8.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v8.h Tue Feb 3 12:50:18 2009 @@ -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: v8.h,v 1.26 2009/01/31 08:48:11 steveu Exp $ + * $Id: v8.h,v 1.27 2009/02/03 16:28:41 steveu Exp $ */ /*! \file */ @@ -129,10 +129,10 @@ \param user_data An opaque pointer passed to the result_handler routine. \return A pointer to the V.8 context, or NULL if there was a problem. */ SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s, - int caller, - int available_modulations, - v8_result_handler_t *result_handler, - void *user_data); + int caller, + int available_modulations, + v8_result_handler_t *result_handler, + void *user_data); /*! Release a V.8 context. \brief Release a V.8 context. Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/version.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h Tue Feb 3 12:50:18 2009 @@ -30,8 +30,8 @@ /* The date and time of the version are in UTC form. */ -#define SPANDSP_RELEASE_DATE 20090131 -#define SPANDSP_RELEASE_TIME 122642 +#define SPANDSP_RELEASE_DATE 20090203 +#define SPANDSP_RELEASE_TIME 172817 #endif /*- End of file ------------------------------------------------------------*/ Modified: freeswitch/trunk/libs/spandsp/src/super_tone_rx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/super_tone_rx.c (original) +++ freeswitch/trunk/libs/spandsp/src/super_tone_rx.c Tue Feb 3 12:50:18 2009 @@ -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: super_tone_rx.c,v 1.31 2009/01/28 03:41:27 steveu Exp $ + * $Id: super_tone_rx.c,v 1.32 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" @@ -120,11 +121,11 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_add_element(super_tone_rx_descriptor_t *desc, - int tone, - int f1, - int f2, - int min, - int max) + int tone, + int f1, + int f2, + int min, + int max) { int step; @@ -224,16 +225,16 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) super_tone_rx_segment_callback(super_tone_rx_state_t *s, - void (*callback)(void *data, int f1, int f2, int duration)) + void (*callback)(void *data, int f1, int f2, int duration)) { s->segment_callback = callback; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(super_tone_rx_state_t *) super_tone_rx_init(super_tone_rx_state_t *s, - super_tone_rx_descriptor_t *desc, - tone_report_func_t callback, - void *user_data) + super_tone_rx_descriptor_t *desc, + tone_report_func_t callback, + void *user_data) { int i; Modified: freeswitch/trunk/libs/spandsp/src/super_tone_tx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/super_tone_tx.c (original) +++ freeswitch/trunk/libs/spandsp/src/super_tone_tx.c Tue Feb 3 12:50:18 2009 @@ -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: super_tone_tx.c,v 1.27 2009/01/28 03:41:27 steveu Exp $ + * $Id: super_tone_tx.c,v 1.28 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_generate.h" @@ -70,12 +71,12 @@ */ SPAN_DECLARE(super_tone_tx_step_t *) super_tone_tx_make_step(super_tone_tx_step_t *s, - float f1, - float l1, - float f2, - float l2, - int length, - int cycles) + float f1, + float l1, + float f2, + float l2, + int length, + int cycles) { if (s == NULL) { @@ -193,7 +194,7 @@ /* There must be two, and only two tones */ xamp = dds_modf(&s->phase[0], -s->tone[0].phase_rate, s->tone[0].gain, 0) *(1.0f + dds_modf(&s->phase[1], s->tone[1].phase_rate, s->tone[1].gain, 0)); - amp[samples] = (int16_t) lrintf(xamp); + amp[samples] = (int16_t) lfastrintf(xamp); } } else @@ -207,7 +208,7 @@ break; xamp += dds_modf(&s->phase[i], s->tone[i].phase_rate, s->tone[i].gain, 0); } - amp[samples] = (int16_t) lrintf(xamp); + amp[samples] = (int16_t) lfastrintf(xamp); } } if (s->current_position) Modified: freeswitch/trunk/libs/spandsp/src/t30.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t30.c (original) +++ freeswitch/trunk/libs/spandsp/src/t30.c Tue Feb 3 12:50:18 2009 @@ -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.282 2009/01/31 09:47:59 steveu Exp $ + * $Id: t30.c,v 1.283 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -4986,7 +4986,7 @@ } /*- End of function --------------------------------------------------------*/ -void t30_non_ecm_put_bit(void *user_data, int bit) +SPAN_DECLARE(void) t30_non_ecm_put_bit(void *user_data, int bit) { t30_state_t *s; @@ -5102,7 +5102,7 @@ } /*- End of function --------------------------------------------------------*/ -int t30_non_ecm_get_bit(void *user_data) +SPAN_DECLARE(int) t30_non_ecm_get_bit(void *user_data) { int bit; t30_state_t *s; @@ -5302,7 +5302,7 @@ } /*- End of function --------------------------------------------------------*/ -void t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) +SPAN_DECLARE(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) { t30_state_t *s; @@ -5823,13 +5823,13 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s, - int calling_party, - t30_set_handler_t *set_rx_type_handler, - void *set_rx_type_user_data, - t30_set_handler_t *set_tx_type_handler, - void *set_tx_type_user_data, - t30_send_hdlc_handler_t *send_hdlc_handler, - void *send_hdlc_user_data) + int calling_party, + t30_set_handler_t *set_rx_type_handler, + void *set_rx_type_user_data, + t30_set_handler_t *set_tx_type_handler, + void *set_tx_type_user_data, + t30_send_hdlc_handler_t *send_hdlc_handler, + void *send_hdlc_user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/t30_api.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t30_api.c (original) +++ freeswitch/trunk/libs/spandsp/src/t30_api.c Tue Feb 3 12:50:18 2009 @@ -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_api.c,v 1.12 2009/01/28 03:41:27 steveu Exp $ + * $Id: t30_api.c,v 1.13 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/t30_logging.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t30_logging.c (original) +++ freeswitch/trunk/libs/spandsp/src/t30_logging.c Tue Feb 3 12:50:18 2009 @@ -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_logging.c,v 1.10 2009/01/28 03:41:27 steveu Exp $ + * $Id: t30_logging.c,v 1.11 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/t31.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t31.c (original) +++ freeswitch/trunk/libs/spandsp/src/t31.c Tue Feb 3 12:50:18 2009 @@ -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.137 2009/01/29 01:41:06 steveu Exp $ + * $Id: t31.c,v 1.139 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -633,17 +633,17 @@ static void set_octets_per_data_packet(t31_state_t *s, int bit_rate) { s->t38_fe.tx_bit_rate = bit_rate; - if (s->t38_fe.ms_per_tx_chunk == 0) - { - s->t38_fe.octets_per_data_packet = MAX_OCTETS_PER_UNPACED_CHUNK; - } - else + if (s->t38_fe.ms_per_tx_chunk) { s->t38_fe.octets_per_data_packet = s->t38_fe.ms_per_tx_chunk*bit_rate/(8*1000); /* Make sure we have a positive number (i.e. we didn't truncate to zero). */ if (s->t38_fe.octets_per_data_packet < 1) s->t38_fe.octets_per_data_packet = 1; } + else + { + s->t38_fe.octets_per_data_packet = MAX_OCTETS_PER_UNPACED_CHUNK; + } } /*- End of function --------------------------------------------------------*/ @@ -682,22 +682,34 @@ bit_reverse(buf, buf, len); if (len < fe->octets_per_data_packet) { - /* That's the end of the image data. Do a little padding now */ - memset(buf + len, 0, fe->octets_per_data_packet - len); - fe->non_ecm_trailer_bytes = 3*fe->octets_per_data_packet + len; - len = fe->octets_per_data_packet; - fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_4; + /* That's the end of the image data. */ + if (s->t38_fe.ms_per_tx_chunk) + { + /* Pad the end of the data with some zeros. If we just stop abruptly + at the end of the EOLs, some ATAs fail to clean up properly before + shutting down their transmit modem, and the last few rows of the image + are lost or corrupted. Simply delaying the no-signal message does not + help for all implentations. It is usually ignored, which is probably + the right thing to do after receiving a message saying the signal has + ended. */ + memset(buf + len, 0, fe->octets_per_data_packet - len); + fe->non_ecm_trailer_bytes = 3*fe->octets_per_data_packet + len; + len = fe->octets_per_data_packet; + fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_4; + } + else + { + /* If we are sending quickly there seems no point in doing any padding */ + t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, buf, len, fe->t38.data_end_tx_count); + fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; + delay = 0; + } } t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, buf, len, fe->t38.data_tx_count); delay = bits_to_us(s, 8*len); break; case T38_TIMED_STEP_NON_ECM_MODEM_4: - /* This pads the end of the data with some zeros. If we just stop abruptly - at the end of the EOLs, some ATAs fail to clean up properly before - shutting down their transmit modem, and the last few rows of the image - are corrupted. Simply delaying the no-signal message does not help for - all implentations. It is usually ignored, which is probably the right - thing to do after receiving a message saying the signal has ended. */ + /* Send padding */ len = fe->octets_per_data_packet; fe->non_ecm_trailer_bytes -= len; if (fe->non_ecm_trailer_bytes <= 0) @@ -708,7 +720,9 @@ fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; /* Allow a bit more time than the data will take to play out, to ensure the far ATA does not cut things short. */ - delay = bits_to_us(s, 8*len) + 60000; + delay = bits_to_us(s, 8*len); + if (s->t38_fe.ms_per_tx_chunk) + delay += 60000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } @@ -790,7 +804,9 @@ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ - delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits) + 100000; + delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits); + if (s->t38_fe.ms_per_tx_chunk) + delay += 100000; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } @@ -831,7 +847,9 @@ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ - delay = bits_to_us(s, fe->hdlc_tx.extra_bits) + 100000; + delay = bits_to_us(s, fe->hdlc_tx.extra_bits); + if (s->t38_fe.ms_per_tx_chunk) + delay += 100000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } @@ -2446,12 +2464,12 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s, - at_tx_handler_t *at_tx_handler, - void *at_tx_user_data, - t31_modem_control_handler_t *modem_control_handler, - void *modem_control_user_data, - t38_tx_packet_handler_t *tx_t38_packet_handler, - void *tx_t38_packet_user_data) + at_tx_handler_t *at_tx_handler, + void *at_tx_user_data, + t31_modem_control_handler_t *modem_control_handler, + void *modem_control_user_data, + t38_tx_packet_handler_t *tx_t38_packet_handler, + void *tx_t38_packet_user_data) { int alloced; Modified: freeswitch/trunk/libs/spandsp/src/t35.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t35.c (original) +++ freeswitch/trunk/libs/spandsp/src/t35.c Tue Feb 3 12:50:18 2009 @@ -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: t35.c,v 1.28 2009/01/05 13:48:31 steveu Exp $ + * $Id: t35.c,v 1.29 2009/02/03 16:28:40 steveu Exp $ */ /* @@ -738,7 +738,7 @@ }; #if 0 -void nsf_find_station_id(int reverse_order) +SPAN_DECLARE(void) nsf_find_station_id(int reverse_order) { const char *id = NULL; int idSize = 0; Modified: freeswitch/trunk/libs/spandsp/src/t38_core.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t38_core.c (original) +++ freeswitch/trunk/libs/spandsp/src/t38_core.c Tue Feb 3 12:50:18 2009 @@ -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.c,v 1.50 2009/01/28 03:41:27 steveu Exp $ + * $Id: t38_core.c,v 1.51 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -924,12 +924,12 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_core_state_t *) t38_core_init(t38_core_state_t *s, - t38_rx_indicator_handler_t *rx_indicator_handler, - 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, - void *tx_packet_user_data) + t38_rx_indicator_handler_t *rx_indicator_handler, + 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, + void *tx_packet_user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/t38_gateway.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t38_gateway.c (original) +++ freeswitch/trunk/libs/spandsp/src/t38_gateway.c Tue Feb 3 12:50:18 2009 @@ -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.152 2009/01/29 18:30:14 steveu Exp $ + * $Id: t38_gateway.c,v 1.153 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -2151,10 +2151,10 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_nsx_suppression(t38_gateway_state_t *s, - const uint8_t *from_t38, - int from_t38_len, - const uint8_t *from_modem, - int from_modem_len) + const uint8_t *from_t38, + int from_t38_len, + const uint8_t *from_modem, + int from_modem_len) { s->t38x.suppress_nsx_len[0] = (from_t38_len < 0 || from_t38_len < MAX_NSX_SUPPRESSION) ? (from_t38_len + 3) : 0; s->t38x.suppress_nsx_len[1] = (from_modem_len < 0 || from_modem_len < MAX_NSX_SUPPRESSION) ? (from_modem_len + 3) : 0; @@ -2174,8 +2174,8 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_real_time_frame_handler(t38_gateway_state_t *s, - t38_gateway_real_time_frame_handler_t *handler, - void *user_data) + t38_gateway_real_time_frame_handler_t *handler, + void *user_data) { s->core.real_time_frame_handler = handler; s->core.real_time_frame_user_data = user_data; @@ -2190,8 +2190,8 @@ /*- End of function --------------------------------------------------------*/ static int t38_gateway_t38_init(t38_gateway_state_t *t, - t38_tx_packet_handler_t *tx_packet_handler, - void *tx_packet_user_data) + t38_tx_packet_handler_t *tx_packet_handler, + void *tx_packet_user_data) { t38_gateway_t38_state_t *s; @@ -2211,8 +2211,8 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_gateway_state_t *) t38_gateway_init(t38_gateway_state_t *s, - t38_tx_packet_handler_t *tx_packet_handler, - void *tx_packet_user_data) + t38_tx_packet_handler_t *tx_packet_handler, + void *tx_packet_user_data) { if (tx_packet_handler == NULL) return NULL; Modified: freeswitch/trunk/libs/spandsp/src/t38_non_ecm_buffer.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t38_non_ecm_buffer.c (original) +++ freeswitch/trunk/libs/spandsp/src/t38_non_ecm_buffer.c Tue Feb 3 12:50:18 2009 @@ -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_non_ecm_buffer.c,v 1.5 2009/01/28 03:41:27 steveu Exp $ + * $Id: t38_non_ecm_buffer.c,v 1.6 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -75,7 +75,7 @@ } /*- End of function --------------------------------------------------------*/ -int t38_non_ecm_buffer_get_bit(void *user_data) +SPAN_DECLARE(int) t38_non_ecm_buffer_get_bit(void *user_data) { t38_non_ecm_buffer_state_t *s; int bit; Modified: freeswitch/trunk/libs/spandsp/src/t38_terminal.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t38_terminal.c (original) +++ freeswitch/trunk/libs/spandsp/src/t38_terminal.c Tue Feb 3 12:50:18 2009 @@ -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.120 2009/01/29 01:41:06 steveu Exp $ + * $Id: t38_terminal.c,v 1.122 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -585,24 +585,36 @@ bit_reverse(buf, buf, len); if (len < fe->octets_per_data_packet) { - /* That's the end of the image data. Do a little padding now */ - memset(buf + len, 0, fe->octets_per_data_packet - len); - fe->non_ecm_trailer_bytes = 3*fe->octets_per_data_packet + len; - len = fe->octets_per_data_packet; - fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_4; + /* That's the end of the image data. */ + if (s->t38_fe.ms_per_tx_chunk) + { + /* Pad the end of the data with some zeros. If we just stop abruptly + at the end of the EOLs, some ATAs fail to clean up properly before + shutting down their transmit modem, and the last few rows of the image + are lost or corrupted. Simply delaying the no-signal message does not + help for all implentations. It is usually ignored, which is probably + the right thing to do after receiving a message saying the signal has + ended. */ + memset(buf + len, 0, fe->octets_per_data_packet - len); + fe->non_ecm_trailer_bytes = 3*fe->octets_per_data_packet + len; + len = fe->octets_per_data_packet; + fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_4; + } + else + { + /* If we are sending quickly there seems no point in doing any padding */ + t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, buf, len, fe->t38.data_end_tx_count); + fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; + delay = 0; + } } t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, buf, len, fe->t38.data_tx_count); delay = bits_to_us(s, 8*len); break; case T38_TIMED_STEP_NON_ECM_MODEM_4: - /* This pads the end of the data with some zeros. If we just stop abruptly - at the end of the EOLs, some ATAs fail to clean up properly before - shutting down their transmit modem, and the last few rows of the image - are corrupted. Simply delaying the no-signal message does not help for - all implentations. It is usually ignored, which is probably the right - thing to do after receiving a message saying the signal has ended. */ + /* Send padding */ len = fe->octets_per_data_packet; - fe->non_ecm_trailer_bytes -= len; + fe->non_ecm_trailer_bytes -= fe->octets_per_data_packet; if (fe->non_ecm_trailer_bytes <= 0) { len += fe->non_ecm_trailer_bytes; @@ -611,7 +623,9 @@ fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; /* Allow a bit more time than the data will take to play out, to ensure the far ATA does not cut things short. */ - delay = bits_to_us(s, 8*len) + 60000; + delay = bits_to_us(s, 8*len); + if (s->t38_fe.ms_per_tx_chunk) + delay += 60000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } @@ -687,7 +701,9 @@ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ - delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits) + 100000; + delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits); + if (s->t38_fe.ms_per_tx_chunk) + delay += 100000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); } else @@ -726,7 +742,9 @@ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ - delay = bits_to_us(s, fe->hdlc_tx.extra_bits) + 100000; + delay = bits_to_us(s, fe->hdlc_tx.extra_bits); + if (s->t38_fe.ms_per_tx_chunk) + delay += 100000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } @@ -1097,9 +1115,9 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s, - int calling_party, - t38_tx_packet_handler_t *tx_packet_handler, - void *tx_packet_user_data) + int calling_party, + t38_tx_packet_handler_t *tx_packet_handler, + void *tx_packet_user_data) { if (tx_packet_handler == NULL) return NULL; Modified: freeswitch/trunk/libs/spandsp/src/t4.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t4.c (original) +++ freeswitch/trunk/libs/spandsp/src/t4.c Tue Feb 3 12:50:18 2009 @@ -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: t4.c,v 1.120 2009/01/31 08:48:10 steveu Exp $ + * $Id: t4.c,v 1.121 2009/02/03 16:28:40 steveu Exp $ */ /* Modified: freeswitch/trunk/libs/spandsp/src/time_scale.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/time_scale.c (original) +++ freeswitch/trunk/libs/spandsp/src/time_scale.c Tue Feb 3 12:50:18 2009 @@ -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.28 2009/01/29 01:41:06 steveu Exp $ + * $Id: time_scale.c,v 1.29 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -47,6 +47,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/time_scale.h" #include "spandsp/saturated.h" Modified: freeswitch/trunk/libs/spandsp/src/tone_detect.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/tone_detect.c (original) +++ freeswitch/trunk/libs/spandsp/src/tone_detect.c Tue Feb 3 12:50:18 2009 @@ -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: tone_detect.c,v 1.49 2009/01/28 03:41:27 steveu Exp $ + * $Id: tone_detect.c,v 1.50 2009/02/03 16:28:40 steveu Exp $ */ /*! \file tone_detect.h */ @@ -58,7 +58,7 @@ #define M_PI 3.14159265358979323846264338327 #endif -void make_goertzel_descriptor(goertzel_descriptor_t *t, float freq, int samples) +SPAN_DECLARE(void) make_goertzel_descriptor(goertzel_descriptor_t *t, float freq, int samples) { #if defined(SPANDSP_USE_FIXED_POINT) t->fac = 16383.0f*2.0f*cosf(2.0f*M_PI*(freq/(float) SAMPLE_RATE)); @@ -69,8 +69,8 @@ } /*- End of function --------------------------------------------------------*/ -goertzel_state_t *goertzel_init(goertzel_state_t *s, - goertzel_descriptor_t *t) +SPAN_DECLARE(goertzel_state_t *) goertzel_init(goertzel_state_t *s, + goertzel_descriptor_t *t) { if (s == NULL) { @@ -91,7 +91,7 @@ } /*- End of function --------------------------------------------------------*/ -void goertzel_reset(goertzel_state_t *s) +SPAN_DECLARE(void) goertzel_reset(goertzel_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINT) s->v2 = @@ -104,9 +104,9 @@ } /*- End of function --------------------------------------------------------*/ -int goertzel_update(goertzel_state_t *s, - const int16_t amp[], - int samples) +SPAN_DECLARE(int) goertzel_update(goertzel_state_t *s, + const int16_t amp[], + int samples) { int i; #if defined(SPANDSP_USE_FIXED_POINT) @@ -139,9 +139,9 @@ /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) -int32_t goertzel_result(goertzel_state_t *s) +SPAN_DECLARE(int32_t) goertzel_result(goertzel_state_t *s) #else -float goertzel_result(goertzel_state_t *s) +SPAN_DECLARE(float) goertzel_result(goertzel_state_t *s) #endif { #if defined(SPANDSP_USE_FIXED_POINT) Modified: freeswitch/trunk/libs/spandsp/src/tone_generate.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/tone_generate.c (original) +++ freeswitch/trunk/libs/spandsp/src/tone_generate.c Tue Feb 3 12:50:18 2009 @@ -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: tone_generate.c,v 1.48 2009/01/28 03:41:27 steveu Exp $ + * $Id: tone_generate.c,v 1.49 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/complex.h" #include "spandsp/dds.h" @@ -61,15 +62,15 @@ #define ms_to_samples(t) (((t)*SAMPLE_RATE)/1000) SPAN_DECLARE(void) make_tone_gen_descriptor(tone_gen_descriptor_t *s, - int f1, - int l1, - int f2, - int l2, - int d1, - int d2, - int d3, - int d4, - int repeat) + int f1, + int l1, + int f2, + int l2, + int d1, + int d2, + int d3, + int d4, + int repeat) { memset(s, 0, sizeof(*s)); if (f1) @@ -170,7 +171,7 @@ #else xamp = dds_modf(&s->phase[0], -s->tone[0].phase_rate, s->tone[0].gain, 0) *(1.0f + dds_modf(&s->phase[1], s->tone[1].phase_rate, s->tone[1].gain, 0)); - amp[samples] = (int16_t) lrintf(xamp); + amp[samples] = (int16_t) lfastrintf(xamp); #endif } } @@ -200,7 +201,7 @@ #if defined(SPANDSP_USE_FIXED_POINT) amp[samples] = xamp; #else - amp[samples] = (int16_t) lrintf(xamp); + amp[samples] = (int16_t) lfastrintf(xamp); #endif } } Modified: freeswitch/trunk/libs/spandsp/src/v17rx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v17rx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v17rx.c Tue Feb 3 12:50:18 2009 @@ -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.131 2009/01/30 10:22:23 steveu Exp $ + * $Id: v17rx.c,v 1.132 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/v17tx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v17tx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v17tx.c Tue Feb 3 12:50:18 2009 @@ -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: v17tx.c,v 1.69 2009/01/28 03:41:27 steveu Exp $ + * $Id: v17tx.c,v 1.70 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -44,6 +44,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" @@ -301,7 +302,7 @@ /* Now create and modulate the carrier */ z = dds_complexf(&(s->carrier_phase), s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ - amp[sample] = (int16_t) lrintf((x.re*z.re - x.im*z.im)*s->gain); + amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain); #endif } return sample; Modified: freeswitch/trunk/libs/spandsp/src/v22bis_rx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v22bis_rx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v22bis_rx.c Tue Feb 3 12:50:18 2009 @@ -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: v22bis_rx.c,v 1.46 2009/01/28 03:41:27 steveu Exp $ + * $Id: v22bis_rx.c,v 1.47 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/v22bis_tx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v22bis_tx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v22bis_tx.c Tue Feb 3 12:50:18 2009 @@ -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: v22bis_tx.c,v 1.49 2009/01/28 03:41:27 steveu Exp $ + * $Id: v22bis_tx.c,v 1.50 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -46,6 +46,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" @@ -558,7 +559,7 @@ famp += dds_modf(&(s->tx.guard_phase), s->tx.guard_phase_rate, s->tx.guard_level, 0); } /* Don't bother saturating. We should never clip. */ - amp[sample] = (int16_t) lrintf(famp); + amp[sample] = (int16_t) lfastrintf(famp); } return sample; } @@ -623,12 +624,12 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s, - int bit_rate, - int guard, - int caller, - get_bit_func_t get_bit, - put_bit_func_t put_bit, - void *user_data) + int bit_rate, + int guard, + int caller, + get_bit_func_t get_bit, + put_bit_func_t put_bit, + void *user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/v27ter_rx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v27ter_rx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v27ter_rx.c Tue Feb 3 12:50:18 2009 @@ -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.115 2009/01/30 10:22:23 steveu Exp $ + * $Id: v27ter_rx.c,v 1.116 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/v27ter_tx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v27ter_tx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v27ter_tx.c Tue Feb 3 12:50:18 2009 @@ -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_tx.c,v 1.71 2009/01/28 03:41:27 steveu Exp $ + * $Id: v27ter_tx.c,v 1.72 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -44,6 +44,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" @@ -292,7 +293,7 @@ /* Now create and modulate the carrier */ z = dds_complexf(&(s->carrier_phase), s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ - amp[sample] = (int16_t) lrintf((x.re*z.re - x.im*z.im)*s->gain_4800); + amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain_4800); #endif } } @@ -333,7 +334,7 @@ /* Now create and modulate the carrier */ z = dds_complexf(&(s->carrier_phase), s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ - amp[sample] = (int16_t) lrintf((x.re*z.re - x.im*z.im)*s->gain_2400); + amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain_2400); #endif } } Modified: freeswitch/trunk/libs/spandsp/src/v29rx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v29rx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v29rx.c Tue Feb 3 12:50:18 2009 @@ -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.152 2009/01/30 10:22:23 steveu Exp $ + * $Id: v29rx.c,v 1.153 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/src/v29tx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v29tx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v29tx.c Tue Feb 3 12:50:18 2009 @@ -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: v29tx.c,v 1.84 2009/01/28 03:41:27 steveu Exp $ + * $Id: v29tx.c,v 1.85 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -44,6 +44,7 @@ #include "floating_fudge.h" #include "spandsp/telephony.h" +#include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" @@ -245,7 +246,7 @@ /* Now create and modulate the carrier */ z = dds_complexf(&(s->carrier_phase), s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ - amp[sample] = (int16_t) lrintf((x.re*z.re - x.im*z.im)*s->gain); + amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain); #endif } return sample; Modified: freeswitch/trunk/libs/spandsp/src/v42.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v42.c (original) +++ freeswitch/trunk/libs/spandsp/src/v42.c Tue Feb 3 12:50:18 2009 @@ -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: v42.c,v 1.47 2009/01/05 13:48:32 steveu Exp $ + * $Id: v42.c,v 1.48 2009/02/03 16:28:40 steveu Exp $ */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. */ @@ -89,8 +89,8 @@ static void t401_expired(span_sched_state_t *s, void *user_data); static void t403_expired(span_sched_state_t *s, void *user_data); -void lapm_reset(lapm_state_t *s); -void lapm_restart(lapm_state_t *s); +SPAN_DECLARE(void) lapm_reset(lapm_state_t *s); +SPAN_DECLARE(void) lapm_restart(lapm_state_t *s); static void lapm_link_down(lapm_state_t *s); @@ -667,7 +667,7 @@ } /*- End of function --------------------------------------------------------*/ -void lapm_reset(lapm_state_t *s) +SPAN_DECLARE(void) lapm_reset(lapm_state_t *s) { lapm_frame_queue_t *f; lapm_frame_queue_t *p; @@ -709,7 +709,7 @@ } /*- End of function --------------------------------------------------------*/ -void lapm_receive(void *user_data, const uint8_t *frame, int len, int ok) +SPAN_DECLARE(void) lapm_receive(void *user_data, const uint8_t *frame, int len, int ok) { lapm_state_t *s; lapm_frame_queue_t *f; @@ -1068,7 +1068,7 @@ } /*- End of function --------------------------------------------------------*/ -void lapm_restart(lapm_state_t *s) +SPAN_DECLARE(void) lapm_restart(lapm_state_t *s) { #if 0 if (s->state != LAPM_RELEASE) Modified: freeswitch/trunk/libs/spandsp/src/v42bis.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v42bis.c (original) +++ freeswitch/trunk/libs/spandsp/src/v42bis.c Tue Feb 3 12:50:18 2009 @@ -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: v42bis.c,v 1.35 2009/01/05 13:48:32 steveu Exp $ + * $Id: v42bis.c,v 1.36 2009/02/03 16:28:40 steveu Exp $ */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. @@ -353,7 +353,7 @@ /*- End of function --------------------------------------------------------*/ #if 0 -int v42bis_compress_dump(v42bis_state_t *s) +SPAN_DECLARE(int) v42bis_compress_dump(v42bis_state_t *s) { int i; @@ -583,7 +583,7 @@ /*- End of function --------------------------------------------------------*/ #if 0 -int v42bis_decompress_dump(v42bis_state_t *s) +SPAN_DECLARE(int) v42bis_decompress_dump(v42bis_state_t *s) { int i; @@ -615,15 +615,15 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v42bis_state_t *) v42bis_init(v42bis_state_t *s, - int negotiated_p0, - int negotiated_p1, - int negotiated_p2, - v42bis_frame_handler_t frame_handler, - void *frame_user_data, - int max_frame_len, - v42bis_data_handler_t data_handler, - void *data_user_data, - int max_data_len) + int negotiated_p0, + int negotiated_p1, + int negotiated_p2, + v42bis_frame_handler_t frame_handler, + void *frame_user_data, + int max_frame_len, + v42bis_data_handler_t data_handler, + void *data_user_data, + int max_data_len) { int i; Modified: freeswitch/trunk/libs/spandsp/src/v8.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v8.c (original) +++ freeswitch/trunk/libs/spandsp/src/v8.c Tue Feb 3 12:50:18 2009 @@ -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: v8.c,v 1.37 2009/01/28 03:41:27 steveu Exp $ + * $Id: v8.c,v 1.38 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -857,10 +857,10 @@ /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s, - int caller, - int available_modulations, - v8_result_handler_t *result_handler, - void *user_data) + int caller, + int available_modulations, + v8_result_handler_t *result_handler, + void *user_data) { if (s == NULL) { Modified: freeswitch/trunk/libs/spandsp/src/vector_float.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/vector_float.c (original) +++ freeswitch/trunk/libs/spandsp/src/vector_float.c Tue Feb 3 12:50:18 2009 @@ -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: vector_float.c,v 1.19 2009/01/28 03:41:27 steveu Exp $ + * $Id: vector_float.c,v 1.20 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ @@ -118,7 +118,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_copyl(long double z[], const long double x[], int n) +SPAN_DECLARE(void) vec_copyl(long double z[], const long double x[], int n) { int i; @@ -178,7 +178,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_negatel(long double z[], const long double x[], int n) +SPAN_DECLARE(void) vec_negatel(long double z[], const long double x[], int n) { int i; @@ -232,7 +232,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_zerol(long double z[], int n) +SPAN_DECLARE(void) vec_zerol(long double z[], int n) { int i; @@ -286,7 +286,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_setl(long double z[], long double x, int n) +SPAN_DECLARE(void) vec_setl(long double z[], long double x, int n) { int i; @@ -344,7 +344,8 @@ } /*- End of function --------------------------------------------------------*/ -void vec_addl(long double z[], const long double x[], const long double y[], int n) +#if defined(HAVE_LONG_DOUBLE) +SPAN_DECLARE(void) vec_addl(long double z[], const long double x[], const long double y[], int n) { int i; @@ -352,6 +353,7 @@ z[i] = x[i] + y[i]; } /*- End of function --------------------------------------------------------*/ +#endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n) @@ -408,7 +410,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_scaledxy_addl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n) +SPAN_DECLARE(void) vec_scaledxy_addl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n) { int i; @@ -470,7 +472,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n) +SPAN_DECLARE(void) vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n) { int i; @@ -529,7 +531,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_subl(long double z[], const long double x[], const long double y[], int n) +SPAN_DECLARE(void) vec_subl(long double z[], const long double x[], const long double y[], int n) { int i; @@ -558,7 +560,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_scaledxy_subl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n) +SPAN_DECLARE(void) vec_scaledxy_subl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n) { int i; @@ -665,7 +667,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_scalar_addl(long double z[], const long double x[], long double y, int n) +SPAN_DECLARE(void) vec_scalar_addl(long double z[], const long double x[], long double y, int n) { int i; @@ -724,7 +726,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_scalar_subl(long double z[], const long double x[], long double y, int n) +SPAN_DECLARE(void) vec_scalar_subl(long double z[], const long double x[], long double y, int n) { int i; @@ -784,7 +786,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -void vec_mull(long double z[], const long double x[], const long double y[], int n) +SPAN_DECLARE(void) vec_mull(long double z[], const long double x[], const long double y[], int n) { int i; @@ -858,7 +860,7 @@ /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) -long double vec_dot_prodl(const long double x[], const long double y[], int n) +SPAN_DECLARE(long double) vec_dot_prodl(const long double x[], const long double y[], int n) { int i; long double z; Modified: freeswitch/trunk/libs/spandsp/src/vector_int.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/vector_int.c (original) +++ freeswitch/trunk/libs/spandsp/src/vector_int.c Tue Feb 3 12:50:18 2009 @@ -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: vector_int.c,v 1.23 2009/01/28 03:41:27 steveu Exp $ + * $Id: vector_int.c,v 1.24 2009/02/03 16:28:40 steveu Exp $ */ /*! \file */ Modified: freeswitch/trunk/libs/spandsp/tests/t31_tests.c ============================================================================== --- freeswitch/trunk/libs/spandsp/tests/t31_tests.c (original) +++ freeswitch/trunk/libs/spandsp/tests/t31_tests.c Tue Feb 3 12:50:18 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: t31_tests.c,v 1.69 2009/01/23 16:07:14 steveu Exp $ + * $Id: t31_tests.c,v 1.70 2009/02/02 13:05:28 steveu Exp $ */ /*! \file */ @@ -106,7 +106,8 @@ RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), //<DIS frame data> - RESPONSE("\xFF\x13\x80\x00\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\x78\x57\x10\x03"), + RESPONSE("\xFF\x13\x80\x00\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\x78\x57\x10\x03"), // For audio FAXing + //RESPONSE("\xFF\x13\x80\x04\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\xE4\xE7\x10\x03"), // For T.38 FAXing RESPONSE("\r\nOK\r\n"), //EXCHANGE("AT+FRH=3\r", "\r\nNO CARRIER\r\n"), EXCHANGE("AT+FTH=3\r", "\r\nCONNECT\r\n"),
participants (1)
-
FreeSWITCH SVN