update to snapshot spandsp-20090301

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12352 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-03-02 16:24:30 +00:00
parent 6d632fdf8d
commit 13b84df5d8
9 changed files with 109 additions and 29 deletions

View File

@ -16,7 +16,7 @@
## License along with this program; if not, write to the Free Software ## License along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
## ##
## $Id: Makefile.am,v 1.127 2009/02/25 15:30:21 steveu Exp $ ## $Id: Makefile.am,v 1.128 2009/03/01 12:49:28 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
@ -293,6 +293,10 @@ at_interpreter.lo: at_interpreter_dictionary.h
at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT) at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT)
./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h ./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h
t4.$(OBJEXT): spandsp/version.h
t4.lo: spandsp/version.h
v17rx.$(OBJEXT): v17rx_fixed_rrc.h v17rx_floating_rrc.h v17rx.$(OBJEXT): v17rx_fixed_rrc.h v17rx_floating_rrc.h
v17rx.lo: v17rx_fixed_rrc.h v17rx_floating_rrc.h v17rx.lo: v17rx_fixed_rrc.h v17rx_floating_rrc.h

View File

@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software * License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: bit_operations.h,v 1.25 2009/02/24 14:14:03 steveu Exp $ * $Id: bit_operations.h,v 1.26 2009/02/26 16:08:50 steveu Exp $
*/ */
/*! \file */ /*! \file */

View File

@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software * License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: fast_convert.h,v 1.5 2009/02/24 14:14:03 steveu Exp $ * $Id: fast_convert.h,v 1.6 2009/02/26 16:08:51 steveu Exp $
*/ */
#if !defined(_SPANDSP_FAST_CONVERT_H_) #if !defined(_SPANDSP_FAST_CONVERT_H_)

View File

@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: version.h.in,v 1.2 2007/04/06 13:20:36 steveu Exp $ * $Id: version.h.in,v 1.3 2009/03/01 12:39:02 steveu Exp $
*/ */
#if !defined(_SPANDSP_VERSION_H_) #if !defined(_SPANDSP_VERSION_H_)
@ -30,8 +30,9 @@
/* The date and time of the version are in UTC form. */ /* The date and time of the version are in UTC form. */
#define SPANDSP_RELEASE_DATE 20090226 #define SPANDSP_RELEASE_DATE 20090301
#define SPANDSP_RELEASE_TIME 121601 #define SPANDSP_RELEASE_TIME 125126
#define SPANDSP_RELEASE_DATETIME_STRING "20090301 125126"
#endif #endif
/*- End of file ------------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/

View File

@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: version.h.in,v 1.2 2007/04/06 13:20:36 steveu Exp $ * $Id: version.h.in,v 1.3 2009/03/01 12:39:02 steveu Exp $
*/ */
#if !defined(_SPANDSP_VERSION_H_) #if !defined(_SPANDSP_VERSION_H_)
@ -30,8 +30,9 @@
/* The date and time of the version are in UTC form. */ /* The date and time of the version are in UTC form. */
#define SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_DATE #define SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_DATE
#define SPANDSP_RELEASE_TIME $SPANDSP_RELEASE_TIME #define SPANDSP_RELEASE_TIME $SPANDSP_RELEASE_TIME
#define SPANDSP_RELEASE_DATETIME_STRING "$SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_TIME"
#endif #endif
/*- End of file ------------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/

View File

@ -24,7 +24,7 @@
* License along with this program; if not, write to the Free Software * License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: t4.c,v 1.127 2009/02/21 04:27:46 steveu Exp $ * $Id: t4.c,v 1.128 2009/03/01 11:47:03 steveu Exp $
*/ */
/* /*
@ -86,6 +86,7 @@
#include "spandsp/bit_operations.h" #include "spandsp/bit_operations.h"
#include "spandsp/async.h" #include "spandsp/async.h"
#include "spandsp/t4.h" #include "spandsp/t4.h"
#include "spandsp/version.h"
#include "spandsp/private/logging.h" #include "spandsp/private/logging.h"
#include "spandsp/private/t4.h" #include "spandsp/private/t4.h"
@ -205,7 +206,7 @@ static int set_tiff_directory_info(t4_state_t *s)
TIFFSetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit); TIFFSetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit);
#endif #endif
/* TODO: add the version of spandsp */ /* TODO: add the version of spandsp */
TIFFSetField(t->tiff_file, TIFFTAG_SOFTWARE, "spandsp"); TIFFSetField(t->tiff_file, TIFFTAG_SOFTWARE, "Spandsp " SPANDSP_RELEASE_DATETIME_STRING);
if (gethostname(buf, sizeof(buf)) == 0) if (gethostname(buf, sizeof(buf)) == 0)
TIFFSetField(t->tiff_file, TIFFTAG_HOSTCOMPUTER, buf); TIFFSetField(t->tiff_file, TIFFTAG_HOSTCOMPUTER, buf);
@ -330,9 +331,11 @@ static int get_tiff_directory_info(t4_state_t *s)
if (t->photo_metric != PHOTOMETRIC_MINISWHITE) if (t->photo_metric != PHOTOMETRIC_MINISWHITE)
span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", s->file); span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", s->file);
t->fill_order = FILLORDER_LSB2MSB; t->fill_order = FILLORDER_LSB2MSB;
#if 0
TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &t->fill_order); TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &t->fill_order);
if (t->fill_order != FILLORDER_LSB2MSB) if (t->fill_order != FILLORDER_LSB2MSB)
span_log(&s->logging, SPAN_LOG_FLOW, "%s: Fill order needs swapping.\n", s->file); span_log(&s->logging, SPAN_LOG_FLOW, "%s: Fill order needs swapping.\n", s->file);
#endif
/* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the /* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the
precise value. The other value should be exact. */ precise value. The other value should be exact. */

View File

@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: generate_etsi_300_242_pages.c,v 1.3 2009/02/20 12:34:20 steveu Exp $ * $Id: generate_etsi_300_242_pages.c,v 1.4 2009/03/01 12:39:02 steveu Exp $
*/ */
/*! \file */ /*! \file */
@ -177,8 +177,8 @@ struct
}, },
}; };
int reverse_photo_metric = FALSE; int photo_metric = PHOTOMETRIC_MINISWHITE;
int reverse_fill_order = FALSE; int fill_order = FILLORDER_LSB2MSB;
static void clear_row(uint8_t buf[], int width) static void clear_row(uint8_t buf[], int width)
{ {
@ -256,13 +256,15 @@ static int create_stairstep_page(TIFF *tiff_file)
{ {
clear_row(image_buffer, 1728); clear_row(image_buffer, 1728);
set_pixel_range(image_buffer, 1, start_pixel, start_pixel + 63); set_pixel_range(image_buffer, 1, start_pixel, start_pixel + 63);
if (reverse_photo_metric) if (photo_metric != PHOTOMETRIC_MINISWHITE)
{ {
for (i = 0; i < 1728/8; i++) for (i = 0; i < 1728/8; i++)
image_buffer[i] = ~image_buffer[i]; image_buffer[i] = ~image_buffer[i];
} }
if (reverse_fill_order) #if 0
if (fill_order != FILLORDER_LSB2MSB)
bit_reverse(image_buffer, image_buffer, 1728/8); bit_reverse(image_buffer, image_buffer, 1728/8);
#endif
if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0)
{ {
printf("Write error at row %d.\n", row); printf("Write error at row %d.\n", row);
@ -558,6 +560,37 @@ int main(int argc, char *argv[])
float y_resolution; float y_resolution;
int i; int i;
int image_length; int image_length;
int opt;
int compression;
compression = T4_COMPRESSION_ITU_T6;
photo_metric = PHOTOMETRIC_MINISWHITE;
fill_order = FILLORDER_LSB2MSB;
while ((opt = getopt(argc, argv, "126ir")) != -1)
{
switch (opt)
{
case '1':
compression = T4_COMPRESSION_ITU_T4_1D;
break;
case '2':
compression = T4_COMPRESSION_ITU_T4_2D;
break;
case '6':
compression = T4_COMPRESSION_ITU_T6;
break;
case 'i':
photo_metric = PHOTOMETRIC_MINISBLACK;
break;
case 'r':
fill_order = FILLORDER_MSB2LSB;
break;
default:
//usage();
exit(2);
break;
}
}
tiff_file = NULL; tiff_file = NULL;
for (i = 0; sequence[i].name; i++) for (i = 0; sequence[i].name; i++)
@ -582,14 +615,8 @@ int main(int argc, char *argv[])
TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
if (reverse_photo_metric) TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric);
TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order);
else
TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
if (reverse_fill_order)
TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
else
TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
x_resolution = sequence[i].x_res/100.0f; x_resolution = sequence[i].x_res/100.0f;
y_resolution = sequence[i].y_res/100.0f; y_resolution = sequence[i].y_res/100.0f;
TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f)); TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f));

View File

@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: generate_sized_pages.c,v 1.2 2008/07/10 13:34:01 steveu Exp $ * $Id: generate_sized_pages.c,v 1.3 2009/03/01 12:39:02 steveu Exp $
*/ */
/*! \file */ /*! \file */
@ -289,6 +289,39 @@ int main(int argc, char *argv[])
float x_resolution; float x_resolution;
float y_resolution; float y_resolution;
int i; int i;
int opt;
int compression;
int photo_metric;
int fill_order;
compression = T4_COMPRESSION_ITU_T6;
photo_metric = PHOTOMETRIC_MINISWHITE;
fill_order = FILLORDER_LSB2MSB;
while ((opt = getopt(argc, argv, "126ir")) != -1)
{
switch (opt)
{
case '1':
compression = T4_COMPRESSION_ITU_T4_1D;
break;
case '2':
compression = T4_COMPRESSION_ITU_T4_2D;
break;
case '6':
compression = T4_COMPRESSION_ITU_T6;
break;
case 'i':
photo_metric = PHOTOMETRIC_MINISBLACK;
break;
case 'r':
fill_order = FILLORDER_MSB2LSB;
break;
default:
//usage();
exit(2);
break;
}
}
for (i = 0; sequence[i].name; i++) for (i = 0; sequence[i].name; i++)
{ {
@ -296,15 +329,15 @@ int main(int argc, char *argv[])
exit(2); exit(2);
/* Prepare the directory entry fully before writing the image, or libtiff complains */ /* Prepare the directory entry fully before writing the image, or libtiff complains */
TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, COMPRESSION_CCITT_T6); TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, compression);
TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, sequence[i].width); TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, sequence[i].width);
TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1);
TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric);
TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order);
x_resolution = sequence[i].x_res/100.0f; x_resolution = sequence[i].x_res/100.0f;
y_resolution = sequence[i].y_res/100.0f; y_resolution = sequence[i].y_res/100.0f;

View File

@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: t4_tests.c,v 1.67 2009/02/20 12:34:20 steveu Exp $ * $Id: t4_tests.c,v 1.68 2009/03/01 12:39:02 steveu Exp $
*/ */
/*! \file */ /*! \file */
@ -341,6 +341,17 @@ int main(int argc, char *argv[])
break; break;
} }
} }
else if (sscanf(buf, "%08x %02x %02x %02x", (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit) == 4)
{
for (i = 0; i < 16; i++)
{
if (sscanf(&buf[10 + 3*i], "%x", (unsigned int *) &bit) != 1)
break;
bit = bit_reverse8(bit);
if ((end_of_page = t4_rx_put_byte(&receive_state, bit)))
break;
}
}
else if (sscanf(buf, "Rx bit %*d - %d", &bit) == 1) else if (sscanf(buf, "Rx bit %*d - %d", &bit) == 1)
{ {
if ((end_of_page = t4_rx_put_bit(&receive_state, bit))) if ((end_of_page = t4_rx_put_bit(&receive_state, bit)))