aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cook.c
diff options
context:
space:
mode:
authorAlexander Strasser <eclipse7@gmx.net>2006-02-10 11:59:38 +0000
committerAlexander Strasser <eclipse7@gmx.net>2006-02-10 11:59:38 +0000
commit5c4b1b253848eaf098301c67ba426d326579bb68 (patch)
tree3761dc32b2c6af69293bf25978ebc619c5deaffc /libavcodec/cook.c
parent0a925109ec341dea5fc51e54a2a9c13aa6f28154 (diff)
downloadffmpeg-5c4b1b253848eaf098301c67ba426d326579bb68.tar.gz
Don't use pow/powf functions where we just need integer arithmetic.
approved by Benjamin Originally committed as revision 4973 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 4140be1538..07368ca476 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -185,8 +185,8 @@ static void init_pow2table(COOKContext *q){
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 @@ static void init_rootpow2table(COOKContext *q){
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));
}
}