mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 23:24:18 +00:00
Various little cleanups in spandsp
This commit is contained in:
1 parent
33c723e839
commit
0eada8dc77
26 files changed
+191
-88
No files matched your search
@@ -78,7 +78,7 @@ static span_alloc_t __span_alloc = malloc;
|
||||
static span_realloc_t __span_realloc = realloc;
|
||||
static span_free_t __span_free = free;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -606,6 +606,7 @@ SPAN_DECLARE(logging_state_t *) fax_modems_get_logging_state(fax_modems_state_t
|
||||
|
||||
SPAN_DECLARE(int) fax_modems_restart(fax_modems_state_t *s)
|
||||
{
|
||||
s->current_tx_type = -1;
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -653,7 +654,7 @@ SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
|
||||
s->hdlc_accept = hdlc_accept;
|
||||
s->hdlc_accept_user_data = user_data;
|
||||
|
||||
hdlc_rx_init(&s->hdlc_rx, false, false, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s);
|
||||
hdlc_rx_init(&s->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s);
|
||||
hdlc_tx_init(&s->hdlc_tx, false, 2, false, hdlc_tx_underflow, user_data);
|
||||
|
||||
fax_modems_start_slow_modem(s, FAX_MODEM_V21_RX);
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
static void weighting_filter(int16_t x[40],
|
||||
const int16_t *e) // signal [-5..0.39.44] IN)
|
||||
{
|
||||
#if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) && !defined(__OpenBSD__)
|
||||
#if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) && !defined(__OpenBSD__)
|
||||
/* Table 4.4 Coefficients of the weighting filter */
|
||||
/* This must be padded to a multiple of 4 for MMX to work */
|
||||
static const union
|
||||
|
||||
@@ -53,6 +53,7 @@ static void report_status_change(hdlc_rx_state_t *s, int status)
|
||||
s->status_handler(s->status_user_data, status);
|
||||
else if (s->frame_handler)
|
||||
s->frame_handler(s->frame_user_data, NULL, status, true);
|
||||
/*endif*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -80,6 +81,7 @@ static void rx_special_condition(hdlc_rx_state_t *s, int status)
|
||||
//printf("Eh!\n");
|
||||
break;
|
||||
}
|
||||
/*endswitch*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -97,12 +99,14 @@ static __inline__ void octet_set_and_count(hdlc_rx_state_t *s)
|
||||
s->octet_count = s->octet_count_report_interval;
|
||||
report_status_change(s, SIG_STATUS_OCTET_REPORT);
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
else
|
||||
{
|
||||
s->octet_counting_mode = true;
|
||||
s->octet_count = s->octet_count_report_interval;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -110,6 +114,7 @@ static __inline__ void octet_count(hdlc_rx_state_t *s)
|
||||
{
|
||||
if (s->octet_count_report_interval == 0)
|
||||
return;
|
||||
/*endif*/
|
||||
|
||||
/* If we are not in octet counting mode, we start it.
|
||||
If we are in octet counting mode, we update it. */
|
||||
@@ -120,7 +125,9 @@ static __inline__ void octet_count(hdlc_rx_state_t *s)
|
||||
s->octet_count = s->octet_count_report_interval;
|
||||
report_status_change(s, SIG_STATUS_OCTET_REPORT);
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -138,6 +145,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
|
||||
s->flags_seen = 0;
|
||||
else
|
||||
s->flags_seen = s->framing_ok_threshold - 1;
|
||||
/*endif*/
|
||||
/* An abort starts octet counting */
|
||||
octet_set_and_count(s);
|
||||
}
|
||||
@@ -171,8 +179,11 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
|
||||
s->len -= s->crc_bytes;
|
||||
if (s->frame_handler)
|
||||
s->frame_handler(s->frame_user_data, s->buffer, s->len, false);
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,12 +196,17 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
|
||||
s->len -= s->crc_bytes;
|
||||
else
|
||||
s->len = 0;
|
||||
/*endif*/
|
||||
if (s->frame_handler)
|
||||
s->frame_handler(s->frame_user_data, s->buffer, s->len, false);
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
s->rx_length_errors++;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -210,14 +226,19 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
|
||||
s->flags_seen = 0;
|
||||
else
|
||||
s->flags_seen = s->framing_ok_threshold - 1;
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
if (++s->flags_seen >= s->framing_ok_threshold && !s->framing_ok_announced)
|
||||
{
|
||||
report_status_change(s, SIG_STATUS_FRAMING_OK);
|
||||
s->framing_ok_announced = true;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
s->len = 0;
|
||||
s->num_bits = 0;
|
||||
}
|
||||
@@ -235,20 +256,25 @@ static __inline__ void hdlc_rx_put_bit_core(hdlc_rx_state_t *s)
|
||||
/* Is this a bit to be skipped for destuffing? */
|
||||
if ((s->raw_bit_stream & 0x4100) == 0)
|
||||
return;
|
||||
/*endif*/
|
||||
/* Is this a flag or abort? */
|
||||
if ((s->raw_bit_stream & 0xFE00) == 0x7E00)
|
||||
{
|
||||
rx_flag_or_abort(s);
|
||||
return;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
s->num_bits++;
|
||||
if (s->flags_seen < s->framing_ok_threshold)
|
||||
{
|
||||
if ((s->num_bits & 0x7) == 0)
|
||||
octet_count(s);
|
||||
/*endif*/
|
||||
return;
|
||||
}
|
||||
/*endif*/
|
||||
s->byte_in_progress = (s->byte_in_progress | (s->raw_bit_stream & 0x100)) >> 1;
|
||||
if (s->num_bits == 8)
|
||||
{
|
||||
@@ -266,8 +292,10 @@ static __inline__ void hdlc_rx_put_bit_core(hdlc_rx_state_t *s)
|
||||
s->flags_seen = s->framing_ok_threshold - 1;
|
||||
octet_set_and_count(s);
|
||||
}
|
||||
/*endif*/
|
||||
s->num_bits = 0;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -278,6 +306,7 @@ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit)
|
||||
rx_special_condition(s, new_bit);
|
||||
return;
|
||||
}
|
||||
/*endif*/
|
||||
s->raw_bit_stream = (s->raw_bit_stream << 1) | ((new_bit << 8) & 0x100);
|
||||
hdlc_rx_put_bit_core(s);
|
||||
}
|
||||
@@ -292,12 +321,14 @@ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte)
|
||||
rx_special_condition(s, new_byte);
|
||||
return;
|
||||
}
|
||||
/*endif*/
|
||||
s->raw_bit_stream |= new_byte;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
s->raw_bit_stream <<= 1;
|
||||
hdlc_rx_put_bit_core(s);
|
||||
}
|
||||
/*endfor*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -307,6 +338,7 @@ SPAN_DECLARE_NONSTD(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], i
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
hdlc_rx_put_byte(s, buf[i]);
|
||||
/*endfor*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -348,7 +380,9 @@ SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s,
|
||||
{
|
||||
if ((s = (hdlc_rx_state_t *) span_alloc(sizeof(*s))) == NULL)
|
||||
return NULL;
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
memset(s, 0, sizeof(*s));
|
||||
s->frame_handler = handler;
|
||||
s->frame_user_data = user_data;
|
||||
@@ -406,29 +440,36 @@ SPAN_DECLARE(int) hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t
|
||||
s->tx_end = true;
|
||||
return 0;
|
||||
}
|
||||
/*endif*/
|
||||
if (s->len + len > s->max_frame_len)
|
||||
return -1;
|
||||
/*endif*/
|
||||
if (s->progressive)
|
||||
{
|
||||
/* Only lock out if we are in the CRC section. */
|
||||
if (s->pos >= HDLC_MAXFRAME_LEN)
|
||||
return -1;
|
||||
/*endif*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Lock out if there is anything in the buffer. */
|
||||
if (s->len)
|
||||
return -1;
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
memcpy(&s->buffer[s->len], frame, len);
|
||||
if (s->crc_bytes == 2)
|
||||
s->crc = crc_itu16_calc(frame, len, (uint16_t) s->crc);
|
||||
else
|
||||
s->crc = crc_itu32_calc(frame, len, s->crc);
|
||||
/*endif*/
|
||||
if (s->progressive)
|
||||
s->len += len;
|
||||
else
|
||||
s->len = len;
|
||||
/*endif*/
|
||||
s->tx_end = false;
|
||||
return 0;
|
||||
}
|
||||
@@ -440,10 +481,12 @@ SPAN_DECLARE(int) hdlc_tx_flags(hdlc_tx_state_t *s, int len)
|
||||
flag words. */
|
||||
if (s->pos)
|
||||
return -1;
|
||||
/*endif*/
|
||||
if (len < 0)
|
||||
s->flag_octets += -len;
|
||||
else
|
||||
s->flag_octets = len;
|
||||
/*endif*/
|
||||
s->report_flag_underflow = true;
|
||||
s->tx_end = false;
|
||||
return 0;
|
||||
@@ -464,6 +507,7 @@ SPAN_DECLARE(int) hdlc_tx_corrupt_frame(hdlc_tx_state_t *s)
|
||||
{
|
||||
if (s->len <= 0)
|
||||
return -1;
|
||||
/*endif*/
|
||||
s->crc ^= 0xFFFF;
|
||||
s->buffer[HDLC_MAXFRAME_LEN] ^= 0xFF;
|
||||
s->buffer[HDLC_MAXFRAME_LEN + 1] ^= 0xFF;
|
||||
@@ -491,15 +535,20 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
and we have been told to report this underflow. */
|
||||
if (s->underflow_handler)
|
||||
s->underflow_handler(s->user_data);
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
if (s->abort_octets)
|
||||
{
|
||||
s->abort_octets = 0;
|
||||
return 0x7F;
|
||||
}
|
||||
/*endif*/
|
||||
return s->idle_octet;
|
||||
}
|
||||
/*endif*/
|
||||
if (s->len)
|
||||
{
|
||||
if (s->num_bits >= 8)
|
||||
@@ -507,6 +556,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
s->num_bits -= 8;
|
||||
return (s->octets_in_progress >> s->num_bits) & 0xFF;
|
||||
}
|
||||
/*endif*/
|
||||
if (s->pos >= s->len)
|
||||
{
|
||||
if (s->pos == s->len)
|
||||
@@ -519,6 +569,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
s->buffer[HDLC_MAXFRAME_LEN + 2] = (uint8_t) (s->crc >> 16);
|
||||
s->buffer[HDLC_MAXFRAME_LEN + 3] = (uint8_t) (s->crc >> 24);
|
||||
}
|
||||
/*endif*/
|
||||
s->pos = HDLC_MAXFRAME_LEN;
|
||||
}
|
||||
else if (s->pos == (size_t) (HDLC_MAXFRAME_LEN + s->crc_bytes))
|
||||
@@ -538,6 +589,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
s->crc = 0xFFFF;
|
||||
else
|
||||
s->crc = 0xFFFFFFFF;
|
||||
/*endif*/
|
||||
/* Report the underflow now. If there are timed flags still in progress, loading the
|
||||
next frame right now will be harmless. */
|
||||
s->report_flag_underflow = false;
|
||||
@@ -547,9 +599,12 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
in a new frame being sent. */
|
||||
if (s->len == 0 && s->flag_octets < 2)
|
||||
s->flag_octets = 2;
|
||||
/*endif*/
|
||||
return txbyte;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
byte_in_progress = s->buffer[s->pos++];
|
||||
i = bottom_bit(byte_in_progress | 0x100);
|
||||
s->octets_in_progress <<= i;
|
||||
@@ -564,7 +619,9 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
s->octets_in_progress <<= 1;
|
||||
s->num_bits++;
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*endfor*/
|
||||
/* An input byte will generate between 8 and 10 output bits */
|
||||
return (s->octets_in_progress >> s->num_bits) & 0xFF;
|
||||
}
|
||||
@@ -574,6 +631,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
s->tx_end = false;
|
||||
return SIG_STATUS_END_OF_DATA;
|
||||
}
|
||||
/*endif*/
|
||||
return s->idle_octet;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -629,6 +687,7 @@ SPAN_DECLARE(int) hdlc_tx_restart(hdlc_tx_state_t *s)
|
||||
s->crc = 0xFFFF;
|
||||
else
|
||||
s->crc = 0xFFFFFFFF;
|
||||
/*endif*/
|
||||
s->byte = 0;
|
||||
s->bits = 0;
|
||||
s->tx_end = false;
|
||||
@@ -647,7 +706,9 @@ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
|
||||
{
|
||||
if ((s = (hdlc_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
|
||||
return NULL;
|
||||
/*endif*/
|
||||
}
|
||||
/*endif*/
|
||||
memset(s, 0, sizeof(*s));
|
||||
s->underflow_handler = handler;
|
||||
s->user_data = user_data;
|
||||
@@ -662,6 +723,7 @@ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
|
||||
s->crc_bytes = 2;
|
||||
s->crc = 0xFFFF;
|
||||
}
|
||||
/*endif*/
|
||||
s->idle_octet = 0x7E;
|
||||
s->progressive = progressive;
|
||||
s->max_frame_len = HDLC_MAXFRAME_LEN;
|
||||
|
||||
@@ -605,30 +605,35 @@ static void dump_trie(void)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
|
||||
static void trie_recursive_free(trie_node_t *t)
|
||||
{
|
||||
int i;
|
||||
if (t)
|
||||
{
|
||||
if (t->first <= t->last)
|
||||
{
|
||||
for (i = t->first; i <= t->last; i++)
|
||||
trie_recursive_free(t->child_list[i]);
|
||||
}
|
||||
free(t);
|
||||
}
|
||||
int i;
|
||||
|
||||
if (t)
|
||||
{
|
||||
if (t->first <= t->last)
|
||||
{
|
||||
for (i = t->first; i <= t->last; i++)
|
||||
trie_recursive_free(t->child_list[i]);
|
||||
/*endfor*/
|
||||
}
|
||||
/*endif*/
|
||||
free(t);
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static void trie_free(trie_t *s)
|
||||
{
|
||||
if(s)
|
||||
{
|
||||
if(s->root)
|
||||
trie_recursive_free(s->root);
|
||||
free(s);
|
||||
}
|
||||
if (s)
|
||||
{
|
||||
if (s->root)
|
||||
trie_recursive_free(s->root);
|
||||
/*endif*/
|
||||
free(s);
|
||||
}
|
||||
/*endif*/
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -639,6 +644,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if ((s = trie_create()) == NULL)
|
||||
exit(2);
|
||||
/*endif*/
|
||||
|
||||
printf("/* THIS FILE WAS AUTOMATICALLY GENERATED - ANY MODIFICATIONS MADE TO THIS");
|
||||
printf(" FILE MAY BE OVERWRITTEN DURING FUTURE BUILDS OF THE SOFTWARE */\n");
|
||||
@@ -646,6 +652,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (i = 0; wordlist[i]; i++)
|
||||
trie_add(s, wordlist[i], strlen(wordlist[i]));
|
||||
/*endfor*/
|
||||
printf("// The trie contains %d entries\n", i);
|
||||
|
||||
packed_ptr = 0;
|
||||
|
||||
@@ -195,7 +195,7 @@ extern "C"
|
||||
{
|
||||
return (long int) (x);
|
||||
}
|
||||
#elif defined(__ppc__) || defined(__powerpc__)
|
||||
#elif (defined(__ppc__) || defined(__powerpc__)) && !defined(__NO_FPRS__)
|
||||
static __inline__ long int lfastrint(register double x)
|
||||
{
|
||||
int res[2];
|
||||
|
||||
@@ -1460,6 +1460,7 @@ static int t38_terminal_t38_fe_restart(t38_terminal_state_t *t)
|
||||
s = &t->t38_fe;
|
||||
t38_core_restart(&s->t38);
|
||||
|
||||
s->current_tx_type = -1;
|
||||
s->rx_signal_present = false;
|
||||
s->timed_step = T38_TIMED_STEP_NONE;
|
||||
//s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38;
|
||||
|
||||
@@ -90,7 +90,7 @@ typedef struct
|
||||
} packer_t;
|
||||
|
||||
#if defined(SPANDSP_SUPPORT_TIFF_FX)
|
||||
#if TIFFLIB_VERSION >= 20120615
|
||||
#if TIFFLIB_VERSION >= 20120922 && defined(HAVE_TIF_DIR_H)
|
||||
extern TIFFFieldArray tiff_fx_field_array;
|
||||
#endif
|
||||
#endif
|
||||
@@ -615,7 +615,7 @@ static int write_tiff_t43_image(t4_rx_state_t *s)
|
||||
static int write_tiff_image(t4_rx_state_t *s)
|
||||
{
|
||||
t4_rx_tiff_state_t *t;
|
||||
#if defined(SPANDSP_SUPPORT_TIFF_FX)
|
||||
#if defined(SPANDSP_SUPPORT_TIFF_FX) && TIFFLIB_VERSION >= 20120922 && defined(HAVE_TIF_DIR_H)
|
||||
toff_t diroff;
|
||||
#endif
|
||||
|
||||
@@ -678,6 +678,7 @@ static int write_tiff_image(t4_rx_state_t *s)
|
||||
the first page in the file */
|
||||
if (s->current_page == 0)
|
||||
{
|
||||
#if TIFFLIB_VERSION >= 20120922 && defined(HAVE_TIF_DIR_H)
|
||||
if (!TIFFCreateCustomDirectory(t->tiff_file, &tiff_fx_field_array))
|
||||
{
|
||||
TIFFSetField(t->tiff_file, TIFFTAG_FAXPROFILE, PROFILETYPE_G3_FAX);
|
||||
@@ -698,6 +699,7 @@ static int write_tiff_image(t4_rx_state_t *s)
|
||||
if (!TIFFWriteDirectory(t->tiff_file))
|
||||
span_log(&s->logging, SPAN_LOG_WARNING, "%s: Failed to write directory for page %d.\n", t->file, s->current_page);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
#include "faxfont.h"
|
||||
|
||||
#if defined(SPANDSP_SUPPORT_TIFF_FX)
|
||||
#if defined(SPANDSP_SUPPORT_TIFF_FX) && defined(HAVE_TIF_DIR_H)
|
||||
#include <tif_dir.h>
|
||||
#endif
|
||||
|
||||
@@ -164,7 +164,7 @@ static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
|
||||
{TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ImageLayer"},
|
||||
};
|
||||
|
||||
#if TIFFLIB_VERSION >= 20120615
|
||||
#if TIFFLIB_VERSION >= 20120922 && defined(HAVE_TIF_DIR_H)
|
||||
static TIFFField tiff_fx_tiff_fields[] =
|
||||
{
|
||||
{ TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, (char *) "Indexed" },
|
||||
@@ -623,6 +623,7 @@ static int get_tiff_directory_info(t4_tx_state_t *s)
|
||||
diroff = 0;
|
||||
if (TIFFGetField(t->tiff_file, TIFFTAG_GLOBALPARAMETERSIFD, &diroff))
|
||||
{
|
||||
#if TIFFLIB_VERSION >= 20120922 && defined(HAVE_TIF_DIR_H)
|
||||
if (!TIFFReadCustomDirectory(t->tiff_file, diroff, &tiff_fx_field_array))
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "Global parameter read failed\n");
|
||||
@@ -648,6 +649,7 @@ static int get_tiff_directory_info(t4_tx_state_t *s)
|
||||
if (!TIFFSetDirectory(t->tiff_file, (tdir_t) s->current_page))
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "Failed to set directory to page %d\n", s->current_page);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
@@ -643,6 +643,7 @@ static __inline__ void process_half_baud(v22bis_state_t *s, const complexf_t *sa
|
||||
tune_equalizer(s, &z, target);
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
bitstream = decode_baudx(s, nearest);
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx 0x%x\n", bitstream);
|
||||
s->rx.training_count++;
|
||||
//span_log(&s->logging, SPAN_LOG_FLOW, "S11 0x%02x 0x%02x 0x%X %d %d %d %d %d\n", raw_bits, nearest, bitstream, s->rx.scrambled_ones_to_date, 0, 0, 0, s->rx.training_count);
|
||||
if (s->negotiated_bit_rate == 1200)
|
||||
@@ -736,6 +737,7 @@ static __inline__ void process_half_baud(v22bis_state_t *s, const complexf_t *sa
|
||||
track_carrier(s, &z, target);
|
||||
tune_equalizer(s, &z, target);
|
||||
bitstream = decode_baudx(s, nearest);
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx 0x%x\n", bitstream);
|
||||
if (++s->rx.training_count > ms_to_symbols(270 + 765))
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (1200)\n");
|
||||
|
||||
@@ -315,7 +315,7 @@ static int receive_xid(v42_state_t *ss, const uint8_t *frame, int len)
|
||||
{
|
||||
case PI_HDLC_OPTIONAL_FUNCTIONS:
|
||||
/* TODO: param_val is never used right now. */
|
||||
param_val = pack_value(buf, param_len);
|
||||
//param_val = pack_value(buf, param_len);
|
||||
break;
|
||||
case PI_TX_INFO_MAXSIZE:
|
||||
param_val = pack_value(buf, param_len);
|
||||
|
||||
Reference in new issue
Block a user