diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-07-08 20:23:19 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-07-08 20:23:19 +0000 |
commit | a08d38ee82e86bf17090eb65050b823366dde718 (patch) | |
tree | 505cec9c8be86438a795d98152548ce3a64f319b | |
parent | a29ff6b76b6f5848969916bc827876529413d01d (diff) | |
download | ffmpeg-a08d38ee82e86bf17090eb65050b823366dde718.tar.gz |
put the code which is specific for the large crc table under #ifndef CONFIG_SMALL
Originally committed as revision 5676 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavutil/crc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/crc.c b/libavutil/crc.c index 430d8f594d..13be2020d3 100644 --- a/libavutil/crc.c +++ b/libavutil/crc.c @@ -33,10 +33,12 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ } } ctx[256]=1; +#ifndef CONFIG_SMALL if(ctx_size >= sizeof(AVCRC)*1024) for (i = 0; i < 256; i++) for(j=0; j<3; j++) ctx[256*(j+1) + i]= (ctx[256*j + i]>>8) ^ ctx[ ctx[256*j + i]&0xFF ]; +#endif return 0; } @@ -44,6 +46,7 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length){ const uint8_t *end= buffer+length; +#ifndef CONFIG_SMALL if(!ctx[256]) while(buffer<end-3){ crc ^= le2me_32(*(uint32_t*)buffer); buffer+=4; @@ -52,6 +55,7 @@ uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t le ^ctx[1*256 + ((crc>>16)&0xFF)] ^ctx[0*256 + ((crc>>24) )]; } +#endif while(buffer<end) crc = ctx[((uint8_t)crc) ^ *buffer++] ^ (crc >> 8); |