Mercurial > libavcodec.hg
comparison utils.c @ 2398:582e635cfa08 libavcodec
common.c -> bitstream.c (and the single non bitstream func -> utils.c)
common.h -> common.h/bitstream.h
author | michael |
---|---|
date | Wed, 29 Dec 2004 17:50:25 +0000 |
parents | 26560d4fdb1f |
children | 82af834636c2 |
comparison
equal
deleted
inserted
replaced
2397:a579ef4a4f4a | 2398:582e635cfa08 |
---|---|
28 #include "dsputil.h" | 28 #include "dsputil.h" |
29 #include "mpegvideo.h" | 29 #include "mpegvideo.h" |
30 #include "integer.h" | 30 #include "integer.h" |
31 #include <stdarg.h> | 31 #include <stdarg.h> |
32 #include <limits.h> | 32 #include <limits.h> |
33 | |
34 const uint8_t ff_sqrt_tab[128]={ | |
35 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, | |
36 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, | |
37 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, | |
38 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 | |
39 }; | |
40 | |
41 const uint8_t ff_log2_tab[256]={ | |
42 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, | |
43 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, | |
44 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, | |
45 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, | |
46 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, | |
47 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, | |
48 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, | |
49 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 | |
50 }; | |
33 | 51 |
34 void avcodec_default_free_buffers(AVCodecContext *s); | 52 void avcodec_default_free_buffers(AVCodecContext *s); |
35 | 53 |
36 void *av_mallocz(unsigned int size) | 54 void *av_mallocz(unsigned int size) |
37 { | 55 { |
879 | 897 |
880 int64_t av_rescale(int64_t a, int64_t b, int64_t c){ | 898 int64_t av_rescale(int64_t a, int64_t b, int64_t c){ |
881 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); | 899 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); |
882 } | 900 } |
883 | 901 |
902 int64_t ff_gcd(int64_t a, int64_t b){ | |
903 if(b) return ff_gcd(b, a%b); | |
904 else return a; | |
905 } | |
906 | |
884 /* av_log API */ | 907 /* av_log API */ |
885 | 908 |
886 static int av_log_level = AV_LOG_DEBUG; | 909 static int av_log_level = AV_LOG_DEBUG; |
887 | 910 |
888 static void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) | 911 static void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) |