]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
More tweaks to spandsp
authorSteve Underwood <steveu@x100e.coppice.org>
Tue, 23 Jul 2013 17:38:07 +0000 (01:38 +0800)
committerSteve Underwood <steveu@x100e.coppice.org>
Tue, 23 Jul 2013 17:38:07 +0000 (01:38 +0800)
libs/spandsp/src/fsk.c
libs/spandsp/src/spandsp/t4_t6_encode.h
libs/spandsp/src/spandsp/v18.h
libs/spandsp/src/t4_t6_encode.c

index 56f155169e74c873cce673aef144bc43ed9ac36c..2c1d326d843145a83b94a43df7b54fcb4cf3b942 100644 (file)
@@ -69,6 +69,7 @@ const fsk_spec_t preset_fsk_specs[] =
         300*100
     },
     {
+        /* This is mode 2 of the V.23 spec. Mode 1 (the 600baud mode) is not defined here */
         "V23 ch 1",
         1700 + 400,
         1700 - 400,
@@ -124,6 +125,14 @@ const fsk_spec_t preset_fsk_specs[] =
         -30,
          50*100
     },
+    {
+        "Weitbrecht 47.6",  /* Used for V.18 probing */
+        1600 + 200,
+        1600 - 200,
+        -14,
+        -30,
+         4760
+    },
     {
         "V21 (110bps) ch 1",
         1080 + 100,
index a157b444b9a34d0c28a6535ffd8f4a903e564fac..81c6ddb3e4ce0f4eabea01b22a60fb1bc5cf0cbe 100644 (file)
@@ -77,6 +77,12 @@ SPAN_DECLARE(int) t4_t6_encode_set_encoding(t4_t6_encode_state_t *s, int encodin
     \return 0 for success, otherwise -1. */
 SPAN_DECLARE(int) t4_t6_encode_set_image_width(t4_t6_encode_state_t *s, int image_width);
 
+/*! \brief Set the length of the image.
+    \param s The T.4/T.6 context.
+    \param image_length The image length, in pixels.
+    \return 0 for success, otherwise -1. */
+SPAN_DECLARE(int) t4_t6_encode_set_image_length(t4_t6_encode_state_t *s, int image_length);
+
 /*! \brief Get the width of the image.
     \param s The T.4/T.6 context.
     \return The width of the image, in pixels. */
index 970d2a3f22b46553780f89d9d056ea5ee8334e7f..32814d9c658f285d4707ee1790261a6afe8e29ab 100644 (file)
@@ -38,24 +38,25 @@ typedef struct v18_state_s v18_state_t;
 
 enum
 {
-    V18_MODE_NONE = 0,
+    V18_MODE_NONE = 0x0001,
     /* V.18 Annex A - Weitbrecht TDD at 45.45bps (US TTY), half-duplex, 5 bit baudot (USA). */
-    V18_MODE_5BIT_4545 = 1,
+    V18_MODE_5BIT_4545 = 0x0002,
     /* V.18 Annex A - Weitbrecht TDD at 50bps (International TTY), half-duplex, 5 bit baudot (UK, Australia and others). */
-    V18_MODE_5BIT_50 = 2,
+    V18_MODE_5BIT_50 = 0x0004,
     /* V.18 Annex B - DTMF encoding of ASCII (Denmark, Holland and others). */
-    V18_MODE_DTMF = 3,
+    V18_MODE_DTMF = 0x0008,
     /* V.18 Annex C - EDT (European Deaf Telephone) 110bps, V.21, half-duplex, ASCII (Germany, Austria, Switzerland and others). */
-    V18_MODE_EDT = 4,
+    V18_MODE_EDT = 0x0010,
     /* V.18 Annex D - 300bps, Bell 103, duplex, ASCII (USA). */
-    V18_MODE_BELL103 = 5,
+    V18_MODE_BELL103 = 0x0020,
     /* V.18 Annex E - 1200bps Videotex terminals, ASCII (France). */
-    V18_MODE_V23VIDEOTEX = 6,
+    V18_MODE_V23VIDEOTEX = 0x0040,
     /* V.18 Annex F - V.21 text telephone, V.21, duplex, ASCII (Sweden, Norway and Finland). */
-    V18_MODE_V21TEXTPHONE = 7,
+    V18_MODE_V21TEXTPHONE = 0x0080,
     /* V.18 Annex G - V.18 text telephone mode. */
-    V18_MODE_V18TEXTPHONE = 8,
-    V18_MODE_5BIT_476 = 9,
+    V18_MODE_V18TEXTPHONE = 0x0100,
+    /* V.18 Annex A - Used during probing. */
+    V18_MODE_5BIT_476 = 0x0200,
     /* Use repetitive shift characters where character set shifts are used */ 
     V18_MODE_REPETITIVE_SHIFTS_OPTION = 0x1000
 };
index ddb8b33a064360f60bc7c99ea6882a7c86d049e6..4ed063e063cbf60e6c94477884218498cc92b68b 100644 (file)
@@ -1040,6 +1040,12 @@ SPAN_DECLARE(int) t4_t6_encode_set_image_width(t4_t6_encode_state_t *s, int imag
 }
 /*- End of function --------------------------------------------------------*/
 
+SPAN_DECLARE(int) t4_t6_encode_set_image_length(t4_t6_encode_state_t *s, int image_length)
+{
+    return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
 SPAN_DECLARE(uint32_t) t4_t6_encode_get_image_width(t4_t6_encode_state_t *s)
 {
     return s->image_width;