diff --git a/libs/spandsp/spandsp-sim/g1050.c b/libs/spandsp/spandsp-sim/g1050.c index afdcf82d63..c1e8b9d415 100644 --- a/libs/spandsp/spandsp-sim/g1050.c +++ b/libs/spandsp/spandsp-sim/g1050.c @@ -780,7 +780,7 @@ static void g1050_core_init(g1050_core_state_t *s, g1050_core_model_t *parms, in /* How far into the first CLEAN interval we are. This is like the route flap initialzation. */ s->link_failure_counter = s->link_failure_interval_ticks - 99 - floor(s->link_failure_interval_ticks*q1050_rand()); s->link_recovery_counter = s->link_failure_duration_ticks; - + s->base_delay = parms->base_regional_delay; s->max_jitter = parms->max_jitter; s->prob_packet_loss = parms->prob_packet_loss/100.0; @@ -1053,7 +1053,7 @@ static int g1050_core_delay(g1050_core_state_t *s, static void g1050_simulate_chunk(g1050_state_t *s) { int i; - + s->base_time += 1.0; memcpy(&s->segment[0].delays[0], &s->segment[0].delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->segment[0].delays[0])); @@ -1116,7 +1116,7 @@ SPAN_DECLARE(g1050_state_t *) g1050_init(int model, mo = &g1050_standard_models[model]; memset(s, 0, sizeof(*s)); - + s->packet_rate = packet_rate; s->packet_size = packet_size; @@ -1190,7 +1190,7 @@ SPAN_DECLARE(void) g1050_dump_parms(int model, int speed_pattern) { g1050_channel_speeds_t *sp; g1050_model_t *mo; - + sp = &g1050_speed_patterns[speed_pattern - 1]; mo = &g1050_standard_models[model]; @@ -1245,8 +1245,8 @@ SPAN_DECLARE(int) g1050_put(g1050_state_t *s, const uint8_t buf[], int len, int } if (e) { - element->next = e->next; - element->prev = e; + element->next = e->next; + element->prev = e; e->next = element; } else diff --git a/libs/spandsp/spandsp-sim/line_model.c b/libs/spandsp/spandsp-sim/line_model.c index 001af2c581..4326ae7d29 100644 --- a/libs/spandsp/spandsp-sim/line_model.c +++ b/libs/spandsp/spandsp-sim/line_model.c @@ -221,7 +221,7 @@ static float calc_near_line_filter(one_way_line_model_state_t *s, float v) if (++p == s->near_filter_len) p = 0; s->near_buf_ptr = p; - + /* Apply the filter */ sum = 0.0f; for (j = 0; j < s->near_filter_len; j++) @@ -230,10 +230,10 @@ static float calc_near_line_filter(one_way_line_model_state_t *s, float v) if (++p >= s->near_filter_len) p = 0; } - + /* Add noise */ sum += awgn(&s->near_noise); - + return sum; } /*- End of function --------------------------------------------------------*/ @@ -250,7 +250,7 @@ static float calc_far_line_filter(one_way_line_model_state_t *s, float v) if (++p == s->far_filter_len) p = 0; s->far_buf_ptr = p; - + /* Apply the filter */ sum = 0.0f; for (j = 0; j < s->far_filter_len; j++) @@ -259,7 +259,7 @@ static float calc_far_line_filter(one_way_line_model_state_t *s, float v) if (++p >= s->far_filter_len) p = 0; } - + /* Add noise */ sum += awgn(&s->far_noise); @@ -267,7 +267,7 @@ static float calc_far_line_filter(one_way_line_model_state_t *s, float v) } /*- End of function --------------------------------------------------------*/ -SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, +SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, int16_t output[], const int16_t input[], int samples) @@ -302,10 +302,10 @@ SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, in = input[i]; /* Near end analogue section */ - + /* Line model filters & noise */ out = calc_near_line_filter(s, in); - + /* Long distance digital section */ amp[0] = out; @@ -319,10 +319,10 @@ SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, s->bulk_delay_ptr = 0; /* Far end analogue section */ - + /* Line model filters & noise */ out = calc_far_line_filter(s, out); - + if (s->mains_interference) { tone_gen(&s->mains_tone, amp, 1); @@ -352,7 +352,7 @@ SPAN_DECLARE(void) one_way_line_model_set_mains_pickup(one_way_line_model_state_ } /*- End of function --------------------------------------------------------*/ -SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, +SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, int16_t output1[], const int16_t input1[], int16_t output2[], @@ -486,7 +486,7 @@ SPAN_DECLARE(one_way_line_model_state_t *) one_way_line_model_init(int model, fl /* Put half the noise in each analogue section */ awgn_init_dbm0(&s->near_noise, 1234567, noise - 3.02f); awgn_init_dbm0(&s->far_noise, 1234567, noise - 3.02f); - + s->dc_offset = 0.0f; s->mains_interference = 0; @@ -554,7 +554,7 @@ SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model s->line2.near_co_hybrid_echo = pow(10, echo_level_co2/20.0f); s->line1.near_cpe_hybrid_echo = pow(10, echo_level_cpe1/20.0f); s->line2.near_cpe_hybrid_echo = pow(10, echo_level_cpe2/20.0f); - + return s; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/spandsp-sim/make_line_models.c b/libs/spandsp/spandsp-sim/make_line_models.c index 300de80c22..ed7cfe934e 100644 --- a/libs/spandsp/spandsp-sim/make_line_models.c +++ b/libs/spandsp/spandsp-sim/make_line_models.c @@ -69,7 +69,7 @@ /* Tabulated medium range telephone line response (from p 537, Digital Communication, John G. Proakis */ /* - amp 1.0 -> 2.15, freq = 3000 Hz -> 3.2, by 0.2 increments + amp 1.0 -> 2.15, freq = 3000 Hz -> 3.2, by 0.2 increments delay = 4 ms -> 2.2 */ @@ -849,7 +849,7 @@ static void generate_ad_edd(void) } //phase = 2.0f*M_PI*f*delay*0.001f; phase = 0.0f; -#if defined(HAVE_FFTW3_H) +#if defined(HAVE_FFTW3_H) in[i][0] = amp*cosf(phase); in[i][1] = amp*sinf(phase); in[FFT_SIZE - i][0] = in[i][0]; @@ -865,7 +865,7 @@ static void generate_ad_edd(void) for (i = 0; i < FFT_SIZE; i++) fprintf(outfile, "%5d %15.5f,%15.5f\n", i, in[i].re, in[i].im); #endif -#if defined(HAVE_FFTW3_H) +#if defined(HAVE_FFTW3_H) fftw_execute(p); #else fftw_one(p, in, out); @@ -892,7 +892,7 @@ static void generate_ad_edd(void) l = FFT_SIZE - (LINE_FILTER_SIZE - 1)/2; for (i = 0; i < LINE_FILTER_SIZE; i++) { - + #if defined(HAVE_FFTW3_H) impulse_responses[filter_sets][i] = out[l][0]/pw; #else @@ -1023,9 +1023,9 @@ int main(int argc, char *argv[]) generate_proakis(); generate_ad_edd(); - + fclose(outfile); - + if (argc > 1) { for (i = 0; i < LINE_FILTER_SIZE; i++) diff --git a/libs/spandsp/spandsp-sim/rfc2198_sim.c b/libs/spandsp/spandsp-sim/rfc2198_sim.c index b187ae6e15..6ecba89214 100644 --- a/libs/spandsp/spandsp-sim/rfc2198_sim.c +++ b/libs/spandsp/spandsp-sim/rfc2198_sim.c @@ -86,7 +86,7 @@ SPAN_DECLARE(int) rfc2198_sim_put(rfc2198_sim_state_t *s, memcpy(s->tx_pkt[s->next_pkt], buf, len); s->tx_pkt_len[s->next_pkt] = len; s->tx_pkt_seq_no[s->next_pkt] = seq_no; - + /* Construct the redundant packet */ p = buf2; slot = s->next_pkt; @@ -127,7 +127,7 @@ SPAN_DECLARE(int) rfc2198_sim_get(rfc2198_sim_state_t *s, uint8_t *p; uint16_t *q; int redundancy_depth; - + if (s->rx_queued_pkts) { /* We have some stuff from the last g1050_get() still to deliver */ diff --git a/libs/spandsp/spandsp-sim/spandsp/g1050.h b/libs/spandsp/spandsp-sim/spandsp/g1050.h index 731947b39c..687630e834 100644 --- a/libs/spandsp/spandsp-sim/spandsp/g1050.h +++ b/libs/spandsp/spandsp-sim/spandsp/g1050.h @@ -188,7 +188,7 @@ typedef struct /*! 3 seconds of predicted delays for the link */ double delays[3*G1050_TICKS_PER_SEC]; - + /*! A count of packets lost on the link. */ uint32_t lost_packets; /*! An extra debug count of packets lost on the link. */ diff --git a/libs/spandsp/spandsp-sim/spandsp/line_model.h b/libs/spandsp/spandsp-sim/spandsp/line_model.h index 550e8a80fe..8465d4b457 100644 --- a/libs/spandsp/spandsp-sim/spandsp/line_model.h +++ b/libs/spandsp/spandsp-sim/spandsp/line_model.h @@ -107,7 +107,7 @@ typedef struct float far_co_hybrid_echo; /*! DC offset impairment */ float dc_offset; - + /*! Mains pickup impairment */ int mains_interference; tone_gen_state_t mains_tone; @@ -122,7 +122,7 @@ typedef struct one_way_line_model_state_t line1; one_way_line_model_state_t line2; float fout1; - float fout2; + float fout2; } both_ways_line_model_state_t; #ifdef __cplusplus @@ -132,7 +132,7 @@ extern "C" SPAN_DECLARE_DATA extern const float *line_models[]; -SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, +SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, int16_t output1[], const int16_t input1[], int16_t output2[], @@ -142,7 +142,7 @@ SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, SPAN_DECLARE(void) both_ways_line_model_set_dc(both_ways_line_model_state_t *s, float dc1, float dc2); SPAN_DECLARE(void) both_ways_line_model_set_mains_pickup(both_ways_line_model_state_t *s, int f, float level1, float level2); - + SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model1, float noise1, float echo_level_cpe1, @@ -156,7 +156,7 @@ SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model SPAN_DECLARE(int) both_ways_line_model_release(both_ways_line_model_state_t *s); -SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, +SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, int16_t output[], const int16_t input[], int samples); diff --git a/libs/spandsp/spandsp-sim/test_utils.c b/libs/spandsp/spandsp-sim/test_utils.c index f02d08de30..d37c8977bb 100644 --- a/libs/spandsp/spandsp-sim/test_utils.c +++ b/libs/spandsp/spandsp-sim/test_utils.c @@ -272,7 +272,7 @@ SPAN_DECLARE(void) ifft(complex_t data[], int len) SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info) { codec_munge_state_t *s; - + if ((s = (codec_munge_state_t *) malloc(sizeof(*s)))) { switch (codec) @@ -362,7 +362,7 @@ SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len) static void sf_close_at_exit(void) { int i; - + for (i = 0; i < SF_MAX_HANDLE; i++) { if (sf_close_at_exit_list[i]) @@ -377,7 +377,7 @@ static void sf_close_at_exit(void) static int sf_record_handle(SNDFILE *handle) { int i; - + for (i = 0; i < SF_MAX_HANDLE; i++) { if (sf_close_at_exit_list[i] == NULL) @@ -448,7 +448,7 @@ SPAN_DECLARE(int) sf_close_telephony(SNDFILE *handle) { int res; int i; - + if ((res = sf_close(handle)) == 0) { for (i = 0; i < SF_MAX_HANDLE; i++) diff --git a/libs/spandsp/src/adsi.c b/libs/spandsp/src/adsi.c index 647bf371ab..44add41be0 100644 --- a/libs/spandsp/src/adsi.c +++ b/libs/spandsp/src/adsi.c @@ -88,7 +88,7 @@ static int adsi_tx_get_bit(void *user_data) { int bit; adsi_tx_state_t *s; - + s = (adsi_tx_state_t *) user_data; /* This is similar to the async. handling code in fsk.c, but a few special things are needed in the preamble, and postamble of an ADSI message. */ @@ -162,7 +162,7 @@ static int adsi_tx_get_bit(void *user_data) static int adsi_tdd_get_async_byte(void *user_data) { adsi_tx_state_t *s; - + s = (adsi_tx_state_t *) user_data; if (s->byte_no < s->msg_len) return s->msg[s->byte_no++]; @@ -241,7 +241,7 @@ static void adsi_rx_put_bit(void *user_data, int bit) { if (s->msg_len == 0) { - /* A message should start DLE SOH, but let's just check + /* A message should start DLE SOH, but let's just check we are starting with a DLE for now */ if (s->in_progress == (0x80 | DLE)) s->msg[s->msg_len++] = (uint8_t) s->in_progress; @@ -302,7 +302,7 @@ static void adsi_tdd_put_async_byte(void *user_data, int byte) { adsi_rx_state_t *s; uint8_t octet; - + s = (adsi_rx_state_t *) user_data; //printf("Rx bit %x\n", bit); if (byte < 0) @@ -604,7 +604,7 @@ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, in i += len - 2; s->msg[i++] = DLE; s->msg[i++] = ETX; - + /* Set the parity bits */ for (j = 0; j < i; j++) { @@ -639,7 +639,7 @@ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, in s->msg[len] = (uint8_t) ((-sum) & 0xFF); s->msg_len = len + 1; break; - } + } /* Prepare the bit sequencing */ s->byte_no = 0; s->bit_pos = 0; diff --git a/libs/spandsp/src/async.c b/libs/spandsp/src/async.c index 49e25fde23..4df12dffb6 100644 --- a/libs/spandsp/src/async.c +++ b/libs/spandsp/src/async.c @@ -212,7 +212,7 @@ SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data) { async_tx_state_t *s; int bit; - + s = (async_tx_state_t *) user_data; if (s->bitpos == 0) { @@ -281,7 +281,7 @@ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s, s->stop_bits = stop_bits; if (parity != ASYNC_PARITY_NONE) s->stop_bits++; - + s->get_byte = get_byte; s->user_data = user_data; diff --git a/libs/spandsp/src/at_interpreter.c b/libs/spandsp/src/at_interpreter.c index 1203d3caa8..1878ab2ed6 100644 --- a/libs/spandsp/src/at_interpreter.c +++ b/libs/spandsp/src/at_interpreter.c @@ -211,7 +211,7 @@ SPAN_DECLARE(void) at_set_at_rx_mode(at_state_t *s, int new_mode) SPAN_DECLARE(void) at_put_response(at_state_t *s, const char *t) { uint8_t buf[3]; - + buf[0] = s->p.s_regs[3]; buf[1] = s->p.s_regs[4]; buf[2] = '\0'; @@ -375,7 +375,7 @@ SPAN_DECLARE(void) at_reset_call_info(at_state_t *s) { at_call_id_t *call_id; at_call_id_t *next; - + for (call_id = s->call_id; call_id; call_id = next) { next = call_id->next; @@ -424,7 +424,7 @@ SPAN_DECLARE(void) at_display_call_info(at_state_t *s) { snprintf(buf, sizeof(buf), - "%s=%s", + "%s=%s", (call_id->id) ? call_id->id : "NULL", (call_id->value) ? call_id->value : ""); at_put_response(s, buf); @@ -437,7 +437,7 @@ SPAN_DECLARE(void) at_display_call_info(at_state_t *s) static int parse_num(const char **s, int max_value) { int i; - + /* The spec. says no digits is valid, and should be treated as zero. */ i = 0; while (isdigit((int) **s)) @@ -454,7 +454,7 @@ static int parse_num(const char **s, int max_value) static int parse_hex_num(const char **s, int max_value) { int i; - + /* The spec. says a hex value is always 2 digits, and the alpha digits are upper case. */ i = 0; @@ -859,7 +859,7 @@ static int process_class1_cmd(at_state_t *s, const char **t) allowed = "24,48,72,73,74,96,97,98,121,122,145,146"; break; } - + val = -1; if (!parse_out(s, t, &val, 255, NULL, allowed)) return TRUE; @@ -4043,11 +4043,11 @@ static const char *at_cmd_plus_IBC(at_state_t *s, const char *t) /* 0: In-band control service disabled 1: In-band control service enabled, 7-bit codes allowed, and top bit insignificant 2; In-band control service enabled, 7-bit codes allowed, and 8-bit codes available - + Circuits 105, 106, 107, 108, 109, 110, 125, 132, 133, 135, 142 in that order. For each one: 0: disabled 1: enabled - + DCE line connect status reports: 0: disabled 1: enabled */ @@ -4081,9 +4081,9 @@ static const char *at_cmd_plus_IBM(at_state_t *s, const char *t) T3 = entire interval -- N*T2 7: report the first time when is exceeded, and then each time is exceeded, and then once more when the mark idle period ends; T3 = entire mark idle period -- N*T2 - T1 - + T1 in units of 10ms - + T2 in units of 10ms */ locations[0] = NULL; locations[1] = NULL; @@ -4106,7 +4106,7 @@ static const char *at_cmd_plus_ICF(at_state_t *s, const char *t) 4: 7 data 2 stop 5: 7 data 1 parity 1 stop 6: 7 data 1 stop - + Parity 0: Odd 1: Even @@ -4235,7 +4235,7 @@ static const char *at_cmd_plus_MS(at_state_t *s, const char *t) static const char *at_cmd_plus_MSC(at_state_t *s, const char *t) { /* V.250 6.4.8 - Seamless rate change enable */ - /* 0 Disables V.34 seamless rate change + /* 0 Disables V.34 seamless rate change 1 Enables V.34 seamless rate change */ /* TODO: */ t += 4; diff --git a/libs/spandsp/src/awgn.c b/libs/spandsp/src/awgn.c index b432901bb2..582959cc93 100644 --- a/libs/spandsp/src/awgn.c +++ b/libs/spandsp/src/awgn.c @@ -29,14 +29,14 @@ paper somewhere. I can't track down where I got the original from, so that due recognition can be given. The original had no explicit copyright notice, and I hope nobody objects to its use here. - + Having a reasonable Gaussian noise generator is pretty important for telephony testing (in fact, pretty much any DSP testing), and this one seems to have served me OK. Since the generation of Gaussian noise is only for test purposes, and not a core system component, I don't intend to worry excessively about copyright issues, unless someone worries me. - + The non-core nature of this code also explains why it is unlikely to ever be optimised. */ diff --git a/libs/spandsp/src/bell_r2_mf.c b/libs/spandsp/src/bell_r2_mf.c index 76b0049453..dba407cddd 100644 --- a/libs/spandsp/src/bell_r2_mf.c +++ b/libs/spandsp/src/bell_r2_mf.c @@ -647,10 +647,10 @@ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s, s->digits_callback = callback; s->digits_callback_data = user_data; - s->hits[0] = + s->hits[0] = s->hits[1] = s->hits[2] = - s->hits[3] = + s->hits[3] = s->hits[4] = 0; for (i = 0; i < 6; i++) @@ -730,7 +730,7 @@ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples best = 1; second_best = 0; } - + for (i = 2; i < 6; i++) { energy[i] = goertzel_result(&s->out[i]); diff --git a/libs/spandsp/src/bert.c b/libs/spandsp/src/bert.c index 4ba0c335f7..a8ad5ad6b7 100644 --- a/libs/spandsp/src/bert.c +++ b/libs/spandsp/src/bert.c @@ -338,7 +338,7 @@ SPAN_DECLARE(void) bert_set_report(bert_state_t *s, int freq, bert_report_func_t s->report_frequency = freq; s->reporter = reporter; s->user_data = user_data; - + s->rx.report_countdown = s->report_frequency; } /*- End of function --------------------------------------------------------*/ @@ -487,7 +487,7 @@ SPAN_DECLARE(bert_state_t *) bert_init(bert_state_t *s, int limit, int pattern, } s->error_rate = 8; s->rx.measurement_step = MEASUREMENT_STEP; - + span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "BERT"); diff --git a/libs/spandsp/src/fax.c b/libs/spandsp/src/fax.c index 9b68b00601..ef7e33433a 100644 --- a/libs/spandsp/src/fax.c +++ b/libs/spandsp/src/fax.c @@ -219,7 +219,7 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len) int len; #if defined(LOG_FAX_AUDIO) int required_len; - + required_len = max_len; #endif len = 0; @@ -236,7 +236,7 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len) { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); - len = max_len; + len = max_len; } break; } @@ -248,7 +248,7 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len) { /* Pad to the requested length with silence */ memset(amp, 0, max_len*sizeof(int16_t)); - len = max_len; + len = max_len; } } #if defined(LOG_FAX_AUDIO) diff --git a/libs/spandsp/src/filter_tools.h b/libs/spandsp/src/filter_tools.h index 4df89adab4..cca1871cfd 100644 --- a/libs/spandsp/src/filter_tools.h +++ b/libs/spandsp/src/filter_tools.h @@ -48,7 +48,6 @@ void compute_raised_cosine_filter(double coeffs[], void compute_hilbert_transform(double coeffs[], int len); - #if defined(__cplusplus) } #endif diff --git a/libs/spandsp/src/g722.c b/libs/spandsp/src/g722.c index f2cca6b179..f223592dc8 100644 --- a/libs/spandsp/src/g722.c +++ b/libs/spandsp/src/g722.c @@ -367,7 +367,7 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8 else if (wd1 > 18432) wd1 = 18432; s->band[0].nb = (int16_t) wd1; - + /* Block 3L, SCALEL */ wd1 = (s->band[0].nb >> 6) & 31; wd2 = 8 - (s->band[0].nb >> 11); @@ -375,7 +375,7 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8 s->band[0].det = (int16_t) (wd3 << 2); block4(&s->band[0], dlow); - + if (!s->eight_k) { /* Block 2H, INVQAH */ @@ -394,7 +394,7 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8 else if (wd1 > 22528) wd1 = 22528; s->band[1].nb = (int16_t) wd1; - + /* Block 3H, SCALEH */ wd1 = (s->band[1].nb >> 6) & 31; wd2 = 10 - (s->band[1].nb >> 11); @@ -566,7 +566,7 @@ SPAN_DECLARE(int) g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const s->band[0].det = (int16_t) (wd3 << 2); block4(&s->band[0], dlow); - + if (s->eight_k) { /* Just leave the high bits as zero */ diff --git a/libs/spandsp/src/g726.c b/libs/spandsp/src/g726.c index f4a9127a92..6be385fc5f 100644 --- a/libs/spandsp/src/g726.c +++ b/libs/spandsp/src/g726.c @@ -695,7 +695,7 @@ static uint8_t g726_16_encoder(g726_state_t *s, int16_t amp) int16_t dqsez; int16_t dq; int16_t i; - + sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; @@ -711,7 +711,7 @@ static uint8_t g726_16_encoder(g726_state_t *s, int16_t amp) /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; - + update(s, y, g726_16_witab[i], g726_16_fitab[i], dq, sr, dqsez); return (uint8_t) i; } @@ -773,7 +773,7 @@ static uint8_t g726_24_encoder(g726_state_t *s, int16_t amp) int16_t dq; int16_t i; int y; - + sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; @@ -789,7 +789,7 @@ static uint8_t g726_24_encoder(g726_state_t *s, int16_t amp) /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; - + update(s, y, g726_24_witab[i], g726_24_fitab[i], dq, sr, dqsez); return (uint8_t) i; } @@ -851,7 +851,7 @@ static uint8_t g726_32_encoder(g726_state_t *s, int16_t amp) int16_t dq; int16_t i; int y; - + sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; @@ -930,7 +930,7 @@ static uint8_t g726_40_encoder(g726_state_t *s, int16_t amp) int16_t dq; int16_t i; int y; - + sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; @@ -970,7 +970,7 @@ static int16_t g726_40_decoder(g726_state_t *s, uint8_t code) code &= 0x1F; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); - + y = step_size(s); dq = reconstruct(code & 0x10, g726_40_dqlntab[code], y); diff --git a/libs/spandsp/src/gsm0610_decode.c b/libs/spandsp/src/gsm0610_decode.c index 783acda4b3..d3e21f390f 100644 --- a/libs/spandsp/src/gsm0610_decode.c +++ b/libs/spandsp/src/gsm0610_decode.c @@ -105,7 +105,7 @@ SPAN_DECLARE(int) gsm0610_unpack_none(gsm0610_frame_t *s, const uint8_t c[]) int i; int j; int k; - + i = 0; for (j = 0; j < 8; j++) s->LARc[j] = c[i++]; diff --git a/libs/spandsp/src/gsm0610_encode.c b/libs/spandsp/src/gsm0610_encode.c index c49ed1e93b..c9e5251ef0 100644 --- a/libs/spandsp/src/gsm0610_encode.c +++ b/libs/spandsp/src/gsm0610_encode.c @@ -57,7 +57,7 @@ /* The RPE-LTD coder works on a frame by frame basis. The length of the frame is equal to 160 samples. Some computations are done once per frame to produce at the output of the coder the - LARc[1..8] parameters which are the coded LAR coefficients and + LARc[1..8] parameters which are the coded LAR coefficients and also to realize the inverse filtering operation for the entire frame (160 samples of signal d[0..159]). These parts produce at the output of the coder: @@ -107,7 +107,7 @@ static void encode_a_frame(gsm0610_state_t *s, gsm0610_frame_t *f, const int16_t SPAN_DECLARE(int) gsm0610_set_packing(gsm0610_state_t *s, int packing) { s->packing = packing; - return 0; + return 0; } /*- End of function --------------------------------------------------------*/ @@ -147,7 +147,7 @@ SPAN_DECLARE(int) gsm0610_pack_none(uint8_t c[], const gsm0610_frame_t *s) int i; int j; int k; - + i = 0; for (j = 0; j < 8; j++) c[i++] = (uint8_t) s->LARc[j]; @@ -169,7 +169,7 @@ SPAN_DECLARE(int) gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s) { uint16_t sr; int i; - + sr = 0; sr = (sr >> 6) | (s->LARc[0] << 10); sr = (sr >> 6) | (s->LARc[1] << 10); diff --git a/libs/spandsp/src/gsm0610_lpc.c b/libs/spandsp/src/gsm0610_lpc.c index a7173f2086..8d32edab6b 100644 --- a/libs/spandsp/src/gsm0610_lpc.c +++ b/libs/spandsp/src/gsm0610_lpc.c @@ -59,15 +59,15 @@ /* The number of left shifts needed to normalize the 32 bit variable x for positive values on the interval with minimum of - minimum of 1073741824 (01000000000000000000000000000000) and + minimum of 1073741824 (01000000000000000000000000000000) and maximum of 2147483647 (01111111111111111111111111111111) and for negative values on the interval with minimum of -2147483648 (-10000000000000000000000000000000) and maximum of -1073741824 ( -1000000000000000000000000000000). - + In order to normalize the result, the following operation must be done: norm_var1 = x << gsm0610_norm(x); - + (That's 'ffs', only from the left, not the right..) */ @@ -89,7 +89,7 @@ int16_t gsm0610_norm(int32_t x) /* (From p. 46, end of section 4.2.5) - + NOTE: The following lines gives [sic] one correct implementation of the div(num, denum) arithmetic operation. Compute div which is the integer division of num by denom: with @@ -188,7 +188,7 @@ static void gsm0610_vec_vsraw(const int16_t *p, int n, int bits) " addq $2,%%rdx;\n" /* now edx = top-2 */ " cmpq %%rdx,%%rsi;\n" " ja 2f;\n" - + " movzwl (%%rsi),%%eax;\n" " movd %%eax,%%mm0;\n" " paddsw %%mm2,%%mm0;\n" @@ -251,7 +251,7 @@ static void gsm0610_vec_vsraw(const int16_t *p, int n, int bits) " addl $2,%%edx;\n" /* now edx = top-2 */ " cmpl %%edx,%%esi;\n" " ja 2f;\n" - + " movzwl (%%esi),%%eax;\n" " movd %%eax,%%mm0;\n" " paddsw %%mm2,%%mm0;\n" @@ -283,7 +283,7 @@ static void autocorrelation(int16_t amp[GSM0610_FRAME_LEN], int32_t L_ACF[9]) int16_t *sp; int16_t sl; #endif - + /* The goal is to compute the array L_ACF[k]. The signal s[i] must be scaled in order to avoid an overflow situation. */ @@ -411,7 +411,7 @@ static void autocorrelation(int16_t amp[GSM0610_FRAME_LEN], int32_t L_ACF[9]) /* Rescaling of the array s[0..159] */ if (scalauto > 0) { - assert(scalauto <= 4); + assert(scalauto <= 4); for (k = 0; k < GSM0610_FRAME_LEN; k++) amp[k] <<= scalauto; /*endfor*/ @@ -480,7 +480,7 @@ static void reflection_coefficients(int32_t L_ACF[9], int16_t r[8]) /*endif*/ assert(*r != INT16_MIN); if (n == 8) - return; + return; /*endif*/ /* Schur recursion */ @@ -508,7 +508,7 @@ static void transform_to_log_area_ratios(int16_t r[8]) int i; /* The following scaling for r[..] and LAR[..] has been used: - + r[..] = integer (real_r[..]*32768.); -1 <= real_r < 1. LAR[..] = integer (real_LAR[..] * 16384); with -1.625 <= real_LAR <= 1.625 @@ -551,7 +551,7 @@ static void quantization_and_coding(int16_t LAR[8]) /* This procedure needs four tables; the following equations give the optimum scaling for the constants: - + A[0..7] = integer(real_A[0..7] * 1024) B[0..7] = integer(real_B[0..7] * 512) MAC[0..7] = maximum of the LARc[0..7] diff --git a/libs/spandsp/src/gsm0610_preprocess.c b/libs/spandsp/src/gsm0610_preprocess.c index d48d164f87..92ca2e30b3 100644 --- a/libs/spandsp/src/gsm0610_preprocess.c +++ b/libs/spandsp/src/gsm0610_preprocess.c @@ -53,18 +53,18 @@ /* 4.2.0 .. 4.2.3 PREPROCESSING SECTION - + After A-law to linear conversion (or directly from the A to D converter) the following scaling is assumed for input to the RPE-LTP algorithm: - + in: 0.1.....................12 S.v.v.v.v.v.v.v.v.v.v.v.v.*.*.* - + Where S is the sign bit, v a valid bit, and * a "don't care" bit. The original signal is called sop[..] - - out: 0.1................... 12 + + out: 0.1................... 12 S.S.v.v.v.v.v.v.v.v.v.v.v.v.0.0 */ diff --git a/libs/spandsp/src/gsm0610_rpe.c b/libs/spandsp/src/gsm0610_rpe.c index c62d892ce7..68ddff3e1e 100644 --- a/libs/spandsp/src/gsm0610_rpe.c +++ b/libs/spandsp/src/gsm0610_rpe.c @@ -88,7 +88,7 @@ static void weighting_filter(int16_t x[40], "1:\n" " movq (%%rcx,%%rsi,2),%%mm0;\n" " pmaddwd %%mm1,%%mm0;\n" - + " movq 8(%%rcx,%%rsi,2),%%mm4;\n" " pmaddwd %%mm2,%%mm4;\n" " paddd %%mm4,%%mm0;\n" @@ -103,7 +103,7 @@ static void weighting_filter(int16_t x[40], " paddd %%mm5,%%mm0;\n" /* Add for roundoff */ " psrad $13,%%mm0;\n" - " packssdw %%mm0,%%mm0;\n" + " packssdw %%mm0,%%mm0;\n" " movd %%mm0,%%eax;\n" /* eax has result */ " movw %%ax,(%%rdi,%%rsi,2);\n" " incq %%rsi;\n" @@ -143,7 +143,7 @@ static void weighting_filter(int16_t x[40], "1:\n" " movq (%%ecx,%%esi,2),%%mm0;\n" " pmaddwd %%mm1,%%mm0;\n" - + " movq 8(%%ecx,%%esi,2),%%mm4;\n" " pmaddwd %%mm2,%%mm4;\n" " paddd %%mm4,%%mm0;\n" @@ -158,7 +158,7 @@ static void weighting_filter(int16_t x[40], " paddd %%mm5,%%mm0;\n" /* Add for roundoff */ " psrad $13,%%mm0;\n" - " packssdw %%mm0,%%mm0;\n" + " packssdw %%mm0,%%mm0;\n" " movd %%mm0,%%eax;\n" /* eax has result */ " movw %%ax,(%%edi,%%esi,2);\n" " incl %%esi;\n" @@ -175,8 +175,8 @@ static void weighting_filter(int16_t x[40], /* The coefficients of the weighting filter are stored in a table (see table 4.4). The following scaling is used: - - H[0..10] = integer(real_H[0..10] * 8192); + + H[0..10] = integer(real_H[0..10] * 8192); */ /* Initialization of a temporary working array wt[0...49] */ @@ -205,7 +205,7 @@ static void weighting_filter(int16_t x[40], #define STEP(i,H) (e[k + i] * (int32_t) H) /* Every one of these multiplications is done twice, - but I don't see an elegant way to optimize this. + but I don't see an elegant way to optimize this. Do you? */ result += STEP( 0, -134); @@ -446,14 +446,14 @@ static void apcm_quantization(int16_t xM[13], can be calculated by using the exponent and the mantissa part of xmaxc (logarithmic table). So, this method avoids any division and uses only a scaling - of the RPE samples by a function of the exponent. A direct + of the RPE samples by a function of the exponent. A direct multiplication by the inverse of the mantissa (NRFAC[0..7] found in table 4.5) gives the 3 bit coded version xMc[0..12] of the RPE samples. */ /* Direct computation of xMc[0..12] using table 4.5 */ assert(exp <= 4096 && exp >= -4096); - assert(mant >= 0 && mant <= 7); + assert(mant >= 0 && mant <= 7); temp1 = (int16_t) (6 - exp); /* Normalization by the exponent */ temp2 = gsm_NRFAC[mant]; /* Inverse mantissa */ diff --git a/libs/spandsp/src/gsm0610_short_term.c b/libs/spandsp/src/gsm0610_short_term.c index 226ac1f6eb..1eb46a7e97 100644 --- a/libs/spandsp/src/gsm0610_short_term.c +++ b/libs/spandsp/src/gsm0610_short_term.c @@ -97,7 +97,7 @@ static void decode_log_area_ratios(int16_t LARc[8], int16_t *LARpp) analysis and synthesis filters operate with four different sets of coefficients, derived from the previous set of decoded LARs(LARpp(j - 1)) and the actual set of decoded LARs (LARpp(j)) - + (Initial value: LARpp(j - 1)[1..8] = 0.) */ diff --git a/libs/spandsp/src/hdlc.c b/libs/spandsp/src/hdlc.c index 951b44eb7c..7733aa8280 100644 --- a/libs/spandsp/src/hdlc.c +++ b/libs/spandsp/src/hdlc.c @@ -81,7 +81,7 @@ static __inline__ void octet_set_and_count(hdlc_rx_state_t *s) { if (s->octet_count_report_interval == 0) return; - + /* If we are not in octet counting mode, we start it. If we are in octet counting mode, we update it. */ if (s->octet_counting_mode) @@ -465,7 +465,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s) { s->abort_octets = 0; return 0x7F; - } + } return s->idle_octet; } if (s->len) diff --git a/libs/spandsp/src/lpc10_analyse.c b/libs/spandsp/src/lpc10_analyse.c index 0db0f5ad21..e809d41ec8 100644 --- a/libs/spandsp/src/lpc10_analyse.c +++ b/libs/spandsp/src/lpc10_analyse.c @@ -78,7 +78,7 @@ static void remove_dc_bias(float speech[], int len, float sigout[]) static void eval_amdf(float speech[], int32_t lpita, - const int32_t tau[], + const int32_t tau[], int32_t ltau, int32_t maxlag, float amdf[], @@ -111,7 +111,7 @@ static void eval_amdf(float speech[], static void eval_highres_amdf(float speech[], int32_t lpita, - const int32_t tau[], + const int32_t tau[], int32_t ltau, float amdf[], int32_t *minptr, @@ -547,11 +547,10 @@ void lpc10_analyse(lpc10_encode_state_t *s, float speech[], int32_t voice[], int { static const int32_t tau[60] = { - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 84, 88, 92, 96, - 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, - 148, 152, 156 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 84, 88, 92, 96, + 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156 }; static const int32_t buflim[4] = { diff --git a/libs/spandsp/src/lpc10_decode.c b/libs/spandsp/src/lpc10_decode.c index 6746d2ceae..19860e149d 100644 --- a/libs/spandsp/src/lpc10_decode.c +++ b/libs/spandsp/src/lpc10_decode.c @@ -113,8 +113,9 @@ static void bsynz(lpc10_decode_state_t *s, { static const int32_t kexc[25] = { - 8, -16, 26, -48, 86, -162, 294, -502, 718, -728, 184, - 672, -610, -672, 184, 728, 718, 502, 294, 162, 86, 48, 26, 16, 8 + 8, -16, 26, -48, 86, -162, 294, -502, 718, -728, 184, + 672, -610, -672, 184, 728, 718, 502, 294, 162, 86, 48, + 26, 16, 8 }; int32_t i; int32_t j; @@ -217,11 +218,11 @@ static void bsynz(lpc10_decode_state_t *s, /* Synthesize a single pitch epoch */ static int pitsyn(lpc10_decode_state_t *s, - int voice[], + int voice[], int32_t *pitch, float *rms, float *rc, - int32_t ivuv[], + int32_t ivuv[], int32_t ipiti[], float *rmsi, float *rci, @@ -917,7 +918,7 @@ static void decode(lpc10_decode_state_t *s, /* If bit 2 of ICORF is set then smooth RMS and RC's, */ if ((icorf & bit[1]) != 0) { - if ((float) abs(s->drms[1] - s->drms[0]) >= corth[ixcor + 3] + if ((float) abs(s->drms[1] - s->drms[0]) >= corth[ixcor + 3] && (float) abs(s->drms[1] - s->drms[2]) >= corth[ixcor + 3]) { @@ -936,7 +937,7 @@ static void decode(lpc10_decode_state_t *s, /* If bit 3 of ICORF is set then smooth pitch */ if ((icorf & bit[2]) != 0) { - if ((float) abs(s->dpit[1] - s->dpit[0]) >= corth[ixcor - 1] + if ((float) abs(s->dpit[1] - s->dpit[0]) >= corth[ixcor - 1] && (float) abs(s->dpit[1] - s->dpit[2]) >= corth[ixcor - 1]) { @@ -1070,7 +1071,7 @@ SPAN_DECLARE(lpc10_decode_state_t *) lpc10_decode_init(lpc10_decode_state_t *s, s->dei[i] = 0.0f; for (i = 0; i < 3; i++) s->deo[i] = 0.0f; - + return s; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/src/lpc10_encdecs.h b/libs/spandsp/src/lpc10_encdecs.h index 1e276e374b..f146652ac4 100644 --- a/libs/spandsp/src/lpc10_encdecs.h +++ b/libs/spandsp/src/lpc10_encdecs.h @@ -38,13 +38,13 @@ void lpc10_placea(int32_t *ipitch, int32_t af, int32_t vwin[3][2], int32_t awin[3][2], - int32_t ewin[3][2], + int32_t ewin[3][2], int32_t lframe, int32_t maxwin); void lpc10_placev(int32_t *osbuf, int32_t *osptr, - int32_t oslen, + int32_t oslen, int32_t *obound, int32_t vwin[3][2], int32_t af, @@ -61,7 +61,7 @@ void lpc10_voicing(lpc10_encode_state_t *st, const int32_t buflim[], int32_t half, float *minamd, - float *maxamd, + float *maxamd, int32_t *mintau, float *ivrc, int32_t *obound); diff --git a/libs/spandsp/src/lpc10_encode.c b/libs/spandsp/src/lpc10_encode.c index 0ab0874a31..739734f866 100644 --- a/libs/spandsp/src/lpc10_encode.c +++ b/libs/spandsp/src/lpc10_encode.c @@ -111,11 +111,10 @@ static int encode(lpc10_encode_state_t *s, }; static const int32_t entau[60] = { - 19, 11, 27, 25, 29, 21, 23, 22, 30, 14, 15, 7, 39, 38, 46, - 42, 43, 41, 45, 37, 53, 49, 51, 50, 54, 52, 60, 56, 58, 26, - 90, 88, 92, 84, 86, 82, 83, 81, 85, 69, 77, 73, 75, 74, 78, - 70, 71, 67, 99, 97, 113, 112, 114, 98, 106, 104, 108, 100, - 101, 76 + 19, 11, 27, 25, 29, 21, 23, 22, 30, 14, 15, 7, 39, 38, 46, + 42, 43, 41, 45, 37, 53, 49, 51, 50, 54, 52, 60, 56, 58, 26, + 90, 88, 92, 84, 86, 82, 83, 81, 85, 69, 77, 73, 75, 74, 78, + 70, 71, 67, 99, 97, 113, 112, 114, 98, 106, 104, 108, 100, 101, 76 }; static const int32_t enadd[8] = { @@ -137,14 +136,14 @@ static int encode(lpc10_encode_state_t *s, }; static const int32_t rmst[64] = { - 1024, 936, 856, 784, 718, 656, 600, 550, 502, - 460, 420, 384, 352, 328, 294, 270, 246, 226, - 206, 188, 172, 158, 144, 132, 120, 110, 102, - 92, 84, 78, 70, 64, 60, 54, 50, - 46, 42, 38, 34, 32, 30, 26, 24, - 22, 20, 18, 17, 16, 15, 14, 13, - 12, 11, 10, 9, 8, 7, 6, 5, 4, - 3, 2, 1, 0 + 1024, 936, 856, 784, 718, 656, 600, 550, + 502, 460, 420, 384, 352, 328, 294, 270, + 246, 226, 206, 188, 172, 158, 144, 132, + 120, 110, 102, 92, 84, 78, 70, 64, + 60, 54, 50, 46, 42, 38, 34, 32, + 30, 26, 24, 22, 20, 18, 17, 16, + 15, 14, 13, 12, 11, 10, 9, 8, + 7, 6, 5, 4, 3, 2, 1, 0 }; int32_t idel; @@ -281,7 +280,7 @@ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s, s->z21 = 0.0f; s->z12 = 0.0f; s->z22 = 0.0f; - + /* State used by function lpc10_analyse */ for (i = 0; i < 540; i++) { @@ -355,7 +354,7 @@ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s, /* State used by function lpc10_pack */ s->isync = 0; - + return s; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/src/lpc10_placev.c b/libs/spandsp/src/lpc10_placev.c index 982b1d7c4e..f728d6fa63 100644 --- a/libs/spandsp/src/lpc10_placev.c +++ b/libs/spandsp/src/lpc10_placev.c @@ -56,7 +56,7 @@ void lpc10_placea(int32_t *ipitch, int32_t af, int32_t vwin[3][2], int32_t awin[3][2], - int32_t ewin[3][2], + int32_t ewin[3][2], int32_t lframe, int32_t maxwin) { @@ -69,7 +69,7 @@ void lpc10_placea(int32_t *ipitch, int32_t hrange; int ephase; int32_t lrange; - + lrange = (af - 2)*lframe + 1; hrange = af*lframe; @@ -181,7 +181,7 @@ void lpc10_placea(int32_t *ipitch, void lpc10_placev(int32_t *osbuf, int32_t *osptr, - int32_t oslen, + int32_t oslen, int32_t *obound, int32_t vwin[3][2], int32_t af, diff --git a/libs/spandsp/src/lpc10_voicing.c b/libs/spandsp/src/lpc10_voicing.c index db45c15602..90891f9cca 100644 --- a/libs/spandsp/src/lpc10_voicing.c +++ b/libs/spandsp/src/lpc10_voicing.c @@ -57,7 +57,7 @@ static void vparms(int32_t vwin[], int32_t half, float *dither, int32_t *mintau, - int32_t *zc, + int32_t *zc, int32_t *lbe, int32_t *fbe, float *qs, @@ -207,7 +207,7 @@ void lpc10_voicing(lpc10_encode_state_t *s, const int32_t buflim[], int32_t half, float *minamd, - float *maxamd, + float *maxamd, int32_t *mintau, float ivrc[], int32_t obound[]) @@ -250,7 +250,7 @@ void lpc10_voicing(lpc10_encode_state_t *s, int32_t lbe; float snr2; -#if (_MSC_VER >= 1400) +#if (_MSC_VER >= 1400) __analysis_assume(half >= 0 && half < 2); #endif inbuf_offset = 0; @@ -305,7 +305,7 @@ void lpc10_voicing(lpc10_encode_state_t *s, vparms(vwin, &inbuf[inbuf_offset], &lpbuf[lpbuf_offset], - buflim, + buflim, half, &s->dither, mintau, diff --git a/libs/spandsp/src/make_at_dictionary.c b/libs/spandsp/src/make_at_dictionary.c index a0d8e16eb4..7f05dd9b14 100644 --- a/libs/spandsp/src/make_at_dictionary.c +++ b/libs/spandsp/src/make_at_dictionary.c @@ -468,7 +468,7 @@ typedef struct static trie_node_t *trie_node_create(void) { trie_node_t *s; - + if ((s = (trie_node_t *) malloc(sizeof(*s)))) { memset(s, 0, sizeof(*s)); @@ -481,7 +481,7 @@ static trie_node_t *trie_node_create(void) static trie_t *trie_create(void) { trie_t *s; - + if ((s = (trie_t *) malloc(sizeof(*s)))) { memset(s, 0, sizeof(*s)); @@ -494,7 +494,7 @@ static trie_t *trie_create(void) static void trie_recursive_add_node_numbers(trie_node_t *t) { int index; - + if (t) { if (t->first <= t->last) @@ -516,7 +516,7 @@ static void trie_recursive_add_node_numbers(trie_node_t *t) static void trie_recursive_build_packed_trie(trie_node_t *t) { int i; - + if (t) { if (t->first <= t->last) @@ -551,7 +551,7 @@ static void trie_add(trie_t *s, const char *u, size_t len) { /* The character in u we are processing... */ index = (unsigned char) u[i]; - + /* Is there a child node for this character? */ if (t->child_list[index] == NULL) { @@ -561,7 +561,7 @@ static void trie_add(trie_t *s, const char *u, size_t len) if (index > t->last) t->last = index; } - + /* Move to the new node... and loop */ t = t->child_list[index]; } @@ -612,7 +612,7 @@ int main(int argc, char *argv[]) { trie_t *s; int i; - + s = trie_create(); for (i = 0; wordlist[i]; i++) diff --git a/libs/spandsp/src/make_cielab_luts.c b/libs/spandsp/src/make_cielab_luts.c index 905005674f..5fca6c7236 100644 --- a/libs/spandsp/src/make_cielab_luts.c +++ b/libs/spandsp/src/make_cielab_luts.c @@ -64,11 +64,11 @@ int main(int argc, char *argv[]) /* sRGB to Linear RGB */ r = (r > 0.04045f) ? powf((r + 0.055f)/1.055f, 2.4f) : r/12.92f; - + printf((i < 255) ? " %f,\n" : " %f\n", r); } printf("};\n"); - + printf("static const uint8_t linear_to_srgb[4096] =\n"); printf("{\n"); for (i = 0; i < 4096; i++) diff --git a/libs/spandsp/src/make_modem_filter.c b/libs/spandsp/src/make_modem_filter.c index 9bf49eb0aa..593f894cbf 100644 --- a/libs/spandsp/src/make_modem_filter.c +++ b/libs/spandsp/src/make_modem_filter.c @@ -112,7 +112,7 @@ static void make_tx_filter(int coeff_sets, for (i = 0; i < total_coeffs; i++) coeffs[i] *= scaling; } - + /* Churn out the data as a C source code header file, which can be directly included by the modem code. */ printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, gain); diff --git a/libs/spandsp/src/math_fixed.c b/libs/spandsp/src/math_fixed.c index b627fe1719..b4d57a917d 100644 --- a/libs/spandsp/src/math_fixed.c +++ b/libs/spandsp/src/math_fixed.c @@ -227,7 +227,7 @@ SPAN_DECLARE(uint16_t) fixed_atan2(int16_t y, int16_t x) return ((y & 0x8000) | 0x4000); abs_x = abs(x); abs_y = abs(y); - + if (abs_y < abs_x) { recip = fixed_reciprocal16(abs_x, &shift); diff --git a/libs/spandsp/src/playout.c b/libs/spandsp/src/playout.c index 073c4bf96b..e98e48d70c 100644 --- a/libs/spandsp/src/playout.c +++ b/libs/spandsp/src/playout.c @@ -65,7 +65,7 @@ static playout_frame_t *queue_get(playout_state_t *s, timestamp_t sender_stamp) s->last_frame = NULL; } return frame; - } + } return NULL; } @@ -86,7 +86,7 @@ SPAN_DECLARE(timestamp_t) playout_current_length(playout_state_t *s) SPAN_DECLARE(playout_frame_t *) playout_get_unconditional(playout_state_t *s) { playout_frame_t *frame; - + if ((frame = queue_get(s, 0x7FFFFFFF))) { /* Put it on the free list */ @@ -127,7 +127,7 @@ SPAN_DECLARE(int) playout_get(playout_state_t *s, playout_frame_t *frameout, tim s->state_late += ((((frame->receiver_stamp > s->latest_expected) ? 0x10000000 : 0) - s->state_late) >> 8); s->state_just_in_time += ((((frame->receiver_stamp > s->latest_expected - frame->sender_len) ? 0x10000000 : 0) - s->state_just_in_time) >> 8); s->latest_expected += frame->sender_len; - + if (s->state_late > s->dropable_threshold) { if (s->since_last_step < 10) @@ -169,7 +169,7 @@ SPAN_DECLARE(int) playout_get(playout_state_t *s, playout_frame_t *frameout, tim s->state_just_in_time = s->dropable_threshold; s->state_late = 0; s->since_last_step = 0; - + s->last_speech_sender_stamp += s->last_speech_sender_len; } } @@ -181,12 +181,12 @@ SPAN_DECLARE(int) playout_get(playout_state_t *s, playout_frame_t *frameout, tim { /* Rewind last_speech_sender_stamp, since this isn't speech */ s->last_speech_sender_stamp -= s->last_speech_sender_len; - + *frameout = *frame; /* Put it on the free list */ frame->later = s->free_frames; s->free_frames = frame; - + s->frames_out++; return PLAYOUT_OK; } @@ -271,7 +271,7 @@ SPAN_DECLARE(int) playout_put(playout_state_t *s, void *data, int type, timestam /* Find where it should go in the queue */ p = s->last_frame; - while (sender_stamp < p->sender_stamp && p->earlier) + while (sender_stamp < p->sender_stamp && p->earlier) p = p->earlier; if (p->earlier) @@ -323,7 +323,7 @@ SPAN_DECLARE(void) playout_restart(playout_state_t *s, int min_length, int max_l s->start = TRUE; s->since_last_step = 0x7FFFFFFF; /* Start with the minimum buffer length allowed, and work from there */ - s->actual_buffer_length = + s->actual_buffer_length = s->target_buffer_length = (s->max_length - s->min_length)/2; } /*- End of function --------------------------------------------------------*/ @@ -344,7 +344,7 @@ SPAN_DECLARE(int) playout_release(playout_state_t *s) { playout_frame_t *frame; playout_frame_t *next; - + /* Free all the frames in the queue. In most cases these should have been removed already, so their associated data could be freed. */ for (frame = s->first_frame; frame; frame = next) @@ -367,7 +367,7 @@ SPAN_DECLARE(int) playout_free(playout_state_t *s) if (s) { playout_release(s); - /* Finally, free ourselves! */ + /* Finally, free ourselves! */ free(s); } return 0; diff --git a/libs/spandsp/src/plc.c b/libs/spandsp/src/plc.c index 3d07417f68..dcb07120e1 100644 --- a/libs/spandsp/src/plc.c +++ b/libs/spandsp/src/plc.c @@ -121,7 +121,7 @@ SPAN_DECLARE(int) plc_rx(plc_state_t *s, int16_t amp[], int len) float old_weight; float new_weight; float gain; - + if (s->missing_samples) { /* Although we have a real signal, we need to smooth it to fit well diff --git a/libs/spandsp/src/queue.c b/libs/spandsp/src/queue.c index 7430aa4100..264cee0c87 100644 --- a/libs/spandsp/src/queue.c +++ b/libs/spandsp/src/queue.c @@ -52,7 +52,7 @@ SPAN_DECLARE(int) queue_empty(queue_state_t *s) SPAN_DECLARE(int) queue_free_space(queue_state_t *s) { int len; - + if ((len = s->optr - s->iptr - 1) < 0) len += s->len; /*endif*/ @@ -63,7 +63,7 @@ SPAN_DECLARE(int) queue_free_space(queue_state_t *s) SPAN_DECLARE(int) queue_contents(queue_state_t *s) { int len; - + if ((len = s->iptr - s->optr) < 0) len += s->len; /*endif*/ @@ -83,7 +83,7 @@ SPAN_DECLARE(int) queue_view(queue_state_t *s, uint8_t *buf, int len) int to_end; int iptr; int optr; - + /* Snapshot the values (although only iptr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; @@ -134,7 +134,7 @@ SPAN_DECLARE(int) queue_read(queue_state_t *s, uint8_t *buf, int len) int new_optr; int iptr; int optr; - + /* Snapshot the values (although only iptr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; @@ -191,7 +191,7 @@ SPAN_DECLARE(int) queue_read_byte(queue_state_t *s) int iptr; int optr; int byte; - + /* Snapshot the values (although only iptr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; diff --git a/libs/spandsp/src/spandsp/ademco_contactid.h b/libs/spandsp/src/spandsp/ademco_contactid.h index 8e42d70256..abae8e701b 100644 --- a/libs/spandsp/src/spandsp/ademco_contactid.h +++ b/libs/spandsp/src/spandsp/ademco_contactid.h @@ -33,7 +33,7 @@ enum ADEMCO_CONTACTID_MESSAGE_TYPE_18 = 0x18, ADEMCO_CONTACTID_MESSAGE_TYPE_98 = 0x98 }; - + enum { ADEMCO_CONTACTID_QUALIFIER_NEW_EVENT = 1, diff --git a/libs/spandsp/src/spandsp/adsi.h b/libs/spandsp/src/spandsp/adsi.h index 0d5e30adfc..751f57c03d 100644 --- a/libs/spandsp/src/spandsp/adsi.h +++ b/libs/spandsp/src/spandsp/adsi.h @@ -47,16 +47,16 @@ in various formats. Currently, the supported formats are: - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 1 (Belgium, Brazil, Denmark, Finland, Iceland, India, Netherlands, Saudi Arabia, Sweden and Uruguay). - + - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 2 (Denmark and Holland). - + - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 3. - + - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 4. (Taiwan and Kuwait). - + - ETSI Caller-ID support in UK (British Telecom), British Telecomm SIN227, SIN242. - Nippon Telegraph & Telephone Corporation JCLIP (Japanese Calling Line Identity @@ -79,7 +79,7 @@ two rings. This silence period is long in the US, so the message fits easily. In other places, where the standard ring tone has much smaller silences, a line voltage reversal is used to wake up a power saving receiver, then the message is sent, then the phone begins to ring. - + The message is sent using a Bell 202 FSK modem. The data rate is 1200 bits per second. The message protocol uses 8-bit data words (bytes), each bounded by a start bit and a stop bit. @@ -87,34 +87,34 @@ by a start bit and a stop bit. Channel Carrier Message Message Data Checksum Seizure Signal Type Length Word(s) Word Signal Word Word - + \section adsi_page_sec_2a1 CHANNEL SEIZURE SIGNAL The channel seizure is 30 continuous bytes of 55h (01010101), including the start and stop bits (i.e. 300 bits of alternations in total). This provides a detectable alternating function to the CPE (i.e. the modem data pump). - + \section adsi_page_sec_2a2 CARRIER SIGNAL The carrier signal consists of 180 bits of 1s. This may be reduced to 80 bits of 1s for caller ID on call waiting. - + \section adsi_page_sec_2a3 MESSAGE TYPE WORD -Various message types are defined. The commonest ones for the US CLASS +Various message types are defined. The commonest ones for the US CLASS standard are: - Type 0x04 (SDMF) - single data message. Simple caller ID (CND) - Type 0x80 (MDMF) - multiple data message. A more flexible caller ID, with extra information. -Other messages support message waiting, for voice mail, and other display features. +Other messages support message waiting, for voice mail, and other display features. \section adsi_page_sec_2a4 MESSAGE LENGTH WORD The message length word specifies the total number of data words to follow. - + \section adsi_page_sec_2a5 DATA WORDS The data words contain the actual message. - + \section adsi_page_sec_2a6 CHECKSUM WORD The Checksum Word contains the twos complement of the modulo 256 sum of the other words in the data message (i.e., message type, @@ -177,7 +177,7 @@ while off hook. This results in a sequence - CPE hangs up on receipt of the caller ID message - The phone line rings a second time - The CPE answers a second time, connecting the called party with the caller. - + Timeouts are, obviously, required to ensure this system behaves well when the caller ID message or the second ring are missing. */ diff --git a/libs/spandsp/src/spandsp/arctan2.h b/libs/spandsp/src/spandsp/arctan2.h index f39257dc85..aefac60d67 100644 --- a/libs/spandsp/src/spandsp/arctan2.h +++ b/libs/spandsp/src/spandsp/arctan2.h @@ -107,7 +107,7 @@ static __inline__ float arctan2f(float y, float x) angle = 3.1415926f/2.0f - fx*fy/(y*y + 0.28125f*x*x); else angle = fy*fx/(x*x + 0.28125f*y*y); - + /* Deal with the quadrants, to bring the final answer to the range +-pi */ if (x < 0.0f) angle = 3.1415926f - angle; diff --git a/libs/spandsp/src/spandsp/awgn.h b/libs/spandsp/src/spandsp/awgn.h index 7f8b780273..e61ffc42db 100644 --- a/libs/spandsp/src/spandsp/awgn.h +++ b/libs/spandsp/src/spandsp/awgn.h @@ -29,14 +29,14 @@ paper somewhere. I can't track down where I got the original from, so that due recognition can be given. The original had no explicit copyright notice, and I hope nobody objects to its use here. - + Having a reasonable Gaussian noise generator is pretty important for telephony testing (in fact, pretty much any DSP testing), and this one seems to have served me OK. Since the generation of Gaussian noise is only for test purposes, and not a core system component, I don't intend to worry excessively about copyright issues, unless someone worries me. - + The non-core nature of this code also explains why it is unlikely to ever be optimised. */ @@ -47,20 +47,20 @@ \section awgn_page_sec_1 What does it do? Adding noise is not the most useful thing in most DSP applications, but it is -awfully useful for test suites. +awfully useful for test suites. \section awgn_page_sec_2 How does it work? This code is based on some demonstration code in a research paper somewhere. I can't track down where I got the original from, so that due recognition can be given. The original had no explicit copyright notice, and I hope nobody objects -to its use here. +to its use here. Having a reasonable Gaussian noise generator is pretty important for telephony testing (in fact, pretty much any DSP testing), and this one seems to have served me OK. Since the generation of Gaussian noise is only for test purposes, and not a core system component, I don't intend to worry excessively about -copyright issues, unless someone worries me. +copyright issues, unless someone worries me. The non-core nature of this code also explains why it is unlikely to ever be optimised. diff --git a/libs/spandsp/src/spandsp/bell_r2_mf.h b/libs/spandsp/src/spandsp/bell_r2_mf.h index 6421a36a41..98d9f749e8 100644 --- a/libs/spandsp/src/spandsp/bell_r2_mf.h +++ b/libs/spandsp/src/spandsp/bell_r2_mf.h @@ -31,7 +31,7 @@ /*! \page mfc_r2_tone_generation_page MFC/R2 tone generation \section mfc_r2_tone_generation_page_sec_1 What does it do? The MFC/R2 tone generation module provides for the generation of the -repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. +repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. \section mfc_r2_tone_generation_page_sec_2 How does it work? */ @@ -39,7 +39,7 @@ repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. /*! \page bell_mf_tone_generation_page Bell MF tone generation \section bell_mf_tone_generation_page_sec_1 What does it do? The Bell MF tone generation module provides for the generation of the -repertoire of 15 dual tones needs for various Bell MF signalling protocols. +repertoire of 15 dual tones needs for various Bell MF signalling protocols. \section bell_mf_tone_generation_page_sec_2 How does it work? Basic Bell MF tone generation specs: @@ -53,7 +53,7 @@ Basic Bell MF tone generation specs: \section mfc_r2_tone_rx_page_sec_1 What does it do? The MFC/R2 tone receiver module provides for the detection of the -repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. +repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. It is compliant with ITU-T Q.441D. \section mfc_r2_tone_rx_page_sec_2 How does it work? @@ -79,7 +79,7 @@ Basic MFC/R2 tone detection specs: \section bell_mf_tone_rx_page_sec_1 What does it do? The Bell MF tone receiver module provides for the detection of the -repertoire of 15 dual tones needs for various Bell MF signalling protocols. +repertoire of 15 dual tones needs for various Bell MF signalling protocols. It is compliant with ITU-T Q.320, ITU-T Q.322, ITU-T Q.323B. \section bell_mf_tone_rx_page_sec_2 How does it work? @@ -132,7 +132,7 @@ extern "C" \param s The Bell MF generator context. \param amp The buffer for the generated signal. \param max_samples The required number of generated samples. - \return The number of samples actually generated. This may be less than + \return The number of samples actually generated. This may be less than max_samples if the input buffer empties. */ SPAN_DECLARE(int) bell_mf_tx(bell_mf_tx_state_t *s, int16_t amp[], int max_samples); diff --git a/libs/spandsp/src/spandsp/biquad.h b/libs/spandsp/src/spandsp/biquad.h index f17ca95fab..95e8517e1c 100644 --- a/libs/spandsp/src/spandsp/biquad.h +++ b/libs/spandsp/src/spandsp/biquad.h @@ -71,9 +71,9 @@ static __inline__ void biquad2_init(biquad2_state_t *bq, bq->a2 = a2; bq->b1 = b1; bq->b2 = b2; - + bq->z1 = 0; - bq->z2 = 0; + bq->z2 = 0; #if FIRST_ORDER_NOISE_SHAPING bq->residue = 0; @@ -88,14 +88,14 @@ static __inline__ int16_t biquad2(biquad2_state_t *bq, int16_t sample) { int32_t y; int32_t z0; - + z0 = sample*bq->gain + bq->z1*bq->a1 + bq->z2*bq->a2; y = z0 + bq->z1*bq->b1 + bq->z2*bq->b2; bq->z2 = bq->z1; bq->z1 = z0 >> 15; #if FIRST_ORDER_NOISE_SHAPING - y += bq->residue; + y += bq->residue; bq->residue = y & 0x7FFF; #elif SECOND_ORDER_NOISE_SHAPING y += (2*bq->residue1 - bq->residue2); diff --git a/libs/spandsp/src/spandsp/bit_operations.h b/libs/spandsp/src/spandsp/bit_operations.h index 8ce3c44430..2deca2828a 100644 --- a/libs/spandsp/src/spandsp/bit_operations.h +++ b/libs/spandsp/src/spandsp/bit_operations.h @@ -144,7 +144,7 @@ static __inline__ int top_bit(unsigned int bits) static __inline__ int bottom_bit(unsigned int bits) { int res; - + #if defined(SPANDSP_USE_86_ASM) __asm__ (" xorl %[res],%[res];\n" " decl %[res];\n" diff --git a/libs/spandsp/src/spandsp/g168models.h b/libs/spandsp/src/spandsp/g168models.h index 1bc728e300..4e71112eef 100644 --- a/libs/spandsp/src/spandsp/g168models.h +++ b/libs/spandsp/src/spandsp/g168models.h @@ -43,12 +43,12 @@ const int32_t line_model_d2_coeffs[] = { -436, -829, -2797, -4208, -17968, -11215, 46150, 34480, -10427, 9049, -1309, -6320, 390, -8191, -1751, -6051, - -3796, -4055, -3948, -2557, -3372, -1808, -2259, -1300, + -3796, -4055, -3948, -2557, -3372, -1808, -2259, -1300, -1098, -618, -340, -61, 323, 419, 745, 716, 946, 880, 1014, 976, 1033, 1091, 1053, 1042, - 794, 831, 899, 716, 390, 313, 304, 304, + 794, 831, 899, 716, 390, 313, 304, 304, 73, -119, -109, -176, -359, -407, -512, -580, - -704, -618, -685, -791, -772, -820, -839, -724 + -704, -618, -685, -791, -772, -820, -839, -724 }; #define LINE_MODEL_D2_GAIN 1.39E-5f @@ -114,16 +114,16 @@ const int32_t line_model_d5_coeffs[] = -4470, 25356, 11458, -19696, -11800, 5766, 789, 6633, 14624, -6975, -17156, -187, 149, 1515, 14907, 4345, -7128, -2757, -10185, -7083, 6850, 3944, 6969, 8694, - -4068, -3852, -5793, -9371, 453, 1060, 3965, 9463, + -4068, -3852, -5793, -9371, 453, 1060, 3965, 9463, 2393, 2784, -892, -7366, -3376, -5847, -2399, 3011, 1537, 6623, 4205, 1602, 1592, -4752, -3646, -5207, - -5577, -501, -1174, 4041, 5647, 4628, 7252, 2123, + -5577, -501, -1174, 4041, 5647, 4628, 7252, 2123, 2654, -881, -4113, -3244, -7289, -3830, -4600, -2508, 431, -144, 4184, 2372, 4617, 3576, 2382, 2839, - -404, 539, -1803, -1401, -1705, -2269, -783, -1608, + -404, 539, -1803, -1401, -1705, -2269, -783, -1608, -220, -306, 257, 615, 225, 561, 8, 344, 127, -57, 182, 41, 203, -111, 95, -79, - 30, 84, -13, -68, -241, -68, -24, 19, + 30, 84, -13, -68, -241, -68, -24, 19, -57, -24, 30, -68, 84, -155, -68, 19 }; #define LINE_MODEL_D5_GAIN 1.77E-5f @@ -145,7 +145,7 @@ const int32_t line_model_d6_coeffs[] = -821, -2068, -2236, -4283, -3406, -5022, -4039, -4842, -4104, -4089, -3582, -2978, -2734, -1805, -1608, -645, -495, 279, 471, 947, 1186, 1438, 1669, 1640, - 1901, 1687, 1803, 1543, 1566, 1342, 1163, 963, + 1901, 1687, 1803, 1543, 1566, 1342, 1163, 963, 733, 665, 323, 221, -14, -107, -279, -379, -468, -513, -473, -588, -612, -652, -616, -566, -515, -485, -404, -344, -290, -202, -180, -123 @@ -171,7 +171,7 @@ const int32_t line_model_d7_coeffs[] = 3946, 4414, 4026, 3005, 3380, 1616, 2007, 158, 388, -1198, -1117, -2134, -2547, -2589, -3310, -2778, -3427, -2779, -3116, -2502, -2399, -1956, -1539, -1239, - -570, -377, 251, 331, 964, 1177, 1449, 1564, + -570, -377, 251, 331, 964, 1177, 1449, 1564, 1724, 1871, 1767, 1802, 1630, 1632, 1379, 1271, 1063, 856, 711, 482, 289, 54, -137, -321, -490, -638, -764, -836, -800, -859, -838, -837, @@ -196,7 +196,7 @@ const int32_t line_model_d8_coeffs[] = -16854, -3115, 9483, -17799, 7399, -4342, -7415, 7929, -10726, 6239, -2526, -1317, 5345, -4565, 6868, -2195, 3425, 1969, -109, 3963, -1275, 3087, -892, 1239, - 2, -427, 596, -1184, 551, -1244, 141, -743, + 2, -427, 596, -1184, 551, -1244, 141, -743, -415, -372, -769, -183, -785, -270, -659, -377, -523, -325, -245, -255, -60, 35, 218, 149, 340, 233, 365, 303, 251, 230, 209, 179 diff --git a/libs/spandsp/src/spandsp/g711.h b/libs/spandsp/src/spandsp/g711.h index a2e094843e..1e2a7f652c 100644 --- a/libs/spandsp/src/spandsp/g711.h +++ b/libs/spandsp/src/spandsp/g711.h @@ -33,7 +33,7 @@ these routines are slow in C, is the lack of direct access to the CPU's "find the first 1" instruction. A little in-line assembler fixes that, and the conversion routines can be faster than lookup tables, in most real world usage. A "find the first 1" instruction is available on most modern CPUs, and is a -much underused feature. +much underused feature. If an assembly language method of bit searching is not available, these routines revert to a method that can be a little slow, so the cache thrashing might not @@ -82,7 +82,7 @@ extern "C" * segment, but a little inline assembly can fix that on an i386, x86_64 and * many other modern processors. */ - + /* * Mu-law is basically as follows: * @@ -162,7 +162,7 @@ static __inline__ uint8_t linear_to_ulaw(int linear) static __inline__ int16_t ulaw_to_linear(uint8_t ulaw) { int t; - + /* Complement to obtain normal u-law value. */ ulaw = ~ulaw; /* @@ -203,7 +203,7 @@ static __inline__ uint8_t linear_to_alaw(int linear) { int mask; int seg; - + if (linear >= 0) { /* Sign (bit 7) bit = 1 */ diff --git a/libs/spandsp/src/spandsp/modem_connect_tones.h b/libs/spandsp/src/spandsp/modem_connect_tones.h index 3ac5be361e..7c2b980753 100644 --- a/libs/spandsp/src/spandsp/modem_connect_tones.h +++ b/libs/spandsp/src/spandsp/modem_connect_tones.h @@ -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. */ - + /*! \file */ #if !defined(_SPANDSP_MODEM_CONNECT_TONES_H_) @@ -50,7 +50,7 @@ unfiltered energy, then a large proportion of the energy must be at the notch frequency. This type of detector may seem less intuitive than using a narrow bandpass filter to isolate the energy at the notch freqency. However, a sharp bandpass implemented as an IIR filter rings badly. The reciprocal notch filter -is very well behaved for our purpose. +is very well behaved for our purpose. */ enum diff --git a/libs/spandsp/src/spandsp/modem_echo.h b/libs/spandsp/src/spandsp/modem_echo.h index acfe7506a2..2f19f0bd18 100644 --- a/libs/spandsp/src/spandsp/modem_echo.h +++ b/libs/spandsp/src/spandsp/modem_echo.h @@ -37,7 +37,7 @@ This module aims to cancel electrical echoes (e.g. from 2-4 wire hybrids) in modem applications. It is not very suitable for speech applications, which require additional refinements for satisfactory performance. It is, however, more -efficient and better suited to modem applications. +efficient and better suited to modem applications. \section modem_echo_can_page_sec_2 How does it work? The heart of the echo cancellor is an adaptive FIR filter. This is adapted to @@ -48,14 +48,14 @@ FIR filter. The resulting output is an estimate of the echo signal. This is then subtracted from the received signal, and the result should be an estimate of the signal which originates within the environment being cancelled (people talking in the room, or the signal from the far end of a telephone line) free -from the echos of our own transmitted signal. +from the echos of our own transmitted signal. The FIR filter is adapted using the least mean squares (LMS) algorithm. This algorithm is attributed to Widrow and Hoff, and was introduced in 1960. It is the commonest form of filter adaption used in things like modem line equalisers and line echo cancellers. It works very well if the signal level is constant, which is true for a modem signal. To ensure good performa certain conditions must -be met: +be met: - The transmitted signal has weak self-correlation. - There is no signal being generated within the environment being cancelled. @@ -67,13 +67,13 @@ transmitting something highly correlative (e.g. tones, like DTMF), the adaption can go seriously wrong. The reason is there is only one solution for the adaption on a near random signal. For a repetitive signal, there are a number of solutions which converge the adaption, and nothing guides the adaption to choose -the correct one. +the correct one. \section modem_echo_can_page_sec_3 How do I use it? The echo cancellor processes both the transmit and receive streams sample by sample. The processing function is not declared inline. Unfortunately, cancellation requires many operations per sample, so the call overhead is only a -minor burden. +minor burden. */ #include "fir.h" diff --git a/libs/spandsp/src/spandsp/private/ademco_contactid.h b/libs/spandsp/src/spandsp/private/ademco_contactid.h index bada9193a1..f38b50a4b3 100644 --- a/libs/spandsp/src/spandsp/private/ademco_contactid.h +++ b/libs/spandsp/src/spandsp/private/ademco_contactid.h @@ -77,7 +77,7 @@ struct ademco_contactid_sender_state_s int tx_digits_len; /*! \brief The number of consecutive retries. */ int tries; - + int tone_state; int duration; int last_hit; diff --git a/libs/spandsp/src/spandsp/private/adsi.h b/libs/spandsp/src/spandsp/private/adsi.h index 676e05ab40..f1d3d06a27 100644 --- a/libs/spandsp/src/spandsp/private/adsi.h +++ b/libs/spandsp/src/spandsp/private/adsi.h @@ -71,7 +71,7 @@ struct adsi_tx_state_s int stop_bits; /*! */ int baudot_shift; - + /*! */ logging_state_t logging; }; @@ -106,7 +106,7 @@ struct adsi_rx_state_s int msg_len; /*! */ int baudot_shift; - + /*! A count of the framing errors. */ int framing_errors; diff --git a/libs/spandsp/src/spandsp/private/at_interpreter.h b/libs/spandsp/src/spandsp/private/at_interpreter.h index 5cda92e4ec..a60a9aa46e 100644 --- a/libs/spandsp/src/spandsp/private/at_interpreter.h +++ b/libs/spandsp/src/spandsp/private/at_interpreter.h @@ -80,7 +80,7 @@ struct at_state_s int rx_window; /*! Value set by +EWIND */ int tx_window; - + int v8bis_signal; int v8bis_1st_message; int v8bis_2nd_message; diff --git a/libs/spandsp/src/spandsp/private/g722.h b/libs/spandsp/src/spandsp/private/g722.h index 5cb2e0b77f..74ee517f3f 100644 --- a/libs/spandsp/src/spandsp/private/g722.h +++ b/libs/spandsp/src/spandsp/private/g722.h @@ -98,7 +98,7 @@ struct g722_decode_state_s int ptr; g722_band_t band[2]; - + uint32_t in_buffer; int in_bits; uint32_t out_buffer; diff --git a/libs/spandsp/src/spandsp/private/g726.h b/libs/spandsp/src/spandsp/private/g726.h index 9d69d00ec2..48b4454858 100644 --- a/libs/spandsp/src/spandsp/private/g726.h +++ b/libs/spandsp/src/spandsp/private/g726.h @@ -56,7 +56,7 @@ struct g726_state_s int16_t dml; /*! Linear weighting coefficient of 'yl' and 'yu'. */ int16_t ap; - + /*! Coefficients of pole portion of prediction filter. */ int16_t a[2]; /*! Coefficients of zero portion of prediction filter. */ @@ -71,7 +71,7 @@ struct g726_state_s int16_t sr[2]; /*! Delayed tone detect */ int td; - + /*! \brief The bit stream processing context. */ bitstream_state_t bs; diff --git a/libs/spandsp/src/spandsp/private/gsm0610.h b/libs/spandsp/src/spandsp/private/gsm0610.h index 103a6ebd2c..466be71207 100644 --- a/libs/spandsp/src/spandsp/private/gsm0610.h +++ b/libs/spandsp/src/spandsp/private/gsm0610.h @@ -54,7 +54,7 @@ struct gsm0610_state_s int16_t v[9]; /*! Decoder postprocessing */ int16_t msr; - + /*! Encoder data */ int16_t e[50]; }; diff --git a/libs/spandsp/src/spandsp/private/lpc10.h b/libs/spandsp/src/spandsp/private/lpc10.h index ae9b9528bb..b61893637c 100644 --- a/libs/spandsp/src/spandsp/private/lpc10.h +++ b/libs/spandsp/src/spandsp/private/lpc10.h @@ -44,7 +44,7 @@ struct lpc10_encode_state_s float z12; /*! \brief ??? */ float z22; - + /* State used by function lpc10_analyse */ /*! \brief ??? */ float inbuf[LPC10_SAMPLES_PER_FRAME*3]; diff --git a/libs/spandsp/src/spandsp/private/modem_connect_tones.h b/libs/spandsp/src/spandsp/private/modem_connect_tones.h index feb602bdef..c1c33d25a4 100644 --- a/libs/spandsp/src/spandsp/private/modem_connect_tones.h +++ b/libs/spandsp/src/spandsp/private/modem_connect_tones.h @@ -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. */ - + /*! \file */ #if !defined(_SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_) diff --git a/libs/spandsp/src/spandsp/private/sig_tone.h b/libs/spandsp/src/spandsp/private/sig_tone.h index 1bbeef0466..e7c6217051 100644 --- a/libs/spandsp/src/spandsp/private/sig_tone.h +++ b/libs/spandsp/src/spandsp/private/sig_tone.h @@ -218,7 +218,7 @@ struct sig_tone_rx_state_s int flat_mode_timeout; /*! \brief ??? */ int notch_insertion_timeout; - + /*! \brief ??? */ int signalling_state; /*! \brief ??? */ diff --git a/libs/spandsp/src/spandsp/private/t30.h b/libs/spandsp/src/spandsp/private/t30.h index 47574360ec..b1bef5d112 100644 --- a/libs/spandsp/src/spandsp/private/t30.h +++ b/libs/spandsp/src/spandsp/private/t30.h @@ -45,7 +45,7 @@ struct t30_state_s /*! \brief TRUE if behaving as the calling party */ int calling_party; - + /*! \brief Internet aware FAX mode bit mask. */ int iaf; /*! \brief A bit mask of the currently supported modem types. */ @@ -212,7 +212,7 @@ struct t30_state_s /*! \brief TRUE once the far end FAX entity has been detected. */ int far_end_detected; - + /*! \brief TRUE once the end of procedure condition has been detected. */ int end_of_procedure_detected; @@ -250,7 +250,7 @@ struct t30_state_s int16_t ecm_len[256]; /*! \brief A bit map of the OK ECM frames, constructed as a PPR frame. */ uint8_t ecm_frame_map[3 + 32]; - + /*! \brief The current page number for receiving, in ECM or non-ECM mode. This is reset at the start of a call. */ int rx_page_number; /*! \brief The current page number for sending, in ECM or non-ECM mode. This is reset at the start of a call. */ diff --git a/libs/spandsp/src/spandsp/private/t30_dis_dtc_dcs_bits.h b/libs/spandsp/src/spandsp/private/t30_dis_dtc_dcs_bits.h index 4ff7cf0a46..9ec15f5f27 100644 --- a/libs/spandsp/src/spandsp/private/t30_dis_dtc_dcs_bits.h +++ b/libs/spandsp/src/spandsp/private/t30_dis_dtc_dcs_bits.h @@ -221,16 +221,16 @@ /* In a DIS/DTC frame, setting bit 97 to "0" indicates that the called terminal does not have the capability to accept 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images or T.44 Mixed Raster Content (MRC) mask layer. - + Setting bit 97 to "1" indicates that the called terminal does have the capability to accept 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images and MRC mask layer. Bit 97 is valid only when bits 68 and 42 or 43 (300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm) are set to "1". - + In a DCS frame, setting bit 97 to "0" indicates that the calling terminal does not use 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images and mask layer. - + Setting bit 97 to "1" indicates that the calling terminal uses 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images and MRC mask layer. Bit 97 is valid only when bits 68 and 42 or 43 (300 pels/25.4 mm x 300 lines/25.4 mm and diff --git a/libs/spandsp/src/spandsp/private/t38_core.h b/libs/spandsp/src/spandsp/private/t38_core.h index e965ca6f40..40123128af 100644 --- a/libs/spandsp/src/spandsp/private/t38_core.h +++ b/libs/spandsp/src/spandsp/private/t38_core.h @@ -54,7 +54,7 @@ struct t38_core_state_s Method 2: Transfer of TCF is required for use with UDP (UDPTL or RTP). Method 2 is not recommended for use with TCP. */ int data_rate_management_method; - + /*! \brief The emitting gateway may indicate a preference for either UDP/UDPTL, or UDP/RTP, or TCP for transport of T.38 IFP Packets. The receiving device selects the transport protocol. */ @@ -81,7 +81,7 @@ struct t38_core_state_s int max_buffer_size; /*! \brief This option indicates the maximum size of a UDPTL packet or the - maximum size of the payload within an RTP packet that can be accepted + maximum size of the payload within an RTP packet that can be accepted by the remote device. */ int max_datagram_size; @@ -102,7 +102,7 @@ struct t38_core_state_s over TCP they are not relevent. */ int check_sequence_numbers; - /*! \brief The number of times each packet type will be sent (low byte). The + /*! \brief The number of times each packet type will be sent (low byte). The depth of redundancy (2nd byte). Higher numbers may increase reliability for UDP transmission. Zero is valid for the indicator packet category, to suppress all indicator packets (typicaly for TCP transmission). */ diff --git a/libs/spandsp/src/spandsp/private/t4_rx.h b/libs/spandsp/src/spandsp/private/t4_rx.h index 44eb2d2664..3004d348b7 100644 --- a/libs/spandsp/src/spandsp/private/t4_rx.h +++ b/libs/spandsp/src/spandsp/private/t4_rx.h @@ -71,15 +71,15 @@ typedef struct int y_resolution; /* "Background" information about the FAX, which can be stored in the image file. */ - /*! \brief The vendor of the machine which produced the file. */ + /*! \brief The vendor of the machine which produced the file. */ const char *vendor; - /*! \brief The model of machine which produced the file. */ + /*! \brief The model of machine which produced the file. */ const char *model; - /*! \brief The remote end's ident string. */ + /*! \brief The remote end's ident string. */ const char *far_ident; - /*! \brief The FAX sub-address. */ + /*! \brief The FAX sub-address. */ const char *sub_address; - /*! \brief The FAX DCS information, as an ASCII hex string. */ + /*! \brief The FAX DCS information, as an ASCII hex string. */ const char *dcs; } t4_rx_metadata_t; @@ -102,7 +102,7 @@ struct t4_rx_state_s /*! \brief The type of compression used between the FAX machines. */ int line_encoding; - + /*! \brief The width of the current page, in pixels. */ uint32_t image_width; diff --git a/libs/spandsp/src/spandsp/private/t4_tx.h b/libs/spandsp/src/spandsp/private/t4_tx.h index afc44fcf53..6f2fd12349 100644 --- a/libs/spandsp/src/spandsp/private/t4_tx.h +++ b/libs/spandsp/src/spandsp/private/t4_tx.h @@ -128,7 +128,7 @@ struct t4_tx_state_s in no header line. */ const char *header_info; /*! \brief The local ident string. This is used with header_info to form a - page header line. */ + page header line. */ const char *local_ident; /*! \brief The page number of current page. The first page is zero. If FAX page headers are used, the page number in the header will be one more than diff --git a/libs/spandsp/src/spandsp/private/v17rx.h b/libs/spandsp/src/spandsp/private/v17rx.h index 9f22208e80..2082722fd6 100644 --- a/libs/spandsp/src/spandsp/private/v17rx.h +++ b/libs/spandsp/src/spandsp/private/v17rx.h @@ -180,7 +180,7 @@ struct v17_rx_state_s /*! \brief The carrier update rate saved for reuse when using short training. */ int32_t carrier_phase_rate_save; - /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ + /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; diff --git a/libs/spandsp/src/spandsp/private/v17tx.h b/libs/spandsp/src/spandsp/private/v17tx.h index f6c9d21343..3e2fff6d2c 100644 --- a/libs/spandsp/src/spandsp/private/v17tx.h +++ b/libs/spandsp/src/spandsp/private/v17tx.h @@ -94,7 +94,7 @@ struct v17_tx_state_s int32_t carrier_phase_rate; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; - + /*! \brief The current number of data bits per symbol. This does not include the redundant bit. */ int bits_per_symbol; diff --git a/libs/spandsp/src/spandsp/private/v18.h b/libs/spandsp/src/spandsp/private/v18.h index b51a899ec6..086262c720 100644 --- a/libs/spandsp/src/spandsp/private/v18.h +++ b/libs/spandsp/src/spandsp/private/v18.h @@ -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. */ - + #if !defined(_SPANDSP_PRIVATE_V18_H_) #define _SPANDSP_PRIVATE_V18_H_ diff --git a/libs/spandsp/src/spandsp/private/v22bis.h b/libs/spandsp/src/spandsp/private/v22bis.h index 5a03cb79f8..c0da6b0aa6 100644 --- a/libs/spandsp/src/spandsp/private/v22bis.h +++ b/libs/spandsp/src/spandsp/private/v22bis.h @@ -128,7 +128,7 @@ struct v22bis_state_s routine. */ void *qam_user_data; - /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ + /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t rx_power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; @@ -192,7 +192,7 @@ struct v22bis_state_s int total_baud_timing_correction; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; - + int sixteen_way_decisions; int pattern_repeats; diff --git a/libs/spandsp/src/spandsp/private/v27ter_rx.h b/libs/spandsp/src/spandsp/private/v27ter_rx.h index e10781f72e..fbec14c5ed 100644 --- a/libs/spandsp/src/spandsp/private/v27ter_rx.h +++ b/libs/spandsp/src/spandsp/private/v27ter_rx.h @@ -158,7 +158,7 @@ struct v27ter_rx_state_s /*! \brief The carrier update rate saved for reuse when using short training. */ int32_t carrier_phase_rate_save; - /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ + /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; diff --git a/libs/spandsp/src/spandsp/private/v27ter_tx.h b/libs/spandsp/src/spandsp/private/v27ter_tx.h index 5d8d41f842..ba9ab8b5aa 100644 --- a/libs/spandsp/src/spandsp/private/v27ter_tx.h +++ b/libs/spandsp/src/spandsp/private/v27ter_tx.h @@ -67,7 +67,7 @@ struct v27ter_tx_state_s /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; - + /*! \brief The register for the training and data scrambler. */ uint32_t scramble_reg; /*! \brief A counter for the number of consecutive bits of repeating pattern through diff --git a/libs/spandsp/src/spandsp/private/v29rx.h b/libs/spandsp/src/spandsp/private/v29rx.h index 385c787dd6..fd931af0f8 100644 --- a/libs/spandsp/src/spandsp/private/v29rx.h +++ b/libs/spandsp/src/spandsp/private/v29rx.h @@ -163,7 +163,7 @@ struct v29_rx_state_s /*! \brief The carrier update rate saved for reuse when using short training. */ int32_t carrier_phase_rate_save; - /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ + /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; diff --git a/libs/spandsp/src/spandsp/private/v42bis.h b/libs/spandsp/src/spandsp/private/v42bis.h index 2c801ebe24..967b1fd909 100644 --- a/libs/spandsp/src/spandsp/private/v42bis.h +++ b/libs/spandsp/src/spandsp/private/v42bis.h @@ -92,14 +92,14 @@ typedef struct /*! \brief Compression performance metric */ uint16_t compression_performance; - /*! \brief Outgoing bit buffer (compression), or incoming bit buffer (decompression) */ + /*! \brief Outgoing bit buffer (compression), or incoming bit buffer (decompression) */ uint32_t bit_buffer; - /*! \brief Outgoing bit count (compression), or incoming bit count (decompression) */ + /*! \brief Outgoing bit count (compression), or incoming bit count (decompression) */ int bit_count; /*! \brief The output composition buffer */ uint8_t output_buf[V42BIS_MAX_OUTPUT_LENGTH]; - /*! \brief The length of the contents of the output composition buffer */ + /*! \brief The length of the contents of the output composition buffer */ int output_octet_count; /*! \brief The current value of the escape code */ diff --git a/libs/spandsp/src/spandsp/private/v8.h b/libs/spandsp/src/spandsp/private/v8.h index 77dd55eea0..213d445f52 100644 --- a/libs/spandsp/src/spandsp/private/v8.h +++ b/libs/spandsp/src/spandsp/private/v8.h @@ -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. */ - + #if !defined(_SPANDSP_PRIVATE_V8_H_) #define _SPANDSP_PRIVATE_V8_H_ @@ -62,7 +62,7 @@ struct v8_state_s int preamble_type; uint8_t rx_data[64]; int rx_data_ptr; - + /*! \brief a reference copy of the last CM or JM message, used when testing for matches. */ uint8_t cm_jm_data[64]; diff --git a/libs/spandsp/src/spandsp/t30.h b/libs/spandsp/src/spandsp/t30.h index 7606f42d75..241df11d9e 100644 --- a/libs/spandsp/src/spandsp/t30.h +++ b/libs/spandsp/src/spandsp/t30.h @@ -74,7 +74,7 @@ generated according to the specification. The T.30 spec. specifies a number of time-outs. For example, after dialing a number, a calling fax system should listen for a response for 35 seconds before giving up. -These time-out periods are as follows: +These time-out periods are as follows: - T1 - 35+-5s: the maximum time for which two fax system will attempt to identify each other - T2 - 6+-1s: a time-out used to start the sequence for changing transmit parameters @@ -86,7 +86,7 @@ ignored, sometimes with good reason. For example, after placing a call, the calling fax system is supposed to wait for 35 seconds before giving up. If the answering unit does not answer on the first ring or if a voice answering machine is connected to the line, or if there are many delays through the network, -the delay before answer can be much longer than 35 seconds. +the delay before answer can be much longer than 35 seconds. Fax units that support error correction mode (ECM) can respond to a post-image handshake message with a receiver not ready (RNR) message. The calling unit then @@ -95,7 +95,7 @@ answering unit is still busy (printing for example), it will repeat the RNR message. According to the T.30 standard, this sequence (RR/RNR RR/RNR) can be repeated for up to the end of T5 (60+-5s). However, many fax systems ignore the time-out and will continue the sequence indefinitely, unless the user -manually overrides. +manually overrides. All the time-outs are subject to alteration, and sometimes misuse. Good T.30 implementations must do the right thing, and tolerate others doing the wrong thing. @@ -109,7 +109,7 @@ violate this requirement, especially for the silent period between DCS and TCF. This may be stretched to well over 100ms. If this period is too long, it can interfere with handshake signal error recovery, should a packet be corrupted on the line. Systems should ensure they stay within the prescribed T.30 limits, and be tolerant of others -being out of spec.. +being out of spec.. \subsection t30_page_sec_2d Other timing variations @@ -118,7 +118,7 @@ variations in the duration of pauses between unacknowledged handshake message repetitions, and also in the pauses between the receipt of a handshake command and the start of a response to that command. In order to reduce the total transmission time, many fax systems start sending a response message before the -end of the command has been received. +end of the command has been received. \subsection t30_page_sec_2e Other deviations from the T.30 standard @@ -284,11 +284,11 @@ enum T30_ERR_BADTAG, /*! Incorrect values for TIFF/F tags */ T30_ERR_BADTIFFHDR, /*! Bad TIFF/F header - incorrect values in fields */ T30_ERR_NOMEM, /*! Cannot allocate memory for more pages */ - + /* General problems */ T30_ERR_RETRYDCN, /*! Disconnected after permitted retries */ T30_ERR_CALLDROPPED, /*! The call dropped prematurely */ - + /* Feature negotiation issues */ T30_ERR_NOPOLL, /*! Poll not accepted */ T30_ERR_IDENT_UNACCEPTABLE, /*! Far end's ident is not acceptable */ diff --git a/libs/spandsp/src/spandsp/t31.h b/libs/spandsp/src/spandsp/t31.h index 37dba4846b..4e8452e497 100644 --- a/libs/spandsp/src/spandsp/t31.h +++ b/libs/spandsp/src/spandsp/t31.h @@ -56,7 +56,7 @@ SPAN_DECLARE(void) t31_call_event(t31_state_t *s, int event); \param s The T.31 modem context. \return The number of bytes of free space. */ SPAN_DECLARE(int) t31_at_rx_free_space(t31_state_t *s); - + SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len); /*! Process a block of received T.31 modem audio samples. diff --git a/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h b/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h index 744643aa40..0b1bee6af6 100644 --- a/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h +++ b/libs/spandsp/src/spandsp/t38_non_ecm_buffer.h @@ -68,7 +68,7 @@ successive EOL markers, with no pixel data between them. */ /*! The buffer length much be a power of two. The chosen length is big enough for - over 9s of data at the V.17 14,400bps rate. */ + over 9s of data at the V.17 14,400bps rate. */ #define T38_NON_ECM_TX_BUF_LEN 16384 /*! \brief A flow controlled non-ECM image data buffer, for buffering T.38 to analogue diff --git a/libs/spandsp/src/spandsp/tone_generate.h b/libs/spandsp/src/spandsp/tone_generate.h index d6ed8f2bc3..7fe140c216 100644 --- a/libs/spandsp/src/spandsp/tone_generate.h +++ b/libs/spandsp/src/spandsp/tone_generate.h @@ -31,7 +31,7 @@ /*! \page tone_generation_page Tone generation \section tone_generation_page_sec_1 What does it do? The tone generation module provides for the generation of cadenced tones, -suitable for a wide range of telephony applications. +suitable for a wide range of telephony applications. \section tone_generation_page_sec_2 How does it work? Oscillators are a problem. They oscillate due to instability, and yet we need @@ -40,7 +40,7 @@ on this subject. Many describe rather complex solutions to the problem. However, we are only concerned with telephony applications. It is possible to generate the tones we need with a very simple efficient scheme. It is also practical to use an exhaustive test to prove the oscillator is stable under all the -conditions in which we will use it. +conditions in which we will use it. */ typedef struct tone_gen_tone_descriptor_s tone_gen_tone_descriptor_t; diff --git a/libs/spandsp/src/spandsp/v17rx.h b/libs/spandsp/src/spandsp/v17rx.h index 935d542853..21c34f5b29 100644 --- a/libs/spandsp/src/spandsp/v17rx.h +++ b/libs/spandsp/src/spandsp/v17rx.h @@ -34,7 +34,7 @@ The V.17 receiver implements the receive side of a V.17 modem. This can operate at data rates of 14400, 12000, 9600 and 7200 bits/second. The audio input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.17 modems operate independantly. V.17 is mostly used for FAX transmission over PSTN -lines, where it provides the standard 14400 bits/second rate. +lines, where it provides the standard 14400 bits/second rate. \section v17rx_page_sec_2 How does it work? V.17 uses QAM modulation, at 2400 baud, and trellis coding. Constellations with @@ -93,7 +93,7 @@ into line. From this point on, a heavily damped integrate and dump approach, based on the angular difference between each received constellation position and its expected position, is sufficient to track the carrier, and maintain phase alignment. A fast rough approximator for the arc-tangent function is adequate -for the estimation of the angular error. +for the estimation of the angular error. The next phase of the training sequence is a scrambled sequence of two particular symbols. We train the T/2 adaptive equalizer using this sequence. The @@ -102,7 +102,7 @@ converges to the proper generalised solution. At the end of this sequence, the equalizer should be sufficiently well adapted that is can correctly resolve the full QAM constellation. However, the equalizer continues to adapt throughout operation of the modem, fine tuning on the more complex data patterns of the -full QAM constellation. +full QAM constellation. In the last phase of the training sequence, the modem enters normal data operation, with a short defined period of all ones as data. As in most high diff --git a/libs/spandsp/src/spandsp/v17tx.h b/libs/spandsp/src/spandsp/v17tx.h index 91fd595149..0d98cc7010 100644 --- a/libs/spandsp/src/spandsp/v17tx.h +++ b/libs/spandsp/src/spandsp/v17tx.h @@ -34,7 +34,7 @@ The V.17 transmitter implements the transmit side of a V.17 modem. This can operate at data rates of 14400, 12000, 9600 and 7200 bits/second. The audio output is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.17 modems operate independantly. V.17 is mostly used for FAX -transmission, where it provides the standard 14400 bits/second rate. +transmission, where it provides the standard 14400 bits/second rate. \section v17tx_page_sec_2 How does it work? V.17 uses QAM modulation and trellis coding. The data to be transmitted is @@ -53,7 +53,7 @@ The standard method of producing a QAM modulated signal is to use a sampling rate which is a multiple of the baud rate. The raw signal is then a series of complex pulses, each an integer number of samples long. These can be shaped, using a suitable complex filter, and multiplied by a complex carrier signal -to produce the final QAM signal for transmission. +to produce the final QAM signal for transmission. The pulse shaping filter is only vaguely defined by the V.17 spec. Some of the other ITU modem specs. fully define the filter, typically specifying a root @@ -76,7 +76,7 @@ The carrier is generated using the DDS method. Using two second order resonators started in quadrature, might be more efficient, as it would have less impact on the processor cache than a table lookup approach. However, the DDS approach suits the receiver better, so the same signal generator is also used for the -transmitter. +transmitter. */ /*! diff --git a/libs/spandsp/src/spandsp/v18.h b/libs/spandsp/src/spandsp/v18.h index 08219ec0be..fbd4994a59 100644 --- a/libs/spandsp/src/spandsp/v18.h +++ b/libs/spandsp/src/spandsp/v18.h @@ -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. */ - + /*! \file */ /*! \page v18_page The V.18 text telephony protocols diff --git a/libs/spandsp/src/spandsp/v27ter_rx.h b/libs/spandsp/src/spandsp/v27ter_rx.h index a6055844d6..5881f4cf02 100644 --- a/libs/spandsp/src/spandsp/v27ter_rx.h +++ b/libs/spandsp/src/spandsp/v27ter_rx.h @@ -35,7 +35,7 @@ The V.27ter receiver implements the receive side of a V.27ter modem. This can op at data rates of 4800 and 2400 bits/s. The audio input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.27ter modems operate independantly. V.27ter is mostly used for FAX transmission, where it provides the -standard 4800 bits/s rate (the 2400 bits/s mode is not used for FAX). +standard 4800 bits/s rate (the 2400 bits/s mode is not used for FAX). \section v27ter_rx_page_sec_2 How does it work? V.27ter defines two modes of operation. One uses 8-PSK at 1600 baud, giving 4800bps. diff --git a/libs/spandsp/src/spandsp/v27ter_tx.h b/libs/spandsp/src/spandsp/v27ter_tx.h index 8a04e2018c..e785c889ec 100644 --- a/libs/spandsp/src/spandsp/v27ter_tx.h +++ b/libs/spandsp/src/spandsp/v27ter_tx.h @@ -34,17 +34,17 @@ The V.27ter transmitter implements the transmit side of a V.27ter modem. This can operate at data rates of 4800 and 2400 bits/s. The audio output is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.27ter modems operate independantly. V.27ter is used for FAX transmission, -where it provides the standard 4800 and 2400 bits/s rates. +where it provides the standard 4800 and 2400 bits/s rates. \section v27ter_tx_page_sec_2 How does it work? V.27ter uses DPSK modulation. A common method of producing a DPSK modulated signal is to use a sampling rate which is a multiple of the baud rate. The raw signal is then a series of complex pulses, each an integer number of samples long. These can be shaped, using a suitable complex filter, and multiplied by a -complex carrier signal to produce the final DPSK signal for transmission. +complex carrier signal to produce the final DPSK signal for transmission. The pulse shaping filter for V.27ter is defined in the spec. It is a root raised -cosine filter with 50% excess bandwidth. +cosine filter with 50% excess bandwidth. The sampling rate for our transmitter is defined by the channel - 8000 samples/s. This is a multiple of the baud rate at 4800 bits/s (8-PSK at 1600 baud, 5 samples per diff --git a/libs/spandsp/src/spandsp/v29rx.h b/libs/spandsp/src/spandsp/v29rx.h index bb52e624dc..ec3a945ad4 100644 --- a/libs/spandsp/src/spandsp/v29rx.h +++ b/libs/spandsp/src/spandsp/v29rx.h @@ -35,7 +35,7 @@ at data rates of 9600, 7200 and 4800 bits/s. The audio input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.29 modems operate independantly. V.29 is mostly used for FAX transmission, where it provides the standard 9600 and 7200 bits/s rates (the 4800 bits/s mode is not -used for FAX). +used for FAX). \section v29rx_page_sec_2 How does it work? V.29 operates at 2400 baud for all three bit rates. It uses 16-QAM modulation for @@ -92,7 +92,7 @@ into line. From this point on, a heavily damped integrate and dump approach, based on the angular difference between each received constellation position and its expected position, is sufficient to track the carrier, and maintain phase alignment. A fast rough approximator for the arc-tangent function is adequate -for the estimation of the angular error. +for the estimation of the angular error. The next phase of the training sequence is a scrambled sequence of two particular symbols. We train the T/2 adaptive equalizer using this sequence. The @@ -101,7 +101,7 @@ converges to the proper generalised solution. At the end of this sequence, the equalizer should be sufficiently well adapted that is can correctly resolve the full QAM constellation. However, the equalizer continues to adapt throughout operation of the modem, fine tuning on the more complex data patterns of the -full QAM constellation. +full QAM constellation. In the last phase of the training sequence, the modem enters normal data operation, with a short defined period of all ones as data. As in most high @@ -115,7 +115,7 @@ application, and the receive modem is up and running. Unfortunately, some transmit side of some real V.29 modems fail to initialise their scrambler before sending the ones. This means the first 23 received bits (the length of the scrambler register) cannot be trusted for the test. The receive modem, -therefore, only tests that bits starting at bit 24 are really ones. +therefore, only tests that bits starting at bit 24 are really ones. */ #if defined(SPANDSP_USE_FIXED_POINT) diff --git a/libs/spandsp/src/spandsp/v29tx.h b/libs/spandsp/src/spandsp/v29tx.h index 3cb14fea94..86737d1ba3 100644 --- a/libs/spandsp/src/spandsp/v29tx.h +++ b/libs/spandsp/src/spandsp/v29tx.h @@ -35,14 +35,14 @@ operate at data rates of 9600, 7200 and 4800 bits/s. The audio output is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.29 modems operate independantly. V.29 is mostly used for FAX transmission, where it provides the standard 9600 and 7200 bits/s rates (the 4800 bits/s mode -is not used for FAX). +is not used for FAX). \section v29tx_page_sec_2 How does it work? V.29 uses QAM modulation. The standard method of producing a QAM modulated signal is to use a sampling rate which is a multiple of the baud rate. The raw signal is then a series of complex pulses, each an integer number of samples long. These can be shaped, using a suitable complex filter, and multiplied by a -complex carrier signal to produce the final QAM signal for transmission. +complex carrier signal to produce the final QAM signal for transmission. The pulse shaping filter is only vaguely defined by the V.29 spec. Some of the other ITU modem specs. fully define the filter, typically specifying a root @@ -65,7 +65,7 @@ The carrier is generated using the DDS method. Using two second order resonators started in quadrature, might be more efficient, as it would have less impact on the processor cache than a table lookup approach. However, the DDS approach suits the receiver better, so the same signal generator is also used for the -transmitter. +transmitter. The equation defining QAM modulation is: @@ -76,16 +76,16 @@ where phi(n) is the phase of the information, and A is the amplitude of the info using the identity cos(x + y) = cos(x)*cos(y) - sin(x)*sin(y) - + we get s(n) = A {cos(2*pi*f*n)*cos(phi(n)) - sin(2*pi*f*n)*sin(phi(n))} - + substituting with the constellation positions I(n) = A*cos(phi(n)) Q(n) = A*sin(phi(n)) - + gives s(n) = I(n)*cos(2*pi*f*n) - Q(n)*sin(2*pi*f*n) diff --git a/libs/spandsp/src/spandsp/v42.h b/libs/spandsp/src/spandsp/v42.h index 5ab26262dd..6332e5cd61 100644 --- a/libs/spandsp/src/spandsp/v42.h +++ b/libs/spandsp/src/spandsp/v42.h @@ -79,7 +79,7 @@ SPAN_DECLARE(logging_state_t *) v42_get_logging_state(v42_state_t *s); /*! Initialise a V.42 context. \param s The V.42 context. \param calling_party TRUE if caller mode, else answerer mode. - \param detect TRUE to perform the V.42 detection, else go straight into LAP.M + \param detect TRUE to perform the V.42 detection, else go straight into LAP.M \param iframe_get A callback function to handle received frames of data. \param iframe_put A callback function to get frames of data for transmission. \param user_data An opaque pointer passed to the frame handler routines. diff --git a/libs/spandsp/src/spandsp/v42bis.h b/libs/spandsp/src/spandsp/v42bis.h index bf6f6e6f1a..1f9ae98fa1 100644 --- a/libs/spandsp/src/spandsp/v42bis.h +++ b/libs/spandsp/src/spandsp/v42bis.h @@ -85,7 +85,7 @@ SPAN_DECLARE(int) v42bis_compress_flush(v42bis_state_t *s); \param len The length of the data buffer. \return 0 */ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *s, const uint8_t buf[], int len); - + /*! Flush out any data remaining in the decompression buffer. \param s The V.42bis context. \return 0 */ diff --git a/libs/spandsp/src/t30.c b/libs/spandsp/src/t30.c index ddb0337834..7e9e4c333f 100644 --- a/libs/spandsp/src/t30.c +++ b/libs/spandsp/src/t30.c @@ -1111,7 +1111,7 @@ static int send_csa_frame(t30_state_t *s) static int send_pps_frame(t30_state_t *s) { uint8_t frame[7]; - + frame[0] = ADDRESS_FIELD; frame[1] = CONTROL_FIELD_FINAL_FRAME; frame[2] = (uint8_t) (T30_PPS | s->dis_received); @@ -1238,7 +1238,7 @@ int t30_build_dis_or_dtc(t30_state_t *s) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_300_300_CAPABLE); if ((s->supported_resolutions & (T30_SUPPORT_400_400_RESOLUTION | T30_SUPPORT_R16_RESOLUTION))) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_400_400_CAPABLE); - /* Metric */ + /* Metric */ set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_METRIC_RESOLUTION_PREFERRED); /* Superfine minimum scan line time pattern follows fine */ if ((s->supported_t30_features & T30_SUPPORT_SELECTIVE_POLLING)) @@ -2510,7 +2510,7 @@ static int process_rx_dcs(t30_state_t *s, const uint8_t *msg, int len) } /* Start document reception */ span_log(&s->logging, - SPAN_LOG_FLOW, + SPAN_LOG_FLOW, "Get document at %dbps, modem %d\n", fallback_sequence[s->current_fallback].bit_rate, fallback_sequence[s->current_fallback].modem_type); @@ -2692,7 +2692,7 @@ static int process_rx_pps(t30_state_t *s, const uint8_t *msg, int len) s->ecm_len[frame_no] = -1; } } - } + } if (s->ecm_len[frame_no] < 0) { s->ecm_frame_map[i + 3] |= (1 << j); @@ -2794,7 +2794,7 @@ static void process_rx_ppr(t30_state_t *s, const uint8_t *msg, int len) span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for PPR bits - %d\n", (len - 3)*8); /* This frame didn't get corrupted in transit, because its CRC is OK. It was sent bad and there is little possibility that causing a retransmission will help. It is best - to just give up. */ + to just give up. */ t30_set_status(s, T30_ERR_TX_ECMPHD); disconnect(s); return; @@ -3509,7 +3509,7 @@ static void process_state_f_doc_and_post_doc_ecm(t30_state_t *s, const uint8_t * { uint8_t fcf; uint8_t fcf2; - + /* This actually handles 2 states - _DOC_ECM and _POST_DOC_ECM - as they are very similar */ fcf = msg[2] & 0xFE; switch (fcf) @@ -5150,7 +5150,7 @@ static void timer_t4b_start(t30_state_t *s) static void timer_t2_t4_stop(t30_state_t *s) { const char *tag; - + switch (s->timer_t2_t4_is) { case TIMER_IS_IDLE: @@ -5433,7 +5433,7 @@ static void decode_url_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int le static int decode_nsf_nss_nsc(t30_state_t *s, uint8_t *msg[], const uint8_t *pkt, int len) { uint8_t *t; - + if ((t = malloc(len - 1)) == NULL) return 0; memcpy(t, pkt + 1, len - 1); @@ -5889,7 +5889,7 @@ SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, i SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status) { t30_state_t *s; - + s = (t30_state_t *) user_data; switch (status) diff --git a/libs/spandsp/src/t30_logging.c b/libs/spandsp/src/t30_logging.c index e951df85bd..33efcb9c03 100644 --- a/libs/spandsp/src/t30_logging.c +++ b/libs/spandsp/src/t30_logging.c @@ -425,7 +425,7 @@ static void octet_reserved_bit(logging_state_t *log, char s[10] = ".... ...."; int bit; uint8_t octet; - + /* Break out the octet and the bit number within it. */ octet = msg[((bit_no - 1) >> 3) + 3]; bit_no = (bit_no - 1) & 7; @@ -488,7 +488,7 @@ static void octet_field(logging_state_t *log, int i; uint8_t octet; const char *tag; - + /* Break out the octet and the bit number range within it. */ octet = msg[((start - 1) >> 3) + 3]; start = (start - 1) & 7; @@ -646,7 +646,7 @@ SPAN_DECLARE(void) t30_decode_dis_dtc_dcs(t30_state_t *s, const uint8_t *pkt, in span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } - + span_log(log, SPAN_LOG_FLOW, "%s:\n", t30_frametype(pkt[2])); if (len <= 3) { @@ -674,7 +674,7 @@ SPAN_DECLARE(void) t30_decode_dis_dtc_dcs(t30_state_t *s, const uint8_t *pkt, in span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } - + if (frame_type == T30_DCS) { octet_reserved_bit(log, pkt, 9, 0); diff --git a/libs/spandsp/src/t31.c b/libs/spandsp/src/t31.c index 20e7666bd9..6a9f08d382 100644 --- a/libs/spandsp/src/t31.c +++ b/libs/spandsp/src/t31.c @@ -259,7 +259,7 @@ static int extra_bits_in_stuffed_frame(const uint8_t buf[], int len) int stuffed; int i; int j; - + bitstream = 0; ones = 0; stuffed = 0; @@ -307,7 +307,7 @@ static int extra_bits_in_stuffed_frame(const uint8_t buf[], int len) static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_no, int expected_seq_no) { t31_state_t *s; - + s = (t31_state_t *) user_data; s->t38_fe.rx_data_missing = TRUE; return 0; @@ -649,7 +649,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the end of non-ECM data. We need to tolerate this. We use the generic receive complete indication, rather than the specific HDLC carrier down. */ - /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - + /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops. The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */ fe->hdlc_rx.len = 0; @@ -1354,7 +1354,7 @@ SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples) static int t31_modem_control_handler(at_state_t *s, void *user_data, int op, const char *num) { t31_state_t *t; - + t = (t31_state_t *) user_data; switch (op) { @@ -2800,7 +2800,7 @@ SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len) s->audio.silence_heard = 0; } else - { + { if (s->audio.silence_heard <= ms_to_samples(255*10)) s->audio.silence_heard++; /*endif*/ @@ -2893,7 +2893,7 @@ SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len) { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); - len = max_len; + len = max_len; } /*endif*/ return len; @@ -2970,7 +2970,7 @@ static int t31_t38_fe_init(t31_state_t *t, void *tx_packet_user_data) { t31_t38_front_end_state_t *s; - + s = &t->t38_fe; t38_core_init(&s->t38, diff --git a/libs/spandsp/src/t35.c b/libs/spandsp/src/t35.c index ad10d96881..4186504a4c 100644 --- a/libs/spandsp/src/t35.c +++ b/libs/spandsp/src/t35.c @@ -32,23 +32,23 @@ * Copyright (c) 1994-1996 Silicon Graphics, Inc. * HylaFAX is a trademark of Silicon Graphics * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -108,7 +108,7 @@ static const model_data_t Canon[] = {5, "\x80\x00\x8A\x49\x10", "Laser Class 9000 Series"}, {5, "\x80\x00\x8A\x48\x00", "Laser Class 2060"}, {0, NULL, NULL} -}; +}; static const model_data_t Brother[] = { @@ -215,13 +215,13 @@ static const model_data_t JetFax[] = {0, NULL, NULL} }; -static const model_data_t PitneyBowes[] = +static const model_data_t PitneyBowes[] = { {6, "\x79\x91\xB1\xB8\x7A\xD8", "9550"}, {0, NULL, NULL} }; -static const model_data_t Dialogic[] = +static const model_data_t Dialogic[] = { {8, "\x56\x8B\x06\x55\x00\x15\x00\x00", "VFX/40ESC"}, {0, NULL, NULL} @@ -247,7 +247,7 @@ static const model_data_t Muratec48[] = * identified by a single manufacturer byte. * * T.30 5.3.6.2.7 (2003) states that the NSF FIF is transmitted - * in MSB2LSB order. Revisions of T.30 prior to 2003 did not + * in MSB2LSB order. Revisions of T.30 prior to 2003 did not * contain explicit specification as to the transmit bit order. * (Although it did otherwise state that all HDLC frame data should * be in MSB order except as noted.) Because CSI, TSI, and other @@ -259,7 +259,7 @@ static const model_data_t Muratec48[] = * * Thus, country code x61 (Korea) turns into x86 (Papua New Guinea), * code xB5 (USA) turns into xAD (Tunisia), code x26 (China) turns - * into x64 (Lebanon), code x04 (Germany) turns into x20 (Canada), + * into x64 (Lebanon), code x04 (Germany) turns into x20 (Canada), * and code x3D (France) turns into xBC (Vietnam). * * For the most part it should be safe to identify a manufacturer @@ -800,7 +800,7 @@ SPAN_DECLARE(int) t35_real_country_code(int country_code, int country_code_exten } /* We need to apply realism over accuracy, though it blocks out some countries. It is very rare to find a machine from any country but the following: - + Japan 0x00 (no confusion) Germany 0x04 (0x20) (Canada/Germany confusion) China 0x26 (0x64) (China/Lebanon confusion) @@ -860,7 +860,7 @@ SPAN_DECLARE(const char *) t35_country_code_to_str(int country_code, int country /* Right now there are no extension codes defined by the ITU */ return NULL; } - + return t35_country_codes[country_code].name; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/src/t38_core.c b/libs/spandsp/src/t38_core.c index 665bed2313..ae6526f7e8 100644 --- a/libs/spandsp/src/t38_core.c +++ b/libs/spandsp/src/t38_core.c @@ -635,7 +635,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8 - 3. the result of a hop in the sequence numbers cause by something weird from the other end. Stream switching might cause this - 4. missing packets. - + In cases 1 and 2 we need to drop this packet. In case 2 it might make sense to try to do something with it in the terminal case. Currently we don't. For gateway operation it will be too late to do anything useful. diff --git a/libs/spandsp/src/t38_gateway.c b/libs/spandsp/src/t38_gateway.c index 7955b3e5a8..7656332e80 100644 --- a/libs/spandsp/src/t38_gateway.c +++ b/libs/spandsp/src/t38_gateway.c @@ -779,7 +779,7 @@ static void queue_missing_indicator(t38_gateway_state_t *s, int data_type) t38_core_state_t *t; int expected; int expected_alt; - + t = &s->t38x.t38; expected = -1; expected_alt = -1; @@ -861,7 +861,7 @@ static void queue_missing_indicator(t38_gateway_state_t *s, int data_type) static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_no, int expected_seq_no) { t38_gateway_state_t *s; - + s = (t38_gateway_state_t *) user_data; s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in].flags |= HDLC_FLAG_MISSING_DATA; return 0; @@ -1030,7 +1030,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, { xx->t38.v34_rate = t38_v34rate_to_bps(buf, len); span_log(&s->logging, SPAN_LOG_FLOW, "V.34 rate %d bps\n", xx->t38.v34_rate); - } + } else { span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for V34rate message - %d\n", len); @@ -1284,7 +1284,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, } else { - /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - + /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops. The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. In this case we just clear out any partial frame data that might be in the buffer. */ @@ -1400,7 +1400,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, static void set_octets_per_data_packet(t38_gateway_state_t *s, int bit_rate) { int octets; - + octets = s->core.ms_per_tx_chunk*bit_rate/(8*1000); if (octets < 1) octets = 1; @@ -1751,7 +1751,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t) t38_gateway_state_t *s; t38_gateway_to_t38_state_t *u; int category; - + s = (t38_gateway_state_t *) t->frame_user_data; u = &s->core.to_t38; if ((t->raw_bit_stream & 0x80)) @@ -2096,7 +2096,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], i int len; #if defined(LOG_FAX_AUDIO) int required_len; - + required_len = max_len; #endif if ((len = s->audio.modems.tx_handler(s->audio.modems.tx_user_data, amp, max_len)) < max_len) @@ -2119,7 +2119,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], i { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); - len = max_len; + len = max_len; } /*endif*/ #if defined(LOG_FAX_AUDIO) diff --git a/libs/spandsp/src/t38_non_ecm_buffer.c b/libs/spandsp/src/t38_non_ecm_buffer.c index ddf5b49f7a..cc339a0581 100644 --- a/libs/spandsp/src/t38_non_ecm_buffer.c +++ b/libs/spandsp/src/t38_non_ecm_buffer.c @@ -153,12 +153,12 @@ SPAN_DECLARE(void) t38_non_ecm_buffer_inject(t38_non_ecm_buffer_state_t *s, cons An EOL 11 zeros followed by a one in a T.4 1D image or 11 zeros followed by a one followed by a one or a zero in a T.4 2D image. An RTC consists of 6 EOLs in succession, with no pixel data between them. - + We can stuff with ones until we get the first EOL into our buffer, then we can stuff with zeros in front of each EOL at any point up the the RTC. We should not pad between the EOLs which make up the RTC. Most FAX machines don't care about this, but a few will not recognise the RTC if here is padding between the EOLs. - + We need to buffer whole rows before we output their beginning, so there is no possibility of underflow mid-row. */ diff --git a/libs/spandsp/src/t38_terminal.c b/libs/spandsp/src/t38_terminal.c index ca000e1ac7..66938d8d24 100644 --- a/libs/spandsp/src/t38_terminal.c +++ b/libs/spandsp/src/t38_terminal.c @@ -164,7 +164,7 @@ static int extra_bits_in_stuffed_frame(const uint8_t buf[], int len) int stuffed; int i; int j; - + bitstream = 0; ones = 0; stuffed = 0; @@ -212,7 +212,7 @@ static int extra_bits_in_stuffed_frame(const uint8_t buf[], int len) static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_no, int expected_seq_no) { t38_terminal_state_t *s; - + s = (t38_terminal_state_t *) user_data; s->t38_fe.rx_data_missing = TRUE; return 0; @@ -223,7 +223,7 @@ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indica { t38_terminal_state_t *s; t38_terminal_front_end_state_t *fe; - + s = (t38_terminal_state_t *) user_data; fe = &s->t38_fe; @@ -547,7 +547,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the end of non-ECM data. We need to tolerate this. We use the generic receive complete indication, rather than the specific HDLC carrier down. */ - /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - + /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops. The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */ fe->hdlc_rx.len = 0; @@ -1447,7 +1447,7 @@ SPAN_DECLARE(t38_core_state_t *) t38_terminal_get_t38_core_state(t38_terminal_st static int t38_terminal_t38_fe_restart(t38_terminal_state_t *t) { t38_terminal_front_end_state_t *s; - + s = &t->t38_fe; t38_core_restart(&s->t38); @@ -1471,7 +1471,7 @@ static int t38_terminal_t38_fe_init(t38_terminal_state_t *t, void *tx_packet_user_data) { t38_terminal_front_end_state_t *s; - + s = &t->t38_fe; t38_core_init(&s->t38, process_rx_indicator, diff --git a/libs/spandsp/src/t4_rx.c b/libs/spandsp/src/t4_rx.c index a331225ddf..eae361941b 100644 --- a/libs/spandsp/src/t4_rx.c +++ b/libs/spandsp/src/t4_rx.c @@ -174,12 +174,10 @@ static int set_tiff_directory_info(t4_rx_state_t *s) case COMPRESSION_CCITT_T4: TIFFSetField(t->tiff_file, TIFFTAG_T4OPTIONS, output_t4_options); TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); - TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); break; case COMPRESSION_CCITT_T6: TIFFSetField(t->tiff_file, TIFFTAG_T6OPTIONS, 0); TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); - TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); break; case COMPRESSION_T85: TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); diff --git a/libs/spandsp/src/t85_decode.c b/libs/spandsp/src/t85_decode.c index 8193c10a0d..93efc06e81 100644 --- a/libs/spandsp/src/t85_decode.c +++ b/libs/spandsp/src/t85_decode.c @@ -722,7 +722,7 @@ SPAN_DECLARE(int) t85_decode_new_plane(t85_decode_state_t *s) { if (s->current_bit_plane >= s->bit_planes - 1) return -1; - + s->current_bit_plane++; s->tx = 0; memset(s->buffer, 0, sizeof(s->buffer)); diff --git a/libs/spandsp/src/t85_encode.c b/libs/spandsp/src/t85_encode.c index d9c4d200e2..6ce2cae6fb 100644 --- a/libs/spandsp/src/t85_encode.c +++ b/libs/spandsp/src/t85_encode.c @@ -206,7 +206,7 @@ static void generate_bih(t85_encode_state_t *s, uint8_t *buf) buf[19] = s->options; } /*- End of function --------------------------------------------------------*/ - + SPAN_DECLARE(void) t85_encode_set_options(t85_encode_state_t *s, uint32_t l0, int mx, @@ -713,7 +713,7 @@ SPAN_DECLARE(t85_encode_state_t *) t85_encode_init(t85_encode_state_t *s, s->current_bit_plane = 0; t85_encode_restart(s, image_width, image_length); - + return s; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/src/tone_generate.c b/libs/spandsp/src/tone_generate.c index 487bb69833..21285f6a96 100644 --- a/libs/spandsp/src/tone_generate.c +++ b/libs/spandsp/src/tone_generate.c @@ -107,7 +107,7 @@ SPAN_DECLARE(tone_gen_descriptor_t *) tone_gen_descriptor_init(tone_gen_descript s->duration[3] = d4*SAMPLE_RATE/1000; s->repeat = repeat; - + return s; } /*- End of function --------------------------------------------------------*/ @@ -137,7 +137,7 @@ SPAN_DECLARE_NONSTD(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_sa limit = samples + s->duration[s->current_section] - s->current_position; if (limit > max_samples) limit = max_samples; - + s->current_position += (limit - samples); if (s->current_section & 1) { diff --git a/libs/spandsp/src/v17rx.c b/libs/spandsp/src/v17rx.c index b275270b49..46480ee19b 100644 --- a/libs/spandsp/src/v17rx.c +++ b/libs/spandsp/src/v17rx.c @@ -1228,7 +1228,7 @@ static __inline__ int signal_detect(v17_rx_state_t *s, int16_t amp) } } else - { + { s->low_samples = 0; if (diff > s->high_sample) s->high_sample = diff; @@ -1560,7 +1560,7 @@ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_trai s->baud_phase = 0.0f; #endif s->baud_half = 0; - + s->total_baud_timing_correction = 0; return 0; diff --git a/libs/spandsp/src/v18.c b/libs/spandsp/src/v18.c index e1cfdc005a..3529fe6f0d 100644 --- a/libs/spandsp/src/v18.c +++ b/libs/spandsp/src/v18.c @@ -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. */ - + /*! \file */ #if defined(HAVE_CONFIG_H) @@ -72,7 +72,7 @@ /* Ways in which a V.18 call may start ----------------------------------- - + Originate: ANS Silence for 0.5s then send TXP @@ -643,7 +643,7 @@ static int v18_tdd_get_async_byte(void *user_data) { v18_state_t *s; int ch; - + s = (v18_state_t *) user_data; if ((ch = queue_read_byte(&s->queue.queue)) >= 0) return ch; @@ -666,7 +666,7 @@ static void v18_tdd_put_async_byte(void *user_data, int byte) { v18_state_t *s; uint8_t octet; - + s = (v18_state_t *) user_data; if (byte < 0) { diff --git a/libs/spandsp/src/v22bis_rx.c b/libs/spandsp/src/v22bis_rx.c index d124d7bcd8..c4898cf1cd 100644 --- a/libs/spandsp/src/v22bis_rx.c +++ b/libs/spandsp/src/v22bis_rx.c @@ -110,7 +110,7 @@ The basic method used by the V.22bis receiver is: Tune the local carrier, based on the angular mismatch between the actual signal and the decision. - + Tune the equalizer, based on the mismatch between the actual signal and the decision. Descramble and output the bits represented by the decision. @@ -800,7 +800,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int l for (i = 0; i < len; i++) { /* Complex bandpass filter the signal, using a pair of FIRs, and RRC coeffs shifted - to centre at 1200Hz or 2400Hz. The filters support 12 fractional phase shifts, to + to centre at 1200Hz or 2400Hz. The filters support 12 fractional phase shifts, to permit signal extraction very close to the middle of a symbol. */ s->rx.rrc_filter[s->rx.rrc_filter_step] = amp[i]; if (++s->rx.rrc_filter_step >= V22BIS_RX_FILTER_STEPS) diff --git a/libs/spandsp/src/v22bis_tx.c b/libs/spandsp/src/v22bis_tx.c index 5cbef4d7d8..8b5068803e 100644 --- a/libs/spandsp/src/v22bis_tx.c +++ b/libs/spandsp/src/v22bis_tx.c @@ -151,7 +151,7 @@ c) On detection of scrambled binary 1 in the high channel at 1200 bit/s for 270 d) 765 +-10 ms after circuit 109 has been turned ON, circuit 106 shall be conditioned to respond to circuit 105 and the modem shall be ready to transmit data at 1200 bit/s. - + 6.3.1.2.2 Answering modem a) On connection to line the answering modem shall be conditioned to transmit signals in the high @@ -289,7 +289,7 @@ static __inline__ int scramble(v22bis_state_t *s, int bit) } out_bit = (bit ^ (s->tx.scramble_reg >> 13) ^ (s->tx.scramble_reg >> 16)) & 1; s->tx.scramble_reg = (s->tx.scramble_reg << 1) | out_bit; - + if (out_bit == 1) s->tx.scrambler_pattern_count++; else diff --git a/libs/spandsp/src/v27ter_rx.c b/libs/spandsp/src/v27ter_rx.c index a4a9f5eeb9..ce0537b560 100644 --- a/libs/spandsp/src/v27ter_rx.c +++ b/libs/spandsp/src/v27ter_rx.c @@ -135,7 +135,7 @@ SPAN_DECLARE(float) v27ter_rx_carrier_frequency(v27ter_rx_state_t *s) SPAN_DECLARE(float) v27ter_rx_symbol_timing_correction(v27ter_rx_state_t *s) { int steps_per_symbol; - + steps_per_symbol = (s->bit_rate == 4800) ? RX_PULSESHAPER_4800_COEFF_SETS*5 : RX_PULSESHAPER_2400_COEFF_SETS*20/3; return (float) s->total_baud_timing_correction/(float) steps_per_symbol; } @@ -538,7 +538,7 @@ static __inline__ void process_half_baud(v27ter_rx_state_t *s, const complexf_t s->eq_buf[s->eq_step] = *sample; if (++s->eq_step >= V27TER_EQUALIZER_LEN) s->eq_step = 0; - + /* On alternate insertions we have a whole baud, and must process it. */ if ((s->baud_half ^= 1)) return; @@ -773,7 +773,7 @@ static __inline__ int signal_detect(v27ter_rx_state_t *s, int16_t amp) } } else - { + { s->low_samples = 0; if (diff > s->high_sample) s->high_sample = diff; diff --git a/libs/spandsp/src/v27ter_tx.c b/libs/spandsp/src/v27ter_tx.c index 7c05aa2f6e..6b0706aaf3 100644 --- a/libs/spandsp/src/v27ter_tx.c +++ b/libs/spandsp/src/v27ter_tx.c @@ -121,7 +121,7 @@ static __inline__ int scramble(v27ter_tx_state_t *s, int in_bit) static __inline__ int get_scrambled_bit(v27ter_tx_state_t *s) { int bit; - + if ((bit = s->current_get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA) { /* End of real data. Switch to the fake get_bit routine, until we diff --git a/libs/spandsp/src/v29rx.c b/libs/spandsp/src/v29rx.c index dec0c1f277..33e4d0b161 100644 --- a/libs/spandsp/src/v29rx.c +++ b/libs/spandsp/src/v29rx.c @@ -342,7 +342,7 @@ static __inline__ void track_carrier(v29_rx_state_t *s, const complexf_t *z, con got us in the right ballpark. Now we need to fine tune fairly quickly, to get the receovered carrier more precisely on target. Then we need to fine tune in a more damped way to keep us on target. The goal is to have - things running really well by the time the training is complete. + things running really well by the time the training is complete. We assume the frequency of the oscillators at the two ends drift only very slowly. The PSTN has rather limited doppler problems. :-) Any remaining FDM in the network should also drift slowly. */ @@ -860,7 +860,7 @@ static __inline__ int signal_detect(v29_rx_state_t *s, int16_t amp) } } else - { + { s->low_samples = 0; if (diff > s->high_sample) s->high_sample = diff; diff --git a/libs/spandsp/src/vector_int.c b/libs/spandsp/src/vector_int.c index 807b72b2b3..66166e52eb 100644 --- a/libs/spandsp/src/vector_int.c +++ b/libs/spandsp/src/vector_int.c @@ -314,15 +314,15 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq (%%rsi),%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ " por %%mm3,%%mm4;\n" " movq %%mm4,%%mm0;\n" /* Now mm0 is updated max's */ - + " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" @@ -338,7 +338,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm0,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" @@ -347,7 +347,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm1,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" @@ -362,7 +362,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movd (%%rsi),%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ @@ -370,7 +370,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm4,%%mm0;\n" /* now mm0 is updated max's */ " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" @@ -384,7 +384,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm0,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" @@ -393,12 +393,12 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm1,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movd %%mm2,%%eax;\n" /* ax is min so far */ - + " addq $2,%%rdx;\n" /* now dx = top-2 */ " cmpq %%rdx,%%rsi;\n" " ja 6f;\n" @@ -467,15 +467,15 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq (%%esi),%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ " por %%mm3,%%mm4;\n" " movq %%mm4,%%mm0;\n" /* Now mm0 is updated max's */ - + " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" @@ -491,7 +491,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm0,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" @@ -500,7 +500,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm1,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" @@ -515,7 +515,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movd (%%esi),%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ @@ -523,7 +523,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm4,%%mm0;\n" /* now mm0 is updated max's */ " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" @@ -537,7 +537,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm0,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm2,%%mm3;\n" - " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ + " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" @@ -546,12 +546,12 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) " movq %%mm1,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm1,%%mm3;\n" - " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ + " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movd %%mm2,%%eax;\n" /* ax is min so far */ - + " addl $2,%%edx;\n" /* now dx = top-2 */ " cmpl %%edx,%%esi;\n" " ja 6f;\n" @@ -597,7 +597,7 @@ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) int16_t max; int16_t temp; int32_t z; - + max = INT16_MIN; min = INT16_MAX; for (i = 0; i < n; i++) diff --git a/libs/spandsp/tests/bell_mf_rx_tests.c b/libs/spandsp/tests/bell_mf_rx_tests.c index 352a0f1f5d..68c9a7a05b 100644 --- a/libs/spandsp/tests/bell_mf_rx_tests.c +++ b/libs/spandsp/tests/bell_mf_rx_tests.c @@ -168,7 +168,7 @@ static void codec_munge(int16_t amp[], int len) { int i; uint8_t alaw; - + for (i = 0; i < len; i++) { alaw = linear_to_alaw (amp[i]); @@ -288,11 +288,11 @@ int main(int argc, char *argv[]) RRB% = (N+ + N-)/10 Receiver Center Frequency Offset (RCFO) is calculated as follows: RCFO% = X + (N+ - N-)/20 - + Note that this test doesn't test what it says it is testing at all, and the results are quite inaccurate, if not a downright lie! However, it follows the Mitel procedure, so how can it be bad? :) - + The spec calls for +-1.5% +-10Hz of bandwidth. */ printf ("Test 3: Recognition bandwidth and channel centre frequency check\n"); @@ -411,11 +411,11 @@ int main(int argc, char *argv[]) printf(" Passed\n"); /* Test 5: Dynamic range - This test sends all possible digits, with gradually increasing + This test sends all possible digits, with gradually increasing amplitude. We determine the span over which we achieve reliable detection. The spec says we should detect between -14dBm and 0dBm, but the tones clip above -3dBm, so this cannot really work. */ - + printf("Test 5: Dynamic range\n"); for (nplus = nminus = -1000, i = -50; i <= 3; i++) { @@ -450,7 +450,7 @@ int main(int argc, char *argv[]) printf(" Passed\n"); /* Test 6: Guard time - This test sends all possible digits, with a gradually reducing + This test sends all possible digits, with a gradually reducing duration. The spec defines a narrow range of tone duration times we can expect, so as long as we detect reliably at the specified minimum we should be OK. However, the spec also says diff --git a/libs/spandsp/tests/bert_tests.c b/libs/spandsp/tests/bert_tests.c index a981795bce..6818f61889 100644 --- a/libs/spandsp/tests/bert_tests.c +++ b/libs/spandsp/tests/bert_tests.c @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) printf("Test failed.\n"); exit(2); } - + tx_bert = bert_init(NULL, 0, BERT_PATTERN_7_TO_1, 300, 20); rx_bert = bert_init(NULL, 0, BERT_PATTERN_7_TO_1, 300, 20); for (i = 0; i < 511*2; i++) @@ -447,7 +447,7 @@ int main(int argc, char *argv[]) // bert_put_bit(bert, bit); bert_put_bit(bert, bit); } - + printf("Tests passed.\n"); return 0; } diff --git a/libs/spandsp/tests/bit_operations_tests.c b/libs/spandsp/tests/bit_operations_tests.c index 53cd997023..bb11c8d857 100644 --- a/libs/spandsp/tests/bit_operations_tests.c +++ b/libs/spandsp/tests/bit_operations_tests.c @@ -49,7 +49,7 @@ uint8_t to[1000000]; static __inline__ int top_bit_dumb(unsigned int data) { int i; - + if (data == 0) return -1; for (i = 31; i >= 0; i--) @@ -64,7 +64,7 @@ static __inline__ int top_bit_dumb(unsigned int data) static __inline__ int bottom_bit_dumb(unsigned int data) { int i; - + if (data == 0) return -1; for (i = 0; i < 32; i++) @@ -80,11 +80,11 @@ static __inline__ uint8_t bit_reverse8_dumb(uint8_t data) { int i; int result; - + result = 0; for (i = 0; i < 8; i++) { - result = (result << 1) | (data & 1); + result = (result << 1) | (data & 1); data >>= 1; } return result; @@ -95,11 +95,11 @@ static __inline__ uint32_t bit_reverse_4bytes_dumb(uint32_t data) { int i; uint32_t result; - + result = 0; for (i = 0; i < 8; i++) { - result = (result << 1) | (data & 0x01010101); + result = (result << 1) | (data & 0x01010101); data >>= 1; } return result; @@ -110,11 +110,11 @@ static __inline__ uint16_t bit_reverse16_dumb(uint16_t data) { int i; uint16_t result; - + result = 0; for (i = 0; i < 16; i++) { - result = (result << 1) | (data & 1); + result = (result << 1) | (data & 1); data >>= 1; } return result; @@ -125,11 +125,11 @@ static __inline__ uint32_t bit_reverse32_dumb(uint32_t data) { int i; uint32_t result; - + result = 0; for (i = 0; i < 32; i++) { - result = (result << 1) | (data & 1); + result = (result << 1) | (data & 1); data >>= 1; } return result; @@ -154,7 +154,7 @@ static __inline__ int one_bits32_dumb(uint32_t x) { int i; int bits; - + bits = 0; for (i = 0; i < 32; i++) { @@ -165,7 +165,7 @@ static __inline__ int one_bits32_dumb(uint32_t x) return bits; } /*- End of function --------------------------------------------------------*/ - + int main(int argc, char *argv[]) { int i; diff --git a/libs/spandsp/tests/bitstream_tests.c b/libs/spandsp/tests/bitstream_tests.c index e8ee4f0aab..2d70cd0029 100644 --- a/libs/spandsp/tests/bitstream_tests.c +++ b/libs/spandsp/tests/bitstream_tests.c @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) } bitstream_flush(s, &w); printf("%d bits written\n", total_bits); - + for (cc = buffer; cc < w; cc++) printf("%02X ", *cc); printf("\n"); diff --git a/libs/spandsp/tests/crc_tests.c b/libs/spandsp/tests/crc_tests.c index a2d77ec3c4..3cb9221055 100644 --- a/libs/spandsp/tests/crc_tests.c +++ b/libs/spandsp/tests/crc_tests.c @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) printf("CRC module tests\n"); /* TODO: This doesn't check every function in the module */ - + /* Try a few random messages through the CRC logic. */ printf("Testing the CRC-16 routines\n"); for (i = 0; i < 100; i++) @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) } } printf("Test passed.\n\n"); - + printf("Testing the CRC-16 byte by byte and bit by bit routines\n"); for (i = 0; i < 100; i++) { @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) } } printf("Test passed.\n\n"); - + printf("Testing the CRC-32 routines\n"); for (i = 0; i < 100; i++) { diff --git a/libs/spandsp/tests/echo_monitor.cpp b/libs/spandsp/tests/echo_monitor.cpp index 541aa03a64..690bc5da8c 100644 --- a/libs/spandsp/tests/echo_monitor.cpp +++ b/libs/spandsp/tests/echo_monitor.cpp @@ -216,7 +216,7 @@ int echo_can_monitor_line_spectrum_update(const int16_t amp[], int len) #endif } s->in_ptr = 0; -#if defined(HAVE_FFTW3_H) +#if defined(HAVE_FFTW3_H) fftw_execute(s->p); #else fftw_one(s->p, s->in, s->out); @@ -227,7 +227,7 @@ int echo_can_monitor_line_spectrum_update(const int16_t amp[], int len) for (i = 0; i < 512; i++) { s->spec_re_plot[2*i] = i*4000.0/512.0; -#if defined(HAVE_FFTW3_H) +#if defined(HAVE_FFTW3_H) s->spec_re_plot[2*i + 1] = 10.0*log10((s->out[i][0]*s->out[i][0] + s->out[i][1]*s->out[i][1])/(256.0*32768*256.0*32768) + 1.0e-10) + 3.14; #else s->spec_re_plot[2*i + 1] = 10.0*log10((s->out[i].re*s->out[i].re + s->out[i].im*s->out[i].im)/(256.0*32768*256.0*32768) + 1.0e-10) + 3.14; @@ -394,7 +394,7 @@ int start_echo_can_monitor(int len) s->w->end(); s->w->show(); -#if defined(HAVE_FFTW3_H) +#if defined(HAVE_FFTW3_H) s->p = fftw_plan_dft_1d(1024, s->in, s->out, FFTW_BACKWARD, FFTW_ESTIMATE); for (i = 0; i < 1024; i++) { @@ -416,7 +416,7 @@ int start_echo_can_monitor(int len) } /*- End of function --------------------------------------------------------*/ -void echo_can_monitor_wait_to_end(void) +void echo_can_monitor_wait_to_end(void) { fd_set rfds; int res; @@ -437,7 +437,7 @@ void echo_can_monitor_wait_to_end(void) } /*- End of function --------------------------------------------------------*/ -void echo_can_monitor_update_display(void) +void echo_can_monitor_update_display(void) { Fl::check(); Fl::check(); diff --git a/libs/spandsp/tests/fax_tester.h b/libs/spandsp/tests/fax_tester.h index 0d1f77f0bb..45054ec7ec 100644 --- a/libs/spandsp/tests/fax_tester.h +++ b/libs/spandsp/tests/fax_tester.h @@ -106,7 +106,7 @@ struct faxtester_state_s int current_tx_type; int wait_for_silence; - + int tone_state; int64_t tone_on_time; diff --git a/libs/spandsp/tests/line_model_monitor.cpp b/libs/spandsp/tests/line_model_monitor.cpp index 8e57fe8a94..a517c62e5b 100644 --- a/libs/spandsp/tests/line_model_monitor.cpp +++ b/libs/spandsp/tests/line_model_monitor.cpp @@ -417,7 +417,7 @@ int start_line_model_monitor(int len) } /*- End of function --------------------------------------------------------*/ -void line_model_monitor_wait_to_end(void) +void line_model_monitor_wait_to_end(void) { fd_set rfds; int res; @@ -438,7 +438,7 @@ void line_model_monitor_wait_to_end(void) } /*- End of function --------------------------------------------------------*/ -void line_model_monitor_update_display(void) +void line_model_monitor_update_display(void) { Fl::check(); Fl::check(); diff --git a/libs/spandsp/tests/line_model_tests.c b/libs/spandsp/tests/line_model_tests.c index db998ba0df..8f2091e3fb 100644 --- a/libs/spandsp/tests/line_model_tests.c +++ b/libs/spandsp/tests/line_model_tests.c @@ -115,13 +115,13 @@ static void test_one_way_model(int line_model_no, int speech_test) int i; int j; awgn_state_t noise1; - + if ((model = one_way_line_model_init(line_model_no, -50, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } - + awgn_init_dbm0(&noise1, 1234567, -10.0f); if (speech_test) @@ -157,7 +157,7 @@ static void test_one_way_model(int line_model_no, int speech_test) } for (j = 0; j < samples; j++) { - one_way_line_model(model, + one_way_line_model(model, &output1[j], &input1[j], 1); @@ -204,7 +204,7 @@ static void test_both_ways_model(int line_model_no, int speech_test) int j; awgn_state_t noise1; awgn_state_t noise2; - + if ((model = both_ways_line_model_init(line_model_no, -50, -15.0f, @@ -219,7 +219,7 @@ static void test_both_ways_model(int line_model_no, int speech_test) fprintf(stderr, " Failed to create line model\n"); exit(2); } - + awgn_init_dbm0(&noise1, 1234567, -10.0f); awgn_init_dbm0(&noise2, 1234567, -10.0f); @@ -268,7 +268,7 @@ static void test_both_ways_model(int line_model_no, int speech_test) } for (j = 0; j < samples; j++) { - both_ways_line_model(model, + both_ways_line_model(model, &output1[j], &input1[j], &output2[j], @@ -339,7 +339,7 @@ static void test_line_filter(int line_model_no) if (++p == 129) p = 0; ptr = p; - + /* Apply the filter */ out = 0.0f; for (j = 0; j < 129; j++) diff --git a/libs/spandsp/tests/lpc10_tests.c b/libs/spandsp/tests/lpc10_tests.c index 975ea3e555..dee9a624e1 100644 --- a/libs/spandsp/tests/lpc10_tests.c +++ b/libs/spandsp/tests/lpc10_tests.c @@ -149,13 +149,13 @@ int main(int argc, char *argv[]) fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } - + if ((lpc10_enc_state = lpc10_encode_init(NULL, TRUE)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } - + if ((lpc10_dec_state = lpc10_decode_init(NULL, TRUE)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) exit(2); } } - + if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); diff --git a/libs/spandsp/tests/media_monitor.cpp b/libs/spandsp/tests/media_monitor.cpp index cc7519bc82..ffdfc75a26 100644 --- a/libs/spandsp/tests/media_monitor.cpp +++ b/libs/spandsp/tests/media_monitor.cpp @@ -114,7 +114,7 @@ void media_monitor_rx(int seq_no, double departure_time, double arrival_time) } s->received_delays = new Ca_Line(2000, s->received_delays_plot, 0, 0, FL_BLUE, CA_NO_POINT); - + if (s->sent_re) delete s->sent_re; @@ -126,7 +126,7 @@ void media_monitor_rx(int seq_no, double departure_time, double arrival_time) s->sent_re_plot[2*(i%500) + 1] = 0.0; } s->sent_re_plot[2*(seq_no%500) + 1] = fdiff; - + if (fdiff > s->sent_re_plot_max) { s->sent_re_plot_max = fdiff; @@ -157,7 +157,7 @@ int start_media_monitor(void) float y; int i; int len; - + len = 128; s->w = new Fl_Double_Window(465, 400, "IP streaming media monitor"); @@ -255,7 +255,7 @@ int start_media_monitor(void) s->received_delays_plot_max = 0.0; s->min_diff = 2000; s->max_diff = 0; - + s->received_delays = NULL; s->highest_seq_no_seen = -1; @@ -278,7 +278,7 @@ int start_media_monitor(void) } /*- End of function --------------------------------------------------------*/ -void media_monitor_wait_to_end(void) +void media_monitor_wait_to_end(void) { fd_set rfds; int res; @@ -299,7 +299,7 @@ void media_monitor_wait_to_end(void) } /*- End of function --------------------------------------------------------*/ -void media_monitor_update_display(void) +void media_monitor_update_display(void) { Fl::check(); Fl::check(); diff --git a/libs/spandsp/tests/modem_monitor.cpp b/libs/spandsp/tests/modem_monitor.cpp index db8a31a22d..0c3c8ce8ab 100644 --- a/libs/spandsp/tests/modem_monitor.cpp +++ b/libs/spandsp/tests/modem_monitor.cpp @@ -61,7 +61,7 @@ struct qam_monitor_s Fl_Group *c_right; Fl_Group *c_eq; Fl_Group *c_symbol_track; - + /* Constellation stuff */ Ca_Canvas *canvas_const; Ca_X_Axis *sig_i; @@ -202,7 +202,7 @@ int qam_monitor_update_equalizer(qam_monitor_t *s, const complexf_t *coeffs, int if (max < coeffs[i].im) max = coeffs[i].im; } - + s->eq_x->minimum(-len/4.0); s->eq_x->maximum(len/4.0); s->eq_y->maximum((max == min) ? max + 0.2 : max); @@ -316,7 +316,7 @@ int qam_monitor_update_audio_level(qam_monitor_t *s, const int16_t amp[], int le int i; char buf[11]; double val; - + for (i = 0; i < len; i++) { s->audio_meter->sample(amp[i]/32768.0); @@ -385,10 +385,10 @@ qam_monitor_t *qam_monitor_init(float constel_width, float constel_scaling, cons float x; float y; qam_monitor_t *s; - + if ((s = (qam_monitor_t *) malloc(sizeof(*s))) == NULL) return NULL; - + s->w = new Fl_Double_Window(905, 400, (tag) ? tag : "QAM monitor"); s->constel_scaling = 1.0/constel_scaling; @@ -567,7 +567,7 @@ qam_monitor_t *qam_monitor_init(float constel_width, float constel_scaling, cons } /*- End of function --------------------------------------------------------*/ -void qam_wait_to_end(qam_monitor_t *s) +void qam_wait_to_end(qam_monitor_t *s) { fd_set rfds; int res; diff --git a/libs/spandsp/tests/t31_pseudo_terminal_tests.c b/libs/spandsp/tests/t31_pseudo_terminal_tests.c index 68e36f9184..c216a901c1 100644 --- a/libs/spandsp/tests/t31_pseudo_terminal_tests.c +++ b/libs/spandsp/tests/t31_pseudo_terminal_tests.c @@ -1,7 +1,7 @@ /* * SpanDSP - a series of DSP components for telephony * - * t31_pseudo_terminal_tests.c - + * t31_pseudo_terminal_tests.c - * * Written by Steve Underwood * @@ -125,7 +125,7 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; - + i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("Phase E handler on channel %c\n", i); @@ -316,7 +316,7 @@ static int modem_wait_sock(modem_t *modem, int ms, modem_poll_t flags) { if (GetLastError() != ERROR_IO_PENDING) { - /* Something went horribly wrong with WaitCommEvent(), so + /* Something went horribly wrong with WaitCommEvent(), so clear all errors and try again */ ClearCommError(modem->master, &comerrors, 0); } @@ -412,7 +412,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int #endif /* Test the T.31 modem against the full FAX machine in spandsp */ - + /* Set up the test environment */ t38_version = 1; without_pacing = FALSE; @@ -580,7 +580,7 @@ static int t30_tests(int t38_mode, int use_ecm, int use_gui, int log_audio, int while (!done) { - /* Deal with call setup, through the AT interface. */ + /* Deal with call setup, through the AT interface. */ if (test_sending) { } diff --git a/libs/spandsp/tests/t31_tests.c b/libs/spandsp/tests/t31_tests.c index ec14fcaca7..6967ee1a67 100644 --- a/libs/spandsp/tests/t31_tests.c +++ b/libs/spandsp/tests/t31_tests.c @@ -312,7 +312,7 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; - + i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("Phase E handler on channel %c\n", i); @@ -508,7 +508,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending, SNDFILE *in_handle; /* Test the T.31 modem against the full FAX machine in spandsp */ - + /* Set up the test environment */ t38_version = 1; without_pacing = FALSE; @@ -668,7 +668,7 @@ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending, { if (countdown) { - /* Deal with call setup, through the AT interface. */ + /* Deal with call setup, through the AT interface. */ if (answered) { countdown = 0; diff --git a/libs/spandsp/tests/t38_core_tests.c b/libs/spandsp/tests/t38_core_tests.c index a282c1204f..094e688827 100644 --- a/libs/spandsp/tests/t38_core_tests.c +++ b/libs/spandsp/tests/t38_core_tests.c @@ -126,7 +126,7 @@ static int rx_data_handler(t38_core_state_t *s, void *user_data, int data_type, static int tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { t38_core_state_t *t; - + t = (t38_core_state_t *) user_data; span_log(t38_core_get_logging_state(s), SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); if (t38_core_rx_ifp_packet(t, buf, len, seq_no) < 0) @@ -151,7 +151,7 @@ static int encode_decode_tests(t38_core_state_t *a, t38_core_state_t *b) t38_data_field_t field[MAX_FIELDS]; int i; int j; - + ok_indicator_packets = 0; bad_indicator_packets = 0; ok_data_packets = 0; @@ -296,7 +296,7 @@ static int encode_then_decode_tests(t38_core_state_t *a, t38_core_state_t *b) int len; int i; int j; - + ok_indicator_packets = 0; bad_indicator_packets = 0; ok_data_packets = 0; diff --git a/libs/spandsp/tests/t38_decode.c b/libs/spandsp/tests/t38_decode.c index 7272cf9471..67660fe937 100644 --- a/libs/spandsp/tests/t38_decode.c +++ b/libs/spandsp/tests/t38_decode.c @@ -224,7 +224,7 @@ static int t38_gateway_timing_update(void *user_data, struct timeval *ts) } if (t38_gateway_rx(t38_gateway_state, t30_amp, t30_len)) break; - + t38_len = t38_gateway_tx(t38_gateway_state, t38_amp, partial); if (!use_transmit_on_idle) { @@ -295,7 +295,7 @@ static uint32_t parse_inet_addr(const char *s) uint32_t b; uint32_t c; uint32_t d; - + a = 0; b = 0; c = 0; diff --git a/libs/spandsp/tests/t38_non_ecm_buffer_tests.c b/libs/spandsp/tests/t38_non_ecm_buffer_tests.c index add5fb86f1..c9fa046cb4 100644 --- a/libs/spandsp/tests/t38_non_ecm_buffer_tests.c +++ b/libs/spandsp/tests/t38_non_ecm_buffer_tests.c @@ -645,7 +645,7 @@ int main(int argc, char *argv[]) } } printf(" Initial ones from an empty TCF buffer OK\n"); - + /* Now send some initial ones, and see that we continue to get all ones as the stuffing. */ memset(buf, 0xFF, 500); diff --git a/libs/spandsp/tests/t4_tests.c b/libs/spandsp/tests/t4_tests.c index 8b96f390f1..afded4ec2b 100644 --- a/libs/spandsp/tests/t4_tests.c +++ b/libs/spandsp/tests/t4_tests.c @@ -288,10 +288,10 @@ int main(int argc, char *argv[]) #if defined(SPANDSP_SUPPORT_T42x) T4_COMPRESSION_ITU_T42, T4_COMPRESSION_ITU_SYCC_T42, -#endif +#endif #if defined(SPANDSP_SUPPORT_T43x) T4_COMPRESSION_ITU_T43, -#endif +#endif T4_COMPRESSION_ITU_T85, T4_COMPRESSION_ITU_T85_L0, //T4_COMPRESSION_ITU_T45, diff --git a/libs/spandsp/tests/tsb85_tests.c b/libs/spandsp/tests/tsb85_tests.c index ddef770779..9d431f4f3f 100644 --- a/libs/spandsp/tests/tsb85_tests.c +++ b/libs/spandsp/tests/tsb85_tests.c @@ -99,7 +99,7 @@ static int phase_b_handler(t30_state_t *s, void *user_data, int result) int i; int status; const char *u; - + i = (intptr_t) user_data; status = T30_ERR_OK; if ((u = t30_get_rx_ident(s))) @@ -256,10 +256,10 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; - + i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); - printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); + printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); @@ -289,7 +289,7 @@ static void t30_real_time_frame_handler(t30_state_t *s, static int document_handler(t30_state_t *s, void *user_data, int event) { int i; - + i = (intptr_t) user_data; fprintf(stderr, "%d: Document handler on channel %d - event %d\n", i, i, event); if (next_tx_file[0]) @@ -498,7 +498,7 @@ static int string_to_msg(uint8_t msg[], uint8_t mask[], const char buf[]) static void string_test2(const uint8_t msg[], int len) { int i; - + if (len > 0) { for (i = 0; i < len - 1; i++) @@ -514,7 +514,7 @@ static void string_test3(const char buf[]) uint8_t mask[1000]; int len; int i; - + len = string_to_msg(msg, mask, buf); printf("Len = %d: ", len); string_test2(msg, abs(len)); @@ -671,7 +671,7 @@ static int next_step(faxtester_state_t *s) s->cur = s->cur->next; span_log(&s->logging, - SPAN_LOG_FLOW, + SPAN_LOG_FLOW, "Dir - %s, type - %s, modem - %s, value - %s, timeout - %s, tag - %s\n", (dir) ? (const char *) dir : "", (type) ? (const char *) type : "", @@ -1111,7 +1111,7 @@ static void exchange(faxtester_state_t *s) span_log_bump_samples(logging, len); span_log_bump_samples(&s->logging, len); - + len = faxtester_tx(s, amp, SAMPLES_PER_CHUNK); if (fax_rx(fax, amp, len)) break; @@ -1207,7 +1207,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char xmlNodePtr cur; xmlValidCtxt valid; - ns = NULL; + ns = NULL; xmlKeepBlanksDefault(0); xmlCleanupParser(); if ((doc = xmlParseFile(test_file)) == NULL) diff --git a/libs/spandsp/tests/v18_tests.c b/libs/spandsp/tests/v18_tests.c index f29430619d..f084cdeecb 100644 --- a/libs/spandsp/tests/v18_tests.c +++ b/libs/spandsp/tests/v18_tests.c @@ -1639,7 +1639,7 @@ static int test_x_06(void) msg[i] = i + 1; msg[127] = '\0'; printf("%s\n", msg); - + v18_encode_dtmf(NULL, dtmf, msg); printf("%s\n", dtmf); @@ -1780,7 +1780,7 @@ static int test_x_12(void) static void put_v18_msg(void *user_data, const uint8_t *msg, int len) { char buf[1024]; - + memcpy(buf, msg, len); buf[len] = '\0'; printf("Received (%d bytes) '%s'\n", len, buf); diff --git a/libs/spandsp/tests/v22bis_tests.c b/libs/spandsp/tests/v22bis_tests.c index dd3564cdcb..82722e2556 100644 --- a/libs/spandsp/tests/v22bis_tests.c +++ b/libs/spandsp/tests/v22bis_tests.c @@ -87,7 +87,7 @@ endpoint_t endpoint[2]; static void reporter(void *user_data, int reason, bert_results_t *results) { endpoint_t *s; - + s = (endpoint_t *) user_data; switch (reason) { @@ -100,7 +100,7 @@ static void reporter(void *user_data, int reason, bert_results_t *results) memcpy(&s->latest_results, results, sizeof(s->latest_results)); break; default: - fprintf(stderr, + fprintf(stderr, "V.22bis rx %p BERT report %s\n", user_data, bert_event_to_str(reason)); @@ -271,7 +271,7 @@ int main(int argc, char *argv[]) int rbs_pattern; int guard_tone_option; int opt; - + channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; test_bps = 2400; @@ -373,7 +373,7 @@ int main(int argc, char *argv[]) bert_set_report(&endpoint[i].bert_rx, 10000, reporter, &endpoint[i]); } - + #if defined(ENABLE_GUI) if (use_gui) { @@ -420,7 +420,7 @@ int main(int argc, char *argv[]) } #if 1 - both_ways_line_model(model, + both_ways_line_model(model, model_amp[0], amp[0], model_amp[1], diff --git a/libs/spandsp/tests/v29_tests.c b/libs/spandsp/tests/v29_tests.c index 900121c23c..246c217fd1 100644 --- a/libs/spandsp/tests/v29_tests.c +++ b/libs/spandsp/tests/v29_tests.c @@ -327,7 +327,7 @@ int main(int argc, char *argv[]) int rbs_pattern; int opt; logging_state_t *logging; - + channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; test_bps = 9600; @@ -551,7 +551,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); one_way_line_model_release(line_model); - + if (signal_level > -43) { printf("Tests failed.\n"); diff --git a/libs/spandsp/tests/v42bis_tests.c b/libs/spandsp/tests/v42bis_tests.c index 06381e6e60..cc95967c54 100644 --- a/libs/spandsp/tests/v42bis_tests.c +++ b/libs/spandsp/tests/v42bis_tests.c @@ -57,7 +57,7 @@ int out_octets_to_date = 0; static void frame_handler(void *user_data, const uint8_t *buf, int len) { int ret; - + if ((ret = write((intptr_t) user_data, buf, len)) != len) fprintf(stderr, "Write error %d/%d\n", ret, errno); out_octets_to_date += len; @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Error opening file '%s'.\n", decompressed_file); exit(2); } - + time(&now); state_b = v42bis_init(NULL, 3, 512, 6, frame_handler, (void *) (intptr_t) v42bis_fd, 512, data_handler, (void *) (intptr_t) out_fd, 512); span_log_set_level(v42bis_get_logging_state(state_b), SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); diff --git a/libs/spandsp/tests/v8_tests.c b/libs/spandsp/tests/v8_tests.c index 5961ef5dc6..d9ef7b82b9 100644 --- a/libs/spandsp/tests/v8_tests.c +++ b/libs/spandsp/tests/v8_tests.c @@ -77,7 +77,7 @@ static int select_modulation(int mask) static void handler(void *user_data, v8_parms_t *result) { const char *s; - + s = (const char *) user_data; printf("%s ", s); @@ -362,7 +362,7 @@ static int non_v8_calls_v8_tests(SNDFILE *outhandle) for (i = 0; i < samples; i++) out_amp[2*i] = amp[i]; /*endfor*/ - + samples = v8_tx(v8_answerer, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { @@ -472,7 +472,7 @@ static int v8_calls_non_v8_tests(SNDFILE *outhandle) for (i = 0; i < samples; i++) out_amp[2*i] = amp[i]; /*endfor*/ - + samples = modem_connect_tones_tx(non_v8_answerer_tx, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { diff --git a/libs/spandsp/tests/vector_float_tests.c b/libs/spandsp/tests/vector_float_tests.c index 2d388fc9dc..26df593864 100644 --- a/libs/spandsp/tests/vector_float_tests.c +++ b/libs/spandsp/tests/vector_float_tests.c @@ -37,7 +37,7 @@ static void vec_copyf_dumb(float z[], const float x[], int n) { int i; - + for (i = 0; i < n; i++) z[i] = x[i]; } @@ -97,7 +97,7 @@ static int test_vec_copyf(void) static void vec_negatef_dumb(float z[], const float x[], int n) { int i; - + for (i = 0; i < n; i++) z[i] = -x[i]; } @@ -157,7 +157,7 @@ static int test_vec_negatef(void) static void vec_zerof_dumb(float z[], int n) { int i; - + for (i = 0; i < n; i++) z[i] = 0.0f; } @@ -215,7 +215,7 @@ static int test_vec_zerof(void) static void vec_setf_dumb(float z[], float x, int n) { int i; - + for (i = 0; i < n; i++) z[i] = x; } diff --git a/libs/spandsp/tests/vector_int_tests.c b/libs/spandsp/tests/vector_int_tests.c index 1b0aa309c1..0ac0c6424c 100644 --- a/libs/spandsp/tests/vector_int_tests.c +++ b/libs/spandsp/tests/vector_int_tests.c @@ -81,7 +81,7 @@ static int32_t vec_min_maxi16_dumb(const int16_t x[], int n, int16_t out[]) int16_t max; int16_t temp; int32_t z; - + max = INT16_MIN; min = INT16_MAX; for (i = 0; i < n; i++) @@ -103,7 +103,7 @@ static int32_t vec_min_maxi16_dumb(const int16_t x[], int n, int16_t out[]) return max; } /*- End of function --------------------------------------------------------*/ - + static int test_vec_min_maxi16(void) { int i;