Commit 675da3e8 authored by Monty Montgomery's avatar Monty Montgomery
Browse files

Commit a fix to a bug whose meme stretches back to an arithmetic error

Segher made in a Vorbis optimization years ago.... the error wasn't
backed out of Vorbis because we tuned around it (in the end making no
difference), and removing the bug would undo the tuning.
Unfortunately, other code that borrowed the todB and fromdB
approximations that use IEEE754 float32 bitpatterns borrowed the bug
as well.  This fixes the offset value in fromdB_a and todB_a.

git-svn-id: 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent a839f47f
......@@ -356,7 +356,6 @@ static void under_compand(float *x,float zerocorner,
static void multicompand_work(void *vs){
multicompand_state *ms=(multicompand_state *)vs;
subband_state *ss=&ms->ss;
int i,j,k,bypass_visible=1;
......@@ -61,11 +61,11 @@ static inline float fromdB(float x){
static inline float todB_a(const float *x){
return (float)((*(int32_t *)x)&0x7fffffff) * 7.1771144e-7f -764.27118f;
return (float)((*(int32_t *)x)&0x7fffffff) * 7.17711438e-7f -764.6161886f;
static inline float fromdB_a(float x){
int y=1.3933e+06f*(x+764.27118f);
int y=1.39331762961e+06f*(x+764.6161886f);
return *(float *)&y;
#define VERSION "$Id$ "
/* DO NOT EDIT: Automated versioning hack [Thu Apr 22 07:19:26 EDT 2004] */
/* DO NOT EDIT: Automated versioning hack [Thu Apr 22 07:48:59 EDT 2004] */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment