changeset 6860:75aa9d6df9ac libavcodec

simplify init_pow2table
author michael
date Sat, 24 May 2008 22:28:33 +0000
parents 2df67a1a76b7
children 64998f9abdb6
files cook.c
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/cook.c	Sat May 24 22:23:16 2008 +0000
+++ b/cook.c	Sat May 24 22:28:33 2008 +0000
@@ -185,13 +185,9 @@
 /* table generator */
 static void init_pow2table(COOKContext *q){
     int i;
-    q->rootpow2tab[63] =
-    q->pow2tab[63] = 1.0;
-    for (i=1 ; i<64 ; i++){
-        q->pow2tab[63+i]=(float)((uint64_t)1<<i);
-        q->pow2tab[63-i]=1.0/(float)((uint64_t)1<<i);
-        q->rootpow2tab[63+i]=sqrt((float)((uint64_t)1<<i));
-        q->rootpow2tab[63-i]=sqrt(1.0/(float)((uint64_t)1<<i));
+    for (i=-63 ; i<64 ; i++){
+        q->    pow2tab[63+i]=     pow(2, i);
+        q->rootpow2tab[63+i]=sqrt(pow(2, i));
     }
 }