mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
simplify
Originally committed as revision 8890 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
e300ab4ed2
commit
fd735e4b77
@ -190,14 +190,13 @@ static inline int ff_sqrt(int a)
|
|||||||
{
|
{
|
||||||
int ret=0;
|
int ret=0;
|
||||||
int s;
|
int s;
|
||||||
int ret_sq=0;
|
|
||||||
|
|
||||||
if(a<128) return ff_sqrt_tab[a];
|
if(a<128) return ff_sqrt_tab[a];
|
||||||
|
|
||||||
for(s=15; s>=0; s--){
|
for(s=15; s>=0; s--){
|
||||||
int b= ret_sq + (1<<(s*2)) + (ret<<s)*2;
|
int b= (1<<(s*2)) + (ret<<s)*2;
|
||||||
if(b<=a){
|
if(b<=a){
|
||||||
ret_sq=b;
|
a-=b;
|
||||||
ret+= 1<<s;
|
ret+= 1<<s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user