[Freeswitch-svn] [commit] r12352 - in freeswitch/trunk/libs/spandsp: src src/spandsp test-data/etsi/fax test-data/itu/fax tests

FreeSWITCH SVN mikej at freeswitch.org
Mon Mar 2 08:24:30 PST 2009


Author: mikej
Date: Mon Mar  2 10:24:30 2009
New Revision: 12352

Log:
update to snapshot spandsp-20090301

Modified:
   freeswitch/trunk/libs/spandsp/src/Makefile.am
   freeswitch/trunk/libs/spandsp/src/spandsp/bit_operations.h
   freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h
   freeswitch/trunk/libs/spandsp/src/spandsp/version.h
   freeswitch/trunk/libs/spandsp/src/spandsp/version.h.in
   freeswitch/trunk/libs/spandsp/src/t4.c
   freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c
   freeswitch/trunk/libs/spandsp/test-data/itu/fax/generate_sized_pages.c
   freeswitch/trunk/libs/spandsp/tests/t4_tests.c

Modified: freeswitch/trunk/libs/spandsp/src/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/Makefile.am	(original)
+++ freeswitch/trunk/libs/spandsp/src/Makefile.am	Mon Mar  2 10:24:30 2009
@@ -16,7 +16,7 @@
 ## License along with this program; if not, write to the Free Software
 ## 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_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
@@ -293,6 +293,10 @@
 at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT)
 	./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.lo: v17rx_fixed_rrc.h v17rx_floating_rrc.h

Modified: freeswitch/trunk/libs/spandsp/src/spandsp/bit_operations.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/bit_operations.h	(original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/bit_operations.h	Mon Mar  2 10:24:30 2009
@@ -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.
  *
- * $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 */

Modified: freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h	(original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/fast_convert.h	Mon Mar  2 10:24:30 2009
@@ -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.
  *
- * $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_)

Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/version.h	(original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h	Mon Mar  2 10:24:30 2009
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * 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_)
@@ -30,8 +30,9 @@
 
 /* The date and time of the version are in UTC form. */
 
-#define SPANDSP_RELEASE_DATE    20090226
-#define SPANDSP_RELEASE_TIME    121601
+#define SPANDSP_RELEASE_DATE            20090301
+#define SPANDSP_RELEASE_TIME            125126
+#define SPANDSP_RELEASE_DATETIME_STRING "20090301 125126"
 
 #endif
 /*- End of file ------------------------------------------------------------*/

Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h.in
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/version.h.in	(original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h.in	Mon Mar  2 10:24:30 2009
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * 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_)
@@ -30,8 +30,9 @@
 
 /* The date and time of the version are in UTC form. */
 
-#define SPANDSP_RELEASE_DATE    $SPANDSP_RELEASE_DATE
-#define SPANDSP_RELEASE_TIME    $SPANDSP_RELEASE_TIME
+#define SPANDSP_RELEASE_DATE            $SPANDSP_RELEASE_DATE
+#define SPANDSP_RELEASE_TIME            $SPANDSP_RELEASE_TIME
+#define SPANDSP_RELEASE_DATETIME_STRING "$SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_TIME"
 
 #endif
 /*- End of file ------------------------------------------------------------*/

Modified: freeswitch/trunk/libs/spandsp/src/t4.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t4.c	(original)
+++ freeswitch/trunk/libs/spandsp/src/t4.c	Mon Mar  2 10:24:30 2009
@@ -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.
  *
- * $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/async.h"
 #include "spandsp/t4.h"
+#include "spandsp/version.h"
 
 #include "spandsp/private/logging.h"
 #include "spandsp/private/t4.h"
@@ -205,7 +206,7 @@
     TIFFSetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit);
 #endif
     /* 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)
         TIFFSetField(t->tiff_file, TIFFTAG_HOSTCOMPUTER, buf);
 
@@ -330,9 +331,11 @@
     if (t->photo_metric != PHOTOMETRIC_MINISWHITE)
         span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", s->file);
     t->fill_order = FILLORDER_LSB2MSB;
+#if 0
     TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &t->fill_order);
     if (t->fill_order != FILLORDER_LSB2MSB)
         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
        precise value. The other value should be exact. */

Modified: freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c	(original)
+++ freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c	Mon Mar  2 10:24:30 2009
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * 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 */
@@ -177,8 +177,8 @@
     },
 };
 
-int reverse_photo_metric = FALSE;
-int reverse_fill_order = FALSE;
+int photo_metric = PHOTOMETRIC_MINISWHITE;
+int fill_order = FILLORDER_LSB2MSB;
 
 static void clear_row(uint8_t buf[], int width)
 {
@@ -256,13 +256,15 @@
     {
         clear_row(image_buffer, 1728);
         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++)
                 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);
+#endif
         if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0)
         {
             printf("Write error at row %d.\n", row);
@@ -558,6 +560,37 @@
     float y_resolution;
     int i;
     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;
     for (i = 0;  sequence[i].name;  i++)
@@ -582,14 +615,8 @@
         TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
         TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
         TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-        if (reverse_photo_metric)
-            TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
-        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);
+        TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric);
+        TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order);
         x_resolution = sequence[i].x_res/100.0f;
         y_resolution = sequence[i].y_res/100.0f;
         TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f));

Modified: freeswitch/trunk/libs/spandsp/test-data/itu/fax/generate_sized_pages.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/test-data/itu/fax/generate_sized_pages.c	(original)
+++ freeswitch/trunk/libs/spandsp/test-data/itu/fax/generate_sized_pages.c	Mon Mar  2 10:24:30 2009
@@ -23,7 +23,7 @@
  * along with this program; if not, write to the Free Software
  * 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 */
@@ -289,6 +289,39 @@
     float x_resolution;
     float y_resolution;
     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++)
     {
@@ -296,15 +329,15 @@
             exit(2);
 
         /* 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_BITSPERSAMPLE, 1);
         TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
         TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
         TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
         TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-        TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
-        TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
+        TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric);
+        TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order);
     
         x_resolution = sequence[i].x_res/100.0f;
         y_resolution = sequence[i].y_res/100.0f;

Modified: freeswitch/trunk/libs/spandsp/tests/t4_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t4_tests.c	(original)
+++ freeswitch/trunk/libs/spandsp/tests/t4_tests.c	Mon Mar  2 10:24:30 2009
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * 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 */
@@ -341,6 +341,17 @@
                         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)
             {
                 if ((end_of_page = t4_rx_put_bit(&receive_state, bit)))



More information about the Freeswitch-svn mailing list