Mercurial > libavcodec.hg
comparison cook.c @ 6860:75aa9d6df9ac libavcodec
simplify init_pow2table
author | michael |
---|---|
date | Sat, 24 May 2008 22:28:33 +0000 |
parents | 2df67a1a76b7 |
children | 64998f9abdb6 |
comparison
equal
deleted
inserted
replaced
6859:2df67a1a76b7 | 6860:75aa9d6df9ac |
---|---|
183 /*************** init functions ***************/ | 183 /*************** init functions ***************/ |
184 | 184 |
185 /* table generator */ | 185 /* table generator */ |
186 static void init_pow2table(COOKContext *q){ | 186 static void init_pow2table(COOKContext *q){ |
187 int i; | 187 int i; |
188 q->rootpow2tab[63] = | 188 for (i=-63 ; i<64 ; i++){ |
189 q->pow2tab[63] = 1.0; | 189 q-> pow2tab[63+i]= pow(2, i); |
190 for (i=1 ; i<64 ; i++){ | 190 q->rootpow2tab[63+i]=sqrt(pow(2, i)); |
191 q->pow2tab[63+i]=(float)((uint64_t)1<<i); | |
192 q->pow2tab[63-i]=1.0/(float)((uint64_t)1<<i); | |
193 q->rootpow2tab[63+i]=sqrt((float)((uint64_t)1<<i)); | |
194 q->rootpow2tab[63-i]=sqrt(1.0/(float)((uint64_t)1<<i)); | |
195 } | 191 } |
196 } | 192 } |
197 | 193 |
198 /* table generator */ | 194 /* table generator */ |
199 static void init_gain_table(COOKContext *q) { | 195 static void init_gain_table(COOKContext *q) { |