Mercurial > libavcodec.hg
diff cook.c @ 3106:9cbd63cca826 libavcodec
Don't use pow/powf functions where we just need integer arithmetic.
approved by Benjamin
| author | al |
|---|---|
| date | Fri, 10 Feb 2006 11:59:38 +0000 |
| parents | 0284d5b34916 |
| children | 68721b62a528 |
line wrap: on
line diff
--- a/cook.c Fri Feb 10 06:55:25 2006 +0000 +++ b/cook.c Fri Feb 10 11:59:38 2006 +0000 @@ -185,8 +185,8 @@ int i; q->pow2tab[63] = 1.0; for (i=1 ; i<64 ; i++){ - q->pow2tab[63+i]=(float)pow(2.0,(double)i); - q->pow2tab[63-i]=1.0/(float)pow(2.0,(double)i); + q->pow2tab[63+i]=(float)((uint64_t)1<<i); + q->pow2tab[63-i]=1.0/(float)((uint64_t)1<<i); } } @@ -195,8 +195,8 @@ int i; q->rootpow2tab[63] = 1.0; for (i=1 ; i<64 ; i++){ - q->rootpow2tab[63+i]=sqrt((float)powf(2.0,(float)i)); - q->rootpow2tab[63-i]=sqrt(1.0/(float)powf(2.0,(float)i)); + q->rootpow2tab[63+i]=sqrt((float)((uint64_t)1<<i)); + q->rootpow2tab[63-i]=sqrt(1.0/(float)((uint64_t)1<<i)); } }
