diff options
author | Monty <xiphmont@xiph.org> | 2000-09-02 09:39:20 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2000-09-02 09:39:20 +0000 |
commit | 2f825f1071f91b1de021045b47df11568b6714a1 (patch) | |
tree | d1946d07f16fa9b76267d68eff8b93b810756532 | |
parent | cbc232c9744b39674fb48aef1c2362f4ea782291 (diff) | |
download | libvorbis-git-2f825f1071f91b1de021045b47df11568b6714a1.tar.gz |
back off cacm283 to double precision. Not time critical, and doubles
are needed for currently requested precision
Fix two typos in applying Segher's patch
svn path=/branches/branch_postbeta2/vorbis/; revision=617
-rw-r--r-- | lib/analysis.c | 6 | ||||
-rw-r--r-- | lib/lsp.c | 9 | ||||
-rw-r--r-- | lib/res0.c | 10 |
3 files changed, 14 insertions, 11 deletions
diff --git a/lib/analysis.c b/lib/analysis.c index 0179a7d4..09f69484 100644 --- a/lib/analysis.c +++ b/lib/analysis.c @@ -12,7 +12,7 @@ ******************************************************************** function: single-block PCM analysis mode dispatch - last mod: $Id: analysis.c,v 1.33.2.1 2000/08/31 08:59:59 xiphmont Exp $ + last mod: $Id: analysis.c,v 1.33.2.2 2000/09/02 09:39:19 xiphmont Exp $ ********************************************************************/ @@ -53,9 +53,9 @@ int vorbis_analysis(vorbis_block *vb,ogg_packet *op){ if(vb->W){ _oggpack_write(&vb->opb,vb->lW,1); _oggpack_write(&vb->opb,vb->nW,1); - /*fprintf(stderr,"*"); + fprintf(stderr,"*"); }else{ - fprintf(stderr,".");*/ + fprintf(stderr,"."); } if(_mapping_P[type]->forward(vb,vd->mode[mode])) @@ -12,7 +12,7 @@ ******************************************************************** function: LSP (also called LSF) conversion routines - last mod: $Id: lsp.c,v 1.9.2.2 2000/09/02 05:19:25 xiphmont Exp $ + last mod: $Id: lsp.c,v 1.9.2.3 2000/09/02 09:39:19 xiphmont Exp $ The LSP generation code is taken (with minimal modification) from "On the Computation of the LSP Frequencies" by Joseph Rothweiler @@ -76,10 +76,13 @@ static int comp(const void *a,const void *b){ } /* CACM algorithm 283. */ +/* we require doubles here due to the huge spread between val/p and + the required max error of 1.e-12, which is beyond the capabilities + of floats */ static void cacm283(float *a,int ord,float *r){ int i, k; - float val, p, delta, error; - float rooti; + double val, p, delta, error; + double rooti; for(i=0; i<ord;i++) r[i] = 2.0 * (i+0.5) / ord - 1.0; @@ -12,7 +12,7 @@ ******************************************************************** function: residue backend 0 implementation - last mod: $Id: res0.c,v 1.17.2.2 2000/09/02 05:19:25 xiphmont Exp $ + last mod: $Id: res0.c,v 1.17.2.3 2000/09/02 09:39:20 xiphmont Exp $ ********************************************************************/ @@ -229,13 +229,13 @@ static int _encodepart(oggpack_buffer *opb,float *vec, int n, static int _decodepart(oggpack_buffer *opb,float *work,float *vec, int n, int stages, codebook **books){ - int i,j; + int i; memset(work,0,sizeof(float)*n); - for(j=0;j<stages;j++){ - int dim=books[j]->dim; + for(i=0;i<stages;i++){ + int dim=books[i]->dim; int step=n/dim; - if(s_vorbis_book_decodevs(books[j],work+i,opb,step,0)==-1) + if(s_vorbis_book_decodevs(books[i],work,opb,step,0)==-1) return(-1); } |