Mercurial > libavcodec.hg
comparison utils.c @ 6108:75804d49f33b libavcodec
improve CRC API
- don't export any global var
- provide either generated or hardcoded tables
| author | aurel |
|---|---|
| date | Fri, 04 Jan 2008 23:09:58 +0000 |
| parents | 3670c9e7ff4d |
| children | 4ba171d6d84a |
comparison
equal
deleted
inserted
replaced
| 6107:99e470e62bad | 6108:75804d49f33b |
|---|---|
| 1245 unsigned avcodec_build( void ) | 1245 unsigned avcodec_build( void ) |
| 1246 { | 1246 { |
| 1247 return LIBAVCODEC_BUILD; | 1247 return LIBAVCODEC_BUILD; |
| 1248 } | 1248 } |
| 1249 | 1249 |
| 1250 static void init_crcs(void){ | |
| 1251 #if LIBAVUTIL_VERSION_INT < (50<<16) | |
| 1252 av_crc04C11DB7= av_mallocz_static(sizeof(AVCRC) * 257); | |
| 1253 av_crc8005 = av_mallocz_static(sizeof(AVCRC) * 257); | |
| 1254 av_crc07 = av_mallocz_static(sizeof(AVCRC) * 257); | |
| 1255 #endif | |
| 1256 av_crc_init(av_crc04C11DB7, 0, 32, AV_CRC_32_IEEE, sizeof(AVCRC)*257); | |
| 1257 av_crc_init(av_crc8005 , 0, 16, AV_CRC_16 , sizeof(AVCRC)*257); | |
| 1258 av_crc_init(av_crc07 , 0, 8, AV_CRC_8_ATM , sizeof(AVCRC)*257); | |
| 1259 } | |
| 1260 | |
| 1261 void avcodec_init(void) | 1250 void avcodec_init(void) |
| 1262 { | 1251 { |
| 1263 static int inited = 0; | 1252 static int inited = 0; |
| 1264 | 1253 |
| 1265 if (inited != 0) | 1254 if (inited != 0) |
| 1266 return; | 1255 return; |
| 1267 inited = 1; | 1256 inited = 1; |
| 1268 | 1257 |
| 1269 dsputil_static_init(); | 1258 dsputil_static_init(); |
| 1270 init_crcs(); | |
| 1271 } | 1259 } |
| 1272 | 1260 |
| 1273 void avcodec_flush_buffers(AVCodecContext *avctx) | 1261 void avcodec_flush_buffers(AVCodecContext *avctx) |
| 1274 { | 1262 { |
| 1275 if(avctx->codec->flush) | 1263 if(avctx->codec->flush) |
