diff options
Diffstat (limited to 'src/libffmpeg/libavcodec/common.h')
-rw-r--r-- | src/libffmpeg/libavcodec/common.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libffmpeg/libavcodec/common.h b/src/libffmpeg/libavcodec/common.h index 8cc781edb..e887b9c62 100644 --- a/src/libffmpeg/libavcodec/common.h +++ b/src/libffmpeg/libavcodec/common.h @@ -909,6 +909,8 @@ static inline int clip(int a, int amin, int amax) } /* math */ +extern const UINT8 ff_sqrt_tab[128]; + int ff_gcd(int a, int b); static inline int ff_sqrt(int a) @@ -916,7 +918,9 @@ static inline int ff_sqrt(int a) int ret=0; int s; int ret_sq=0; - + + if(a<128) return ff_sqrt_tab[a]; + for(s=15; s>=0; s--){ int b= ret_sq + (1<<(s*2)) + (ret<<s)*2; if(b<=a){ |