From: drowe67 Date: Fri, 1 Oct 2010 08:09:21 +0000 (+0000) Subject: alternative to assert in quantise.c, still need a way to get info on errors X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=22395b91dbdf5fd3ce44523836158001fb9eaaa0;p=freetel-svn-tracking.git alternative to assert in quantise.c, still need a way to get info on errors git-svn-id: https://svn.code.sf.net/p/freetel/code@198 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/src/c2sim.c b/codec2/src/c2sim.c index 1230425d..77219648 100644 --- a/codec2/src/c2sim.c +++ b/codec2/src/c2sim.c @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "\nCodec2 - 2400 bit/s speech codec - Simulation Program\n" "\thttp://rowetel.com/codec2.html\n\n" "usage: %s InputFile [-o OutputFile]\n" - "\t[-o lpc Order]\n" + "\t[--lpc Order]\n" "\t[--lsp]\n" "\t[--phase0]\n" "\t[--postfilter]\n" diff --git a/codec2/src/quantise.c b/codec2/src/quantise.c index e386bf89..3d1d9bf8 100644 --- a/codec2/src/quantise.c +++ b/codec2/src/quantise.c @@ -475,7 +475,17 @@ float speech_to_uq_lsps(float lsp[], E += ak[i]*R[i]; roots = lpc_to_lsp(ak, order, lsp, 5, LSP_DELTA1); - assert(roots == order); + if (roots != order) { + /* for some reason LSP roots could not be found */ + /* some alpha testers are reporting this condition */ + fprintf(stderr, "LSP roots not found!\nroots = %d\n", roots); + for(i=0; i<=order; i++) + fprintf(stderr, "a[%d] = %f\n", i, ak[i]); + + /* some benign LSP values we can use instead */ + for(i=0; i