summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-12-29 17:50:25 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-12-29 17:50:25 +0000
commitcaa336b4cc1c946409decd6af964a44afb59c43a (patch)
tree71bf85effee9bc0e8d985f0dd3274f7d67f4c5f5 /libavcodec/utils.c
parent6143607303de40f4647fe9ba10c4b36909ba0f1f (diff)
common.c -> bitstream.c (and the single non bitstream func -> utils.c)
common.h -> common.h/bitstream.h Originally committed as revision 3777 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d87ed6e139..f11d22e590 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -31,6 +31,24 @@
#include <stdarg.h>
#include <limits.h>
+const uint8_t ff_sqrt_tab[128]={
+ 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
+};
+
+const uint8_t ff_log2_tab[256]={
+ 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
+};
+
void avcodec_default_free_buffers(AVCodecContext *s);
void *av_mallocz(unsigned int size)
@@ -881,6 +899,11 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c){
return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
}
+int64_t ff_gcd(int64_t a, int64_t b){
+ if(b) return ff_gcd(b, a%b);
+ else return a;
+}
+
/* av_log API */
static int av_log_level = AV_LOG_DEBUG;