From b588ff353f96a6f36f741bba2a3fefd16d1c3afb Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sat, 5 Nov 2011 10:09:10 +0000 Subject: [PATCH] removed fprintf from run time LSP code, added all/low/high mode for LSP dT git-svn-id: https://svn.code.sf.net/p/freetel/code@300 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/c2sim.c | 9 +++++---- codec2-dev/src/quantise.c | 23 +++++++---------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/codec2-dev/src/c2sim.c b/codec2-dev/src/c2sim.c index 05443fb2..90d98434 100644 --- a/codec2-dev/src/c2sim.c +++ b/codec2-dev/src/c2sim.c @@ -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); diff --git a/codec2-dev/src/quantise.c b/codec2-dev/src/quantise.c index 59e3c144..e40a2de8 100644 --- a/codec2-dev/src/quantise.c +++ b/codec2-dev/src/quantise.c @@ -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