提交 df669f70 authored 作者: Steve Underwood's avatar Steve Underwood

A cleanup of FAX image size/resolution matching accuracy. Squashing of bi-level

images should now be correct. This is now close to supporting grey scale and
colour.
上级 13e85323
差异被折叠。
......@@ -34,7 +34,7 @@ EXTRA_DIST = libspandsp_sim.dsp \
msvc/vc9proj.head \
msvc/vc9proj.foot
INCLUDES = -I$(top_builddir) -I$(top_builddir)/src -DDATADIR="\"$(pkgdatadir)\""
AM_CPPFLAGS = -I$(top_builddir) -I$(top_builddir)/src -DDATADIR="\"$(pkgdatadir)\""
noinst_PROGRAMS = make_line_models
......
......@@ -78,7 +78,7 @@ EXTRA_DIST = floating_fudge.h \
spandsp/private/README \
spandsp/version.h.in
INCLUDES = -I$(top_builddir)
AM_CPPFLAGS = -I$(top_builddir)
lib_LTLIBRARIES = libspandsp.la
......
......@@ -323,12 +323,6 @@ SPAN_DECLARE(int) t4_tx_set_tx_image_format(t4_tx_state_t *s,
int supported_bilevel_resolutions,
int supported_colour_resolutions);
/*! \brief Set the compression for the encoded data.
\param s The T.4 context.
\param encoding The encoding.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding);
/*! \brief Set the minimum number of encoded bits per row. This allows the
makes the encoding process to be set to comply with the minimum row
time specified by a remote receiving machine.
......@@ -336,11 +330,6 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding);
\param bits The minimum number of bits per row. */
SPAN_DECLARE(void) t4_tx_set_min_bits_per_row(t4_tx_state_t *s, int bits);
/*! \brief Set the width of the image.
\param s The T.4 context.
\param image_width The image width, in pixels. */
SPAN_DECLARE(void) t4_tx_set_image_width(t4_tx_state_t *s, int image_width);
/*! \brief Set the maximum number of 2D encoded rows between 1D encoded rows. This
is only valid for T.4 2D encoding.
\param s The T.4 context.
......@@ -381,12 +370,6 @@ SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, int header_
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_tx_set_row_read_handler(t4_tx_state_t *s, t4_row_read_handler_t handler, void *user_data);
/*! \brief Set the row squashing ratio, for adjusting row-to-row (y) resolution of bi-level
images for a T.4 transmit context.
\param s The T.4 transmit context.
\param row_squashing_ratio Vertical squashing ratio. */
SPAN_DECLARE(void) t4_tx_set_row_squashing_ratio(t4_tx_state_t *s, int row_squashing_ratio);
/*! \brief Get the number of pages in the file.
\param s The T.4 context.
\return The number of pages, or -1 if there is an error. */
......
差异被折叠。
差异被折叠。
差异被折叠。
......@@ -46,7 +46,7 @@ EXTRA_DIST = fax_tests.sh \
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/spandsp-sim -DDATADIR="\"$(pkgdatadir)\""
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/spandsp-sim -DDATADIR="\"$(pkgdatadir)\""
LIBDIR = -L$(top_builddir)/src
......
......@@ -43,6 +43,15 @@ then
fi
echo adsi_tests completed OK
./alloc_tests >$STDOUT_DEST 2>$STDERR_DEST
RETVAL=$?
if [ $RETVAL != 0 ]
then
echo alloc_tests failed!
exit $RETVAL
fi
echo alloc_tests completed OK
./async_tests >$STDOUT_DEST 2>$STDERR_DEST
RETVAL=$?
if [ $RETVAL != 0 ]
......
......@@ -106,9 +106,9 @@ static const struct command_response_s fax_send_test_seq[] =
EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"),
//<DIS frame data>
#if 1
RESPONSE("\xFF\x13\x80\x00\xEE\xF8\x80\x80\x89\x80\x80\x80\x18\x18\xB9\x10\x03"), // For audio FAXing
RESPONSE("\xFF\x13\x80\x00\xEE\xF8\x80\x80\x99\x80\x80\x80\x18\x58\x0D\x10\x03"), // For audio FAXing
#else
RESPONSE("\xFF\x13\x80\x04\xEE\xF8\x80\x80\x89\x80\x80\x80\x18\x84\x09\x10\x03"), // For T.38 FAXing
RESPONSE("\xFF\x13\x80\x04\xEE\xF8\x80\x80\x99\x80\x80\x80\x18\xC4\xBD\x10\x03"), // For T.38 FAXing
#endif
RESPONSE("\r\nOK\r\n"),
//EXCHANGE("AT+FRH=3\r", "\r\nNO CARRIER\r\n"),
......
......@@ -518,7 +518,6 @@ int main(int argc, char *argv[])
compression = compression_sequence[compression_step++];
}
}
#if 0
if (t4_tx_set_tx_image_format(send_state,
compression,
T4_SUPPORT_WIDTH_215MM
......@@ -548,8 +547,6 @@ int main(int argc, char *argv[])
{
break;
}
#endif
t4_tx_set_tx_encoding(send_state, compression);
t4_rx_set_rx_encoding(receive_state, compression);
if (t4_tx_start_page(send_state))
......
......@@ -397,6 +397,7 @@ static void fax_prepare(void)
| T4_RESOLUTION_R8_FINE
| T4_RESOLUTION_R8_SUPERFINE
| T4_RESOLUTION_R16_SUPERFINE
| T4_RESOLUTION_100_100
| T4_RESOLUTION_200_100
| T4_RESOLUTION_200_200
| T4_RESOLUTION_200_400
......@@ -980,7 +981,37 @@ static int next_step(faxtester_state_t *s)
else if (strcasecmp((const char *) compression, "T.6") == 0)
compression_type = T4_COMPRESSION_T6;
}
t4_tx_set_tx_encoding(&t4_tx_state, compression_type);
if (t4_tx_set_tx_image_format(&t4_tx_state,
compression_type,
T4_SUPPORT_WIDTH_215MM
| T4_SUPPORT_LENGTH_US_LETTER
| T4_SUPPORT_LENGTH_US_LEGAL
| T4_SUPPORT_LENGTH_UNLIMITED,
T4_RESOLUTION_R8_STANDARD
| T4_RESOLUTION_R8_FINE
| T4_RESOLUTION_R8_SUPERFINE
| T4_RESOLUTION_R16_SUPERFINE
| T4_RESOLUTION_200_100
| T4_RESOLUTION_200_200
| T4_RESOLUTION_200_400
| T4_RESOLUTION_300_300
| T4_RESOLUTION_300_600
| T4_RESOLUTION_400_400
| T4_RESOLUTION_400_800
| T4_RESOLUTION_600_600
| T4_RESOLUTION_600_1200
| T4_RESOLUTION_1200_1200,
T4_RESOLUTION_100_100
| T4_RESOLUTION_200_200
| T4_RESOLUTION_300_300
| T4_RESOLUTION_400_400
| T4_RESOLUTION_600_600
| T4_RESOLUTION_1200_1200) < 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Failed to set T.4 compression\n");
printf("Test failed\n");
exit(2);
}
t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits);
if (t4_tx_start_page(&t4_tx_state))
{
......@@ -1020,7 +1051,37 @@ static int next_step(faxtester_state_t *s)
else if (strcasecmp((const char *) compression, "T.6") == 0)
compression_type = T4_COMPRESSION_T6;
}
t4_tx_set_tx_encoding(&t4_tx_state, compression_type);
if (t4_tx_set_tx_image_format(&t4_tx_state,
compression_type,
T4_SUPPORT_WIDTH_215MM
| T4_SUPPORT_LENGTH_US_LETTER
| T4_SUPPORT_LENGTH_US_LEGAL
| T4_SUPPORT_LENGTH_UNLIMITED,
T4_RESOLUTION_R8_STANDARD
| T4_RESOLUTION_R8_FINE
| T4_RESOLUTION_R8_SUPERFINE
| T4_RESOLUTION_R16_SUPERFINE
| T4_RESOLUTION_200_100
| T4_RESOLUTION_200_200
| T4_RESOLUTION_200_400
| T4_RESOLUTION_300_300
| T4_RESOLUTION_300_600
| T4_RESOLUTION_400_400
| T4_RESOLUTION_400_800
| T4_RESOLUTION_600_600
| T4_RESOLUTION_600_1200
| T4_RESOLUTION_1200_1200,
T4_RESOLUTION_100_100
| T4_RESOLUTION_200_200
| T4_RESOLUTION_300_300
| T4_RESOLUTION_400_400
| T4_RESOLUTION_600_600
| T4_RESOLUTION_1200_1200) < 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Failed to set T.4 compression\n");
printf("Test failed\n");
exit(2);
}
t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits);
if (t4_tx_start_page(&t4_tx_state))
{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论