changeset 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 2d35fb3cb940
children 5d068956513b
files cook.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
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));
     }
 }