[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec cook.c,1.8,1.9
Alexander Strasser beastd
al
Fri Feb 10 12:59:40 CET 2006
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv15379/libavcodec
Modified Files:
cook.c
Log Message:
Don't use pow/powf functions where we just need integer arithmetic.
approved by Benjamin
Index: cook.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/cook.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cook.c 6 Feb 2006 11:21:10 -0000 1.8
+++ cook.c 10 Feb 2006 11:59:38 -0000 1.9
@@ -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));
}
}
More information about the ffmpeg-cvslog
mailing list