Revision a08d38ee
libavutil/crc.c | ||
---|---|---|
33 | 33 |
} |
34 | 34 |
} |
35 | 35 |
ctx[256]=1; |
36 |
#ifndef CONFIG_SMALL |
|
36 | 37 |
if(ctx_size >= sizeof(AVCRC)*1024) |
37 | 38 |
for (i = 0; i < 256; i++) |
38 | 39 |
for(j=0; j<3; j++) |
39 | 40 |
ctx[256*(j+1) + i]= (ctx[256*j + i]>>8) ^ ctx[ ctx[256*j + i]&0xFF ]; |
41 |
#endif |
|
40 | 42 |
|
41 | 43 |
return 0; |
42 | 44 |
} |
... | ... | |
44 | 46 |
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length){ |
45 | 47 |
const uint8_t *end= buffer+length; |
46 | 48 |
|
49 |
#ifndef CONFIG_SMALL |
|
47 | 50 |
if(!ctx[256]) |
48 | 51 |
while(buffer<end-3){ |
49 | 52 |
crc ^= le2me_32(*(uint32_t*)buffer); buffer+=4; |
... | ... | |
52 | 55 |
^ctx[1*256 + ((crc>>16)&0xFF)] |
53 | 56 |
^ctx[0*256 + ((crc>>24) )]; |
54 | 57 |
} |
58 |
#endif |
|
55 | 59 |
while(buffer<end) |
56 | 60 |
crc = ctx[((uint8_t)crc) ^ *buffer++] ^ (crc >> 8); |
57 | 61 |
|
Also available in: Unified diff