This website works better with JavaScript.
Home
Help
Sign In
falkTX
/
FFmpeg
mirror of
https://github.com/falkTX/FFmpeg.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
338
Wiki
Activity
Browse Source
reduce number of shifts
Originally committed as revision 8891 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer
18 years ago
parent
fd735e4b77
commit
45221f7f61
1 changed files
with
5 additions
and
4 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+5
-4
libavutil/internal.h
+ 5
- 4
libavutil/internal.h
View File
@@ -189,15 +189,16 @@ extern const uint8_t ff_sqrt_tab[128];
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<<s)*2;
for(s=30; s>=0; s-=2){
ret+=ret;
b= (1+2*ret)<<s;
if(b<=a){
a-=b;
ret+
= 1<<s
;
ret+
+
;
}
}
return ret;
Write
Preview
Loading…
Cancel
Save