comparison mpegtsenc.c @ 2893:c31c50af40c5 libavformat

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 d52c718e83f9
children 6f61c3b36632
comparison
equal deleted inserted replaced
2892:0d82fdf4fa94 2893:c31c50af40c5
41 unsigned char packet[TS_PACKET_SIZE]; 41 unsigned char packet[TS_PACKET_SIZE];
42 const unsigned char *buf_ptr; 42 const unsigned char *buf_ptr;
43 unsigned char *q; 43 unsigned char *q;
44 int first, b, len1, left; 44 int first, b, len1, left;
45 45
46 crc = bswap_32(av_crc(av_crc04C11DB7, -1, buf, len - 4)); 46 crc = bswap_32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, buf, len - 4));
47 buf[len - 4] = (crc >> 24) & 0xff; 47 buf[len - 4] = (crc >> 24) & 0xff;
48 buf[len - 3] = (crc >> 16) & 0xff; 48 buf[len - 3] = (crc >> 16) & 0xff;
49 buf[len - 2] = (crc >> 8) & 0xff; 49 buf[len - 2] = (crc >> 8) & 0xff;
50 buf[len - 1] = (crc) & 0xff; 50 buf[len - 1] = (crc) & 0xff;
51 51