on 00.1.27 6:27 AM, Stefan Bellon at [EMAIL PROTECTED] wrote:

> On StrongARM I tried REAL_IS_FLOAT, REAL_IS_LONG_DOUBLE and none of
> both. It didn't make any difference in the resulting encoding time.
> 
> Greetings,

On my Mac, just retype typedef doublt FLOAT8 to typedef float FLOAT8, it
became little (about 5%) slower.

I guess, the reason may be type missmatch with constans.

There is very few use of math.h functions in LAME, so I think I'm able to
write own fucntions, or replace table reffering.

On my test, sin() in MathLib with float is about 1.5 times slower than
following funtion. (Not same quality. my function is low precise.)
I have not tested with libmoto by Motorola.

FLOAT sin_F(FLOAT x)
{
    const static FLOAT p = 3.14159265358979f;
    const static FLOAT q = 1.0f / p;
    FLOAT x2, tx, s;
    int t;
    t = (x * q); /* floor() is very slow */
    x = x - (t * p); /* make range to -pi/2 < x < pi/2 */
    x2 = x * x;

    /* calculate sin(x)  */
    s = x;
    x *= x2; s += x * (FLOAT)-0.166667584f; /* prevent overflow +- 1.0 */
    x *= x2; s += x * (FLOAT) 0.0083333333333333332176851016015462000000f;
    x *= x2; s += x * (FLOAT)-0.0001984126984126984125263171154784900000f;
    x *= x2; s += x * (FLOAT) 0.0000027557319223985892510950593270458000f;

    if ( t & 1 ) s = -s;
    
    return s;
}

-- 
Osamu Shigematsu
mailto:[EMAIL PROTECTED]



--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to