diff options
author | Monty <xiphmont@xiph.org> | 2003-04-14 01:55:13 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2003-04-14 01:55:13 +0000 |
commit | 111d0a836c6a791e685b08ac44b0a637c382dc97 (patch) | |
tree | 3c9591547d37017811ac30c4f8909da79afe557a | |
parent | 17a83fe7417ea1d074fd2bed178bbc931b294d00 (diff) | |
download | tremor-111d0a836c6a791e685b08ac44b0a637c382dc97.tar.gz |
Low accuracy version of floor0.c fixed
git-svn-id: https://svn.xiph.org/branches/lowmem-branch/Tremor@4609 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r-- | floor0.c | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -141,7 +141,11 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln, int fdy=nyq-fbase*fdx; int map=0; +#ifdef _LOW_ACCURACY_ + ogg_uint32_t nextbark=((tBnyq1<<11)/ln)>>12; +#else ogg_uint32_t nextbark=MULT31(imap>>1,tBnyq1); +#endif int nextf=barklook[nextbark>>14]+(((nextbark&0x3fff)* (barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14); @@ -301,11 +305,22 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln, while(1){ map++; - nextbark=MULT31((map+1)*(imap>>1),tBnyq1); - nextf=barklook[nextbark>>14]+ - (((nextbark&0x3fff)* - (barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14); - if(f<=nextf)break; + if(map+1<ln){ + +#ifdef _LOW_ACCURACY_ + nextbark=((tBnyq1<<11)/ln*(map+1))>>12; +#else + nextbark=MULT31((map+1)*(imap>>1),tBnyq1); +#endif + nextf=barklook[nextbark>>14]+ + (((nextbark&0x3fff)* + (barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14); + if(f<=nextf)break; + + }else{ + nextf=9999999; + break; + } } if(map>=ln){ map=ln-1; /* guard against the approximation */ |