extend spare bit to 1600 bit/s
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 7 Mar 2013 06:28:20 +0000 (06:28 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 7 Mar 2013 06:28:20 +0000 (06:28 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1192 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/codec2.c

index 9a64c7e4c631d7866de2d6a804f029fe4082ca8a..380cf430b41819c48893a17851cb2991e77850e0 100644 (file)
@@ -1217,18 +1217,24 @@ void CODEC2_WIN32SUPPORT codec2_set_lpc_post_filter(struct CODEC2 *c2, int enabl
 
 /* 
    Allows optional stealing of one of the voicing bits for use as a
-   spare bit, only 1400 bit/s supported for now.  Experimental method
-   of sending voice/data frames for FreeDV.
+   spare bit, only 1400 & 1600 bit/s supported for now.  Experimental
+   method of sending voice/data frames for FreeDV.
 */
 
 int CODEC2_WIN32SUPPORT codec2_get_spare_bit_index(struct CODEC2 *c2)
 {
     assert(c2 != NULL);
 
-    if (c2->mode != CODEC2_MODE_1400)
-        return -1;
+    switch(c2->mode) {
+    case CODEC2_MODE_1400:
+        return 10; // bit 10 (11th bit) is v2 (third voicing bit)
+        break;
+    case CODEC2_MODE_1600:
+        return 15; // bit 15 (16th bit) is v2 (third voicing bit)
+        break;
+    }
     
-    return 10; // bit 10 (11th bit) is v2 (third voicing bit)
+    return -1;
 }
 
 /*