# HG changeset patch # User michael # Date 1178318156 0 # Node ID d4ccc9609aa926f69975782cdeb9d34406d191c3 # Parent 893380ba2425631ea601e552438ef3ae4818ab10 reduce number of shifts diff -r 893380ba2425 -r d4ccc9609aa9 internal.h --- a/internal.h Fri May 04 21:22:43 2007 +0000 +++ b/internal.h Fri May 04 22:35:56 2007 +0000 @@ -189,15 +189,16 @@ static inline int ff_sqrt(int a) { int ret=0; - int s; + int s, b; if(a<128) return ff_sqrt_tab[a]; - for(s=15; s>=0; s--){ - int b= (1<<(s*2)) + (ret<=0; s-=2){ + ret+=ret; + b= (1+2*ret)<