Index: layer3.c =================================================================== RCS file: /projects/clientdist/trigenix/implementation/mpg123/layer3.c,v retrieving revision 1.1 retrieving revision 1.3 diff -r1.1 -r1.3 109a110,113 > #ifdef REAL_IS_FIXED > double tmparray[8207]; > double twotothequarter = pow((double)2.0, (double)0.25); > double current; 110a115,123 > /* Possibly a few too many multiplies - single bit errors will > * propagate. It may change the gradient of the (log) power curve > * slighty */ > current = pow((double)2.0, (double)(0.25 * 47)); > for(i=-256;i<118+4;i++) { > current = current / twotothequarter; > gainpow2[i+256] = DOUBLE_TO_REAL(current); > } > #else 112c125,127 < gainpow2[i+256] = DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210) )); --- > gainpow2[i+256] = DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210) )); > #endif > 113a129,151 > #ifdef REAL_IS_FIXED > for(i=0;i<8207;i++) > tmparray[i] = 0.0; > tmparray[1] = 1.0; > for(i=2;i<8207;i++) { > if(!tmparray[i]) { > tmparray[i] = pow((double)i,(double)(4.0/3.0)); > for(j = 2; (j <= i) && ((i * j) < 8207); j++) { > /* Degradation due to lots of multiplies: A double has > * 52 bits of mantissa. A long has 32 bits (on the IPaq). > * Hence we can create 20 bits of error without fussing. > * Assuming that a 1 bit error multiplies to 2 bits, then 4, > * then 8, and noting that 2^13 is 8196 (we go up to 8207), > * we may have a problem. Resolve this by limiting to 4 > * multiplies before recalculating. */ > for(k = i, l = 0; (k * j) <= 8207 && (l < 4); k *= j, l++) { > tmparray[k * j] = tmparray[k] * tmparray[j]; > } > } > } > ispow[i] = DOUBLE_TO_REAL(tmparray[i]); > } > #else 116c154,155 < --- > #endif >