提交 13fbaf7e authored 作者: Steve Underwood's avatar Steve Underwood

Tweaks for spandsp

上级 7c7967fb
...@@ -32,8 +32,8 @@ typedef struct ...@@ -32,8 +32,8 @@ typedef struct
{ {
/*! \brief Internet Aware FAX mode bit mask. */ /*! \brief Internet Aware FAX mode bit mask. */
int iaf; int iaf;
/*! \brief Required time between T.38 transmissions, in milliseconds. */ /*! \brief Required time between T.38 transmissions, in microseconds. */
int ms_per_tx_chunk; int us_per_tx_chunk;
/*! \brief Bit fields controlling the way data is packed into chunked for transmission. */ /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */
int chunking_modes; int chunking_modes;
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
#if !defined(_SPANDSP_PRIVATE_V22BIS_H_) #if !defined(_SPANDSP_PRIVATE_V22BIS_H_)
#define _SPANDSP_PRIVATE_V22BIS_H_ #define _SPANDSP_PRIVATE_V22BIS_H_
/*! The length of the equalizer buffer */ /*! The number of steps to the left and to the right of the target position in the equalizer buffer. */
#define V22BIS_EQUALIZER_LEN 17 #define V22BIS_EQUALIZER_LEN 7
/*! Samples before the target position in the equalizer buffer */ /*! One less than a power of 2 >= (2*V22BIS_EQUALIZER_LEN + 1) */
#define V22BIS_EQUALIZER_PRE_LEN 8 #define V22BIS_EQUALIZER_MASK 15
/*! The number of taps in the transmit pulse shaping filter */ /*! The number of taps in the transmit pulse shaping filter */
#define V22BIS_TX_FILTER_STEPS 9 #define V22BIS_TX_FILTER_STEPS 9
...@@ -65,12 +65,6 @@ enum ...@@ -65,12 +65,6 @@ enum
V22BIS_TX_TRAINING_STAGE_PARKED V22BIS_TX_TRAINING_STAGE_PARKED
}; };
#if defined(SPANDSP_USE_FIXED_POINT)
extern const complexi16_t v22bis_constellation[16];
#else
extern const complexf_t v22bis_constellation[16];
#endif
/*! /*!
V.22bis modem descriptor. This defines the working state for a single instance V.22bis modem descriptor. This defines the working state for a single instance
of a V.22bis modem. of a V.22bis modem.
...@@ -99,15 +93,10 @@ struct v22bis_state_s ...@@ -99,15 +93,10 @@ struct v22bis_state_s
/* Receive section */ /* Receive section */
struct struct
{ {
#if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
/*! \brief The scaling factor accessed by the AGC algorithm. */ #if defined(SPANDSP_USE_FIXED_POINTx)
int16_t agc_scaling;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
int16_t rrc_filter[V22BIS_RX_FILTER_STEPS]; int16_t rrc_filter[V22BIS_RX_FILTER_STEPS];
#else #else
/*! \brief The scaling factor accessed by the AGC algorithm. */
float agc_scaling;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
float rrc_filter[V22BIS_RX_FILTER_STEPS]; float rrc_filter[V22BIS_RX_FILTER_STEPS];
#endif #endif
/*! \brief Current offset into the RRC pulse shaping filter buffer. */ /*! \brief Current offset into the RRC pulse shaping filter buffer. */
...@@ -127,27 +116,19 @@ struct v22bis_state_s ...@@ -127,27 +116,19 @@ struct v22bis_state_s
/*! \brief >0 if a signal above the minimum is present. It may or may not be a V.22bis signal. */ /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.22bis signal. */
int signal_present; int signal_present;
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
float training_error;
/*! \brief The current phase of the carrier (i.e. the DDS parameter). */ /*! \brief The current phase of the carrier (i.e. the DDS parameter). */
uint32_t carrier_phase; uint32_t carrier_phase;
/*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
int32_t carrier_phase_rate; int32_t carrier_phase_rate;
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
int32_t training_error;
/*! \brief The proportional part of the carrier tracking filter. */
int32_t carrier_track_p;
/*! \brief The integral part of the carrier tracking filter. */
int32_t carrier_track_i;
#else
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
float training_error;
/*! \brief The proportional part of the carrier tracking filter. */ /*! \brief The proportional part of the carrier tracking filter. */
float carrier_track_p; float carrier_track_p;
/*! \brief The integral part of the carrier tracking filter. */ /*! \brief The integral part of the carrier tracking filter. */
float carrier_track_i; float carrier_track_i;
#endif
/*! \brief A callback function which may be enabled to report every symbol's /*! \brief A callback function which may be enabled to report every symbol's
constellation position. */ constellation position. */
...@@ -162,23 +143,21 @@ struct v22bis_state_s ...@@ -162,23 +143,21 @@ struct v22bis_state_s
int32_t carrier_on_power; int32_t carrier_on_power;
/*! \brief The power meter level at which carrier off is declared. */ /*! \brief The power meter level at which carrier off is declared. */
int32_t carrier_off_power; int32_t carrier_off_power;
/*! \brief The scaling factor accessed by the AGC algorithm. */
float agc_scaling;
int constellation_state; int constellation_state;
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The current delta factor for updating the equalizer coefficients. */
int16_t eq_delta;
/*! \brief The adaptive equalizer coefficients. */
complexi16_t eq_coeff[V22BIS_EQUALIZER_LEN];
/*! \brief The equalizer signal buffer. */
complexi16_t eq_buf[V22BIS_EQUALIZER_LEN];
#else
/*! \brief The current delta factor for updating the equalizer coefficients. */ /*! \brief The current delta factor for updating the equalizer coefficients. */
float eq_delta; float eq_delta;
#if defined(SPANDSP_USE_FIXED_POINTx)
/*! \brief The adaptive equalizer coefficients. */ /*! \brief The adaptive equalizer coefficients. */
complexf_t eq_coeff[V22BIS_EQUALIZER_LEN]; complexi_t eq_coeff[2*V22BIS_EQUALIZER_LEN + 1];
/*! \brief The equalizer signal buffer. */ /*! \brief The equalizer signal buffer. */
complexf_t eq_buf[V22BIS_EQUALIZER_LEN]; complexi_t eq_buf[V22BIS_EQUALIZER_MASK + 1];
#else
complexf_t eq_coeff[2*V22BIS_EQUALIZER_LEN + 1];
complexf_t eq_buf[V22BIS_EQUALIZER_MASK + 1];
#endif #endif
/*! \brief Current offset into the equalizer buffer. */ /*! \brief Current offset into the equalizer buffer. */
int eq_step; int eq_step;
...@@ -204,24 +183,11 @@ struct v22bis_state_s ...@@ -204,24 +183,11 @@ struct v22bis_state_s
/* Transmit section */ /* Transmit section */
struct struct
{ {
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The guard tone level. */
int16_t guard_tone_gain;
/*! \brief The gain factor needed to achieve the specified output power. */
int16_t gain;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
int16_t rrc_filter_re[V22BIS_TX_FILTER_STEPS];
int16_t rrc_filter_im[V22BIS_TX_FILTER_STEPS];
#else
/*! \brief The guard tone level. */
float guard_tone_gain;
/*! \brief The gain factor needed to achieve the specified output power. */ /*! \brief The gain factor needed to achieve the specified output power. */
float gain; float gain;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
float rrc_filter_re[V22BIS_TX_FILTER_STEPS];
float rrc_filter_im[V22BIS_TX_FILTER_STEPS];
#endif
/*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
complexf_t rrc_filter[2*V22BIS_TX_FILTER_STEPS];
/*! \brief Current offset into the RRC pulse shaping filter buffer. */ /*! \brief Current offset into the RRC pulse shaping filter buffer. */
int rrc_filter_step; int rrc_filter_step;
...@@ -243,6 +209,7 @@ struct v22bis_state_s ...@@ -243,6 +209,7 @@ struct v22bis_state_s
uint32_t guard_phase; uint32_t guard_phase;
/*! \brief The update rate for the phase of the guard tone (i.e. the DDS increment). */ /*! \brief The update rate for the phase of the guard tone (i.e. the DDS increment). */
int32_t guard_phase_rate; int32_t guard_phase_rate;
float guard_level;
/*! \brief The current fractional phase of the baud timing. */ /*! \brief The current fractional phase of the baud timing. */
int baud_phase; int baud_phase;
/*! \brief The code number for the current position in the constellation. */ /*! \brief The code number for the current position in the constellation. */
......
...@@ -61,6 +61,8 @@ enum ...@@ -61,6 +61,8 @@ enum
*/ */
typedef struct v22bis_state_s v22bis_state_t; typedef struct v22bis_state_s v22bis_state_t;
extern const complexf_t v22bis_constellation[16];
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" extern "C"
{ {
...@@ -86,11 +88,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len); ...@@ -86,11 +88,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len);
\brief Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients.
\param coeffs The vector of complex coefficients. \param coeffs The vector of complex coefficients.
\return The number of coefficients in the vector. */ \return The number of coefficients in the vector. */
#if defined(SPANDSP_USE_FIXED_POINT)
SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexi16_t **coeffs);
#else
SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs); SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs);
#endif
/*! Get the current received carrier frequency. /*! Get the current received carrier frequency.
\param s The modem context. \param s The modem context.
......
...@@ -230,13 +230,17 @@ static void equalizer_reset(v29_rx_state_t *s) ...@@ -230,13 +230,17 @@ static void equalizer_reset(v29_rx_state_t *s)
{ {
/* Start with an equalizer based on everything being perfect */ /* Start with an equalizer based on everything being perfect */
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
static const complexi16_t x = {3*FP_FACTOR, 0*FP_FACTOR};
cvec_zeroi16(s->eq_coeff, V29_EQUALIZER_LEN); cvec_zeroi16(s->eq_coeff, V29_EQUALIZER_LEN);
s->eq_coeff[V29_EQUALIZER_PRE_LEN] = complex_seti16(3*FP_FACTOR, 0*FP_FACTOR); s->eq_coeff[V29_EQUALIZER_PRE_LEN] = x;
cvec_zeroi16(s->eq_buf, V29_EQUALIZER_LEN); cvec_zeroi16(s->eq_buf, V29_EQUALIZER_LEN);
s->eq_delta = 32768.0f*EQUALIZER_DELTA/V29_EQUALIZER_LEN; s->eq_delta = 32768.0f*EQUALIZER_DELTA/V29_EQUALIZER_LEN;
#else #else
static const complexf_t x = {3.0f, 0.0f};
cvec_zerof(s->eq_coeff, V29_EQUALIZER_LEN); cvec_zerof(s->eq_coeff, V29_EQUALIZER_LEN);
s->eq_coeff[V29_EQUALIZER_PRE_LEN] = complex_setf(3.0f, 0.0f); s->eq_coeff[V29_EQUALIZER_PRE_LEN] = x;
cvec_zerof(s->eq_buf, V29_EQUALIZER_LEN); cvec_zerof(s->eq_buf, V29_EQUALIZER_LEN);
s->eq_delta = EQUALIZER_DELTA/V29_EQUALIZER_LEN; s->eq_delta = EQUALIZER_DELTA/V29_EQUALIZER_LEN;
#endif #endif
...@@ -538,7 +542,7 @@ static __inline__ void symbol_sync(v29_rx_state_t *s) ...@@ -538,7 +542,7 @@ static __inline__ void symbol_sync(v29_rx_state_t *s)
i = (v > 1000.0f) ? 5 : 1; i = (v > 1000.0f) ? 5 : 1;
if (s->baud_phase < 0.0f) if (s->baud_phase < 0.0f)
i = -i; i = -i;
//printf("v = %10.5f %5d - %f %f %d %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction); //printf("v = %10.5f %5d - %f %f %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction);
s->eq_put_step += i; s->eq_put_step += i;
s->total_baud_timing_correction += i; s->total_baud_timing_correction += i;
} }
...@@ -645,8 +649,7 @@ static void process_half_baud(v29_rx_state_t *s, complexf_t *sample) ...@@ -645,8 +649,7 @@ static void process_half_baud(v29_rx_state_t *s, complexf_t *sample)
if (i) if (i)
{ {
j = i & 0xF; j = i & 0xF;
ang = (s->angles[j] - s->start_angles[0])/i ang = (s->angles[j] - s->start_angles[0])/i + (s->angles[j | 0x1] - s->start_angles[1])/i;
+ (s->angles[j | 0x1] - s->start_angles[1])/i;
s->carrier_phase_rate += 3*(ang/20); s->carrier_phase_rate += 3*(ang/20);
} }
span_log(&s->logging, SPAN_LOG_FLOW, "Coarse carrier frequency %7.2f\n", dds_frequencyf(s->carrier_phase_rate)); span_log(&s->logging, SPAN_LOG_FLOW, "Coarse carrier frequency %7.2f\n", dds_frequencyf(s->carrier_phase_rate));
...@@ -719,11 +722,12 @@ static void process_half_baud(v29_rx_state_t *s, complexf_t *sample) ...@@ -719,11 +722,12 @@ static void process_half_baud(v29_rx_state_t *s, complexf_t *sample)
if (++s->training_count >= V29_TRAINING_SEG_3_LEN - 48) if (++s->training_count >= V29_TRAINING_SEG_3_LEN - 48)
{ {
s->training_stage = TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST; s->training_stage = TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST;
s->training_error = 0.0f;
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
s->training_error = 0;
s->carrier_track_i = 200; s->carrier_track_i = 200;
s->carrier_track_p = 1000000; s->carrier_track_p = 1000000;
#else #else
s->training_error = 0.0f;
s->carrier_track_i = 200.0f; s->carrier_track_i = 200.0f;
s->carrier_track_p = 1000000.0f; s->carrier_track_p = 1000000.0f;
#endif #endif
...@@ -946,10 +950,12 @@ SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len) ...@@ -946,10 +950,12 @@ SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len)
parked, after training failure. */ parked, after training failure. */
s->eq_put_step -= RX_PULSESHAPER_COEFF_SETS; s->eq_put_step -= RX_PULSESHAPER_COEFF_SETS;
step = -s->eq_put_step; step = -s->eq_put_step;
if (step > RX_PULSESHAPER_COEFF_SETS - 1)
step = RX_PULSESHAPER_COEFF_SETS - 1;
if (step < 0) if (step < 0)
step += RX_PULSESHAPER_COEFF_SETS; step += RX_PULSESHAPER_COEFF_SETS;
if (step < 0)
step = 0;
else if (step > RX_PULSESHAPER_COEFF_SETS - 1)
step = RX_PULSESHAPER_COEFF_SETS - 1;
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_re[step], V29_RX_FILTER_STEPS, s->rrc_filter_step); v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_re[step], V29_RX_FILTER_STEPS, s->rrc_filter_step);
sample.re = (v*s->agc_scaling) >> 15; sample.re = (v*s->agc_scaling) >> 15;
......
...@@ -24,26 +24,18 @@ ...@@ -24,26 +24,18 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#if !defined(FP_SCALE)
#if defined(SPANDSP_USE_FIXED_POINT)
#define FP_SCALE(x) ((int16_t) x)
#else
#define FP_SCALE(x) (x)
#endif
#endif
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
static const complexi16_t v29_abab_constellation[6] = static const complexi16_t v29_abab_constellation[6] =
#else #else
static const complexf_t v29_abab_constellation[6] = static const complexf_t v29_abab_constellation[6] =
#endif #endif
{ {
{FP_SCALE( 3.0f), FP_SCALE(-3.0f)}, /* 315deg high 9600 */ { 3, -3}, /* 315deg high 9600 */
{FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ {-3, 0}, /* 180deg low */
{FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low 7200 */ { 1, -1}, /* 315deg low 7200 */
{FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ {-3, 0}, /* 180deg low */
{FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low 4800 */ { 0, -3}, /* 270deg low 4800 */
{FP_SCALE(-3.0f), FP_SCALE( 0.0f)} /* 180deg low */ {-3, 0} /* 180deg low */
}; };
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
...@@ -52,12 +44,12 @@ static const complexi16_t v29_cdcd_constellation[6] = ...@@ -52,12 +44,12 @@ static const complexi16_t v29_cdcd_constellation[6] =
static const complexf_t v29_cdcd_constellation[6] = static const complexf_t v29_cdcd_constellation[6] =
#endif #endif
{ {
{FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 9600 */ { 3, 0}, /* 0deg low 9600 */
{FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */ {-3, 3}, /* 135deg high */
{FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 7200 */ { 3, 0}, /* 0deg low 7200 */
{FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */ {-1, 1}, /* 135deg low */
{FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 4800 */ { 3, 0}, /* 0deg low 4800 */
{FP_SCALE( 0.0f), FP_SCALE( 3.0f)} /* 90deg low */ { 0, 3} /* 90deg low */
}; };
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
...@@ -66,22 +58,22 @@ static const complexi16_t v29_9600_constellation[16] = ...@@ -66,22 +58,22 @@ static const complexi16_t v29_9600_constellation[16] =
static const complexf_t v29_9600_constellation[16] = static const complexf_t v29_9600_constellation[16] =
#endif #endif
{ {
{FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low */ { 3, 0}, /* 0deg low */
{FP_SCALE( 1.0f), FP_SCALE( 1.0f)}, /* 45deg low */ { 1, 1}, /* 45deg low */
{FP_SCALE( 0.0f), FP_SCALE( 3.0f)}, /* 90deg low */ { 0, 3}, /* 90deg low */
{FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */ {-1, 1}, /* 135deg low */
{FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ {-3, 0}, /* 180deg low */
{FP_SCALE(-1.0f), FP_SCALE(-1.0f)}, /* 225deg low */ {-1, -1}, /* 225deg low */
{FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low */ { 0, -3}, /* 270deg low */
{FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low */ { 1, -1}, /* 315deg low */
{FP_SCALE( 5.0f), FP_SCALE( 0.0f)}, /* 0deg high */ { 5, 0}, /* 0deg high */
{FP_SCALE( 3.0f), FP_SCALE( 3.0f)}, /* 45deg high */ { 3, 3}, /* 45deg high */
{FP_SCALE( 0.0f), FP_SCALE( 5.0f)}, /* 90deg high */ { 0, 5}, /* 90deg high */
{FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */ {-3, 3}, /* 135deg high */
{FP_SCALE(-5.0f), FP_SCALE( 0.0f)}, /* 180deg high */ {-5, 0}, /* 180deg high */
{FP_SCALE(-3.0f), FP_SCALE(-3.0f)}, /* 225deg high */ {-3, -3}, /* 225deg high */
{FP_SCALE( 0.0f), FP_SCALE(-5.0f)}, /* 270deg high */ { 0, -5}, /* 270deg high */
{FP_SCALE( 3.0f), FP_SCALE(-3.0f)} /* 315deg high */ { 3, -3} /* 315deg high */
}; };
/*- End of file ------------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/
...@@ -1024,9 +1024,9 @@ SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms ...@@ -1024,9 +1024,9 @@ SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms
{ {
/* Send the ANSam or ANSam/ tone */ /* Send the ANSam or ANSam/ tone */
s->state = V8_CM_WAIT; s->state = V8_CM_WAIT;
s->negotiation_timer = ms_to_samples(200 + 5000);
v8_decode_init(s); v8_decode_init(s);
modem_connect_tones_tx_init(&s->ansam_tx, s->parms.modem_connect_tone); modem_connect_tones_tx_init(&s->ansam_tx, s->parms.modem_connect_tone);
s->negotiation_timer = ms_to_samples(200 + 5000);
s->modem_connect_tone_tx_on = ms_to_samples(75) + 1; s->modem_connect_tone_tx_on = ms_to_samples(75) + 1;
} }
......
...@@ -300,7 +300,7 @@ t38_core_tests_SOURCES = t38_core_tests.c ...@@ -300,7 +300,7 @@ t38_core_tests_SOURCES = t38_core_tests.c
t38_core_tests_LDADD = $(LIBDIR) -lspandsp t38_core_tests_LDADD = $(LIBDIR) -lspandsp
t38_decode_SOURCES = t38_decode.c fax_utils.c pcap_parse.c udptl.c t38_decode_SOURCES = t38_decode.c fax_utils.c pcap_parse.c udptl.c
t38_decode_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp -lpcap t38_decode_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
t38_non_ecm_buffer_tests_SOURCES = t38_non_ecm_buffer_tests.c t38_non_ecm_buffer_tests_SOURCES = t38_non_ecm_buffer_tests.c
t38_non_ecm_buffer_tests_LDADD = $(LIBDIR) -lspandsp t38_non_ecm_buffer_tests_LDADD = $(LIBDIR) -lspandsp
......
...@@ -287,7 +287,7 @@ static void hdlc_rx_status(void *user_data, int status) ...@@ -287,7 +287,7 @@ static void hdlc_rx_status(void *user_data, int status)
faxtester_state_t *s; faxtester_state_t *s;
s = (faxtester_state_t *) user_data; s = (faxtester_state_t *) user_data;
fprintf(stderr, "HDLC carrier status is %s (%d)\n", signal_status_to_str(status), status); span_log(&s->logging, SPAN_LOG_FLOW, "HDLC carrier status is %s (%d)\n", signal_status_to_str(status), status);
switch (status) switch (status)
{ {
case SIG_STATUS_TRAINING_FAILED: case SIG_STATUS_TRAINING_FAILED:
...@@ -409,9 +409,7 @@ int faxtester_rx(faxtester_state_t *s, int16_t *amp, int len) ...@@ -409,9 +409,7 @@ int faxtester_rx(faxtester_state_t *s, int16_t *amp, int len)
int faxtester_tx(faxtester_state_t *s, int16_t *amp, int max_len) int faxtester_tx(faxtester_state_t *s, int16_t *amp, int max_len)
{ {
int len; int len;
int required_len;
required_len = max_len;
len = 0; len = 0;
if (s->transmit) if (s->transmit)
{ {
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
run_fax_test() run_fax_test()
{ {
rm -f fax_tests_1.tif rm -f fax_tests_1.tif
echo -i ${FILE} ${OPTS} echo -i ${FILE} ${OPTS} -i ${FILE}
./fax_tests -i ${FILE} ${OPTS} >xyzzy 2>xyzzy2 ./fax_tests ${OPTS} -i ${FILE} >xyzzy 2>xyzzy2
RETVAL=$? RETVAL=$?
if [ $RETVAL != 0 ] if [ $RETVAL != 0 ]
then then
...@@ -28,7 +28,7 @@ run_fax_test() ...@@ -28,7 +28,7 @@ run_fax_test()
fi fi
# Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t
# option means the normal differences in tags will be ignored. # option means the normal differences in tags will be ignored.
tiffcmp -t ${FILE} fax_tests_1.tif #>/dev/null tiffcmp -t ${FILE} fax_tests.tif #>/dev/null
RETVAL=$? RETVAL=$?
if [ $RETVAL != 0 ] if [ $RETVAL != 0 ]
then then
...@@ -39,165 +39,106 @@ run_fax_test() ...@@ -39,165 +39,106 @@ run_fax_test()
echo tested ${FILE} echo tested ${FILE}
} }
OPTS="-e" ITUTESTS_DIR=../test-data/itu/fax
FILE="../itutests/fax/R8_385_A4.tif" for OPTS in "-p AA" "-p AA -e" "-p TT" "-p TT -e" "-p GG" "-p GG -e" "-p TG" "-p TG -e" "-p GT" "-p GT -e"
run_fax_test do
FILE="${ITUTESTS_DIR}/R8_385_A4.tif"
run_fax_test
FILE="../itutests/fax/R8_385_B4.tif" FILE="${ITUTESTS_DIR}/R8_385_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_385_A3.tif" FILE="${ITUTESTS_DIR}/R8_385_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_77_A4.tif" FILE="${ITUTESTS_DIR}/R8_77_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_77_B4.tif" FILE="${ITUTESTS_DIR}/R8_77_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_77_A3.tif" FILE="${ITUTESTS_DIR}/R8_77_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_154_A4.tif" FILE="${ITUTESTS_DIR}/R8_154_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_154_B4.tif" FILE="${ITUTESTS_DIR}/R8_154_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R8_154_A3.tif" FILE="${ITUTESTS_DIR}/R8_154_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R300_300_A4.tif" FILE="${ITUTESTS_DIR}/R300_300_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R300_300_B4.tif" FILE="${ITUTESTS_DIR}/R300_300_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R300_300_A3.tif" FILE="${ITUTESTS_DIR}/R300_300_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R300_600_A4.tif" FILE="${ITUTESTS_DIR}/R300_600_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R300_600_B4.tif" FILE="${ITUTESTS_DIR}/R300_600_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R300_600_A3.tif" FILE="${ITUTESTS_DIR}/R300_600_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R16_154_A4.tif" FILE="${ITUTESTS_DIR}/R16_154_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R16_154_B4.tif" FILE="${ITUTESTS_DIR}/R16_154_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R16_154_A3.tif" FILE="${ITUTESTS_DIR}/R16_154_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R16_800_A4.tif" FILE="${ITUTESTS_DIR}/R16_800_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R16_800_B4.tif" FILE="${ITUTESTS_DIR}/R16_800_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R16_800_A3.tif" FILE="${ITUTESTS_DIR}/R16_800_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R600_600_A4.tif" FILE="${ITUTESTS_DIR}/R600_600_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R600_600_B4.tif" FILE="${ITUTESTS_DIR}/R600_600_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R600_600_A3.tif" FILE="${ITUTESTS_DIR}/R600_600_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R600_1200_A4.tif" FILE="${ITUTESTS_DIR}/R600_1200_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R600_1200_B4.tif" FILE="${ITUTESTS_DIR}/R600_1200_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R600_1200_A3.tif" FILE="${ITUTESTS_DIR}/R600_1200_A3.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R1200_1200_A4.tif" FILE="${ITUTESTS_DIR}/R1200_1200_A4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R1200_1200_B4.tif" FILE="${ITUTESTS_DIR}/R1200_1200_B4.tif"
run_fax_test run_fax_test
FILE="../itutests/fax/R1200_1200_A3.tif" FILE="${ITUTESTS_DIR}/R1200_1200_A3.tif"
run_fax_test run_fax_test
done
OPTS=""
FILE="../itutests/fax/R8_385_A4.tif"
run_fax_test
FILE="../itutests/fax/R8_385_B4.tif"
run_fax_test
FILE="../itutests/fax/R8_385_A3.tif"
run_fax_test
FILE="../itutests/fax/R8_77_A4.tif"
run_fax_test
FILE="../itutests/fax/R8_77_B4.tif"
run_fax_test
FILE="../itutests/fax/R8_77_A3.tif"
run_fax_test
FILE="../itutests/fax/R8_154_A4.tif"
run_fax_test
FILE="../itutests/fax/R8_154_B4.tif"
run_fax_test
FILE="../itutests/fax/R8_154_A3.tif"
run_fax_test
FILE="../itutests/fax/R16_385_A4.tif"
#run_fax_test
FILE="../itutests/fax/R16_385_B4.tif"
#run_fax_test
FILE="../itutests/fax/R16_385_A3.tif"
#run_fax_test
FILE="../itutests/fax/R16_77_A4.tif"
#run_fax_test
FILE="../itutests/fax/R16_77_B4.tif"
#run_fax_test
FILE="../itutests/fax/R16_77_A3.tif"
#run_fax_test
FILE="../itutests/fax/R16_154_A4.tif"
run_fax_test
FILE="../itutests/fax/R16_154_B4.tif"
run_fax_test
FILE="../itutests/fax/R16_154_A3.tif"
run_fax_test
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论