Annotation of multiplexer/crc32.h, revision 1.2
1.1 oskar 1: /*
2: * cyclic redundancy check 32 bit
3: * Copyright (C) 1999 Christian Wolff, 2004 Oskar Schirmer
4: * for Convergence Integrated Media GmbH (http://www.convergence.de)
5: *
6: * This program is free software; you can redistribute it and/or modify
7: * it under the terms of the GNU General Public License as published by
8: * the Free Software Foundation; either version 2 of the License, or
9: * (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20:
21: #define MSBFCOEFF(x) | (1UL << x)
22:
23: #define POLYNOMIAL_32_MSBF 0 \
24: MSBFCOEFF(0) \
25: MSBFCOEFF(1) \
26: MSBFCOEFF(2) \
27: MSBFCOEFF(4) \
28: MSBFCOEFF(5) \
29: MSBFCOEFF(7) \
30: MSBFCOEFF(8) \
31: MSBFCOEFF(10) \
32: MSBFCOEFF(11) \
33: MSBFCOEFF(12) \
34: MSBFCOEFF(16) \
35: MSBFCOEFF(22) \
36: MSBFCOEFF(23) \
37: MSBFCOEFF(26)
38:
1.2 ! oskar 39: #define CRC_INIT_32 ((uint32_t)(-1))
1.1 oskar 40:
41: #define update_crc_32(crc, data) \
42: ((crc << 8) ^ crc_32_table[((int)(crc >> 24) ^ (data)) & 0xFF])
43:
1.2 ! oskar 44: extern uint32_t crc_32_table[256];
1.1 oskar 45:
46: extern void gen_crc32_table();
47:
1.2 ! oskar 48: extern uint32_t update_crc_32_block(uint32_t crc, char *data_block_ptr, int data_block_size);
1.1 oskar 49:
50: extern void crc32_calc (char *data,
51: int size,
52: char *crc);
53:
LinuxTV legacy CVS <linuxtv.org/cvs>