removed fprintf from run time LSP code, added all/low/high mode for LSP dT
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 5 Nov 2011 10:09:10 +0000 (10:09 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 5 Nov 2011 10:09:10 +0000 (10:09 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@300 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/c2sim.c
codec2-dev/src/quantise.c

index 05443fb2cdd47dde8366cc315613655656bf0a0d..90d984346c6acdd5bc69fa6d5934206f54596077 100644 (file)
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
   float Sn_[2*N];      /* synthesised speech */
   int   i;             /* loop variable                         */
   int   frames;
-  float prev_Wo;
+  float prev_Wo, prev__Wo;
   float pitch;
   int   voiced1 = 0;
 
@@ -397,9 +397,9 @@ int main(int argc, char *argv[])
 
        /* 
           When decimation is enabled we only send LSPs to the decoder
-          on odd frames.  In this case we encode every second off
-          frame (i.e. every 3rd frame) by quantising the difference
-          between the 1st frames LSPs and this frames:
+          on odd frames.  In the Delta-time LSPs case we encode every
+          second odd frame (i.e. every 3rd frame) by quantising the
+          difference between the 1st frames LSPs and this frames:
 
           10ms, frame 1: send "full" LSP frame
           20ms, frame 2: discard (interpolate at decoder)
@@ -518,6 +518,7 @@ int main(int argc, char *argv[])
        if (fout != NULL) fwrite(buf,sizeof(short),N,fout);
     }
     prev_Wo = TWO_PI/pitch;
+    prev__Wo = Wo;
   }
   fclose(fin);
 
index 59e3c1446e37ed88306f86e9e1b4bc7a2bb85d39..e40a2de83fd504b5dd69bf0ba8965e949c5b56ef 100644 (file)
@@ -788,15 +788,10 @@ void bw_expand_lsps(float lsp[],
 {
     int i;
 
-    for(i=1; i<5; i++) {
-       
-       /*
-         if (lsp[i] - lsp[i-1] < PI*(12.5/4000.0))
-           lsp[i] = lsp[i-1] + PI*(12.5/4000.0);
-       */
+    for(i=1; i<4; i++) {
        
-       if ((lsp[i] - lsp[i-1]) < 12.5*(PI/4000))
-           lsp[i] = lsp[i-1] + 12.5*(PI/4000.0);
+       if ((lsp[i] - lsp[i-1]) < 25*(PI/4000.0))
+           lsp[i] = lsp[i-1] + 50.0*(PI/4000.0);
        
     }
 
@@ -805,13 +800,9 @@ void bw_expand_lsps(float lsp[],
        different quanstisers.
     */
 
-    for(i=5; i<8; i++) {
-       if (lsp[i] - lsp[i-1] < PI*(25.0/4000.0))
-           lsp[i] = lsp[i-1] + PI*(25.0/4000.0);
-    }
-    for(i=8; i<order; i++) {
-       if (lsp[i] - lsp[i-1] < PI*(75.0/4000.0))
-           lsp[i] = lsp[i-1] + PI*(75.0/4000.0);
+    for(i=4; i<order; i++) {
+       if (lsp[i] - lsp[i-1] < PI*(50.0/4000.0))
+           lsp[i] = lsp[i-1] + PI*(100.0/4000.0);
     }
 }
 
@@ -937,7 +928,7 @@ int encode_energy(float e)
   AUTHOR......: David Rowe                           
   DATE CREATED: 22/8/2010 
 
-  Decodes energy using a WO_BITS quantiser.
+  Decodes energy using a E_LEVELS quantiser.
 
 \*---------------------------------------------------------------------------*/