Mercurial > libavcodec.hg
comparison utils.c @ 3169:53f0b29ff865 libavcodec
generic crc calculation code
author | michael |
---|---|
date | Mon, 06 Mar 2006 14:13:01 +0000 |
parents | e1157712c1d5 |
children | 1475eb5f8649 |
comparison
equal
deleted
inserted
replaced
3168:1deaaa111fbc | 3169:53f0b29ff865 |
---|---|
27 #include "avcodec.h" | 27 #include "avcodec.h" |
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 "opt.h" | 31 #include "opt.h" |
32 #include "crc.h" | |
32 #include <stdarg.h> | 33 #include <stdarg.h> |
33 #include <limits.h> | 34 #include <limits.h> |
34 #include <float.h> | 35 #include <float.h> |
35 | 36 |
36 const uint8_t ff_reverse[256]={ | 37 const uint8_t ff_reverse[256]={ |
1216 unsigned avcodec_build( void ) | 1217 unsigned avcodec_build( void ) |
1217 { | 1218 { |
1218 return LIBAVCODEC_BUILD; | 1219 return LIBAVCODEC_BUILD; |
1219 } | 1220 } |
1220 | 1221 |
1222 static void init_crcs(void){ | |
1223 av_crc04C11DB7= av_mallocz_static(sizeof(AVCRC) * 257); | |
1224 av_crc_init(av_crc04C11DB7, 0, 32, 0x04c11db7, sizeof(AVCRC)*257); | |
1225 } | |
1226 | |
1221 /* must be called before any other functions */ | 1227 /* must be called before any other functions */ |
1222 void avcodec_init(void) | 1228 void avcodec_init(void) |
1223 { | 1229 { |
1224 static int inited = 0; | 1230 static int inited = 0; |
1225 | 1231 |
1226 if (inited != 0) | 1232 if (inited != 0) |
1227 return; | 1233 return; |
1228 inited = 1; | 1234 inited = 1; |
1229 | 1235 |
1230 dsputil_static_init(); | 1236 dsputil_static_init(); |
1237 init_crcs(); | |
1231 } | 1238 } |
1232 | 1239 |
1233 /** | 1240 /** |
1234 * Flush buffers, should be called when seeking or when swicthing to a different stream. | 1241 * Flush buffers, should be called when seeking or when swicthing to a different stream. |
1235 */ | 1242 */ |