CRC alogrithism for AC3, What's the difference between generic CRC and ac3's |
![]() ![]() |
CRC alogrithism for AC3, What's the difference between generic CRC and ac3's |
Nov 16 2011, 03:55
Post
#1
|
|
|
Group: Members Posts: 1 Joined: 16-November 11 Member No.: 95197 |
Hi all
I want to unstandard how ac3's CRC work, because it seems the CRC for AC3 is different from the generic one. AC3 use X^16+X^15+X^2+1 as its poly (0x8005) the generic alogrithism is: unsigned short syndrom=0; for(i=0;i<words; i++){ syndrom = ((syndrom << 8) & 0xff00) ^ crctab[((syndrom>>8)&0xff)^( (data[i]>>8)&0xff) ]; syndrom = ((syndrom << 8) & 0xff00) ^ crctab[((syndrom>>8)&0xff)^( (data[i])&0xff) ]; } for ac3: unsigned short syndrom=0; for(i=0;i<words; i++){ syndrom = ((syndrom << 8) & 0xff00) ^ ((data[i]>>8)&0xff) ^ crctab[(syndrom>>8)&0xff]; syndrom = ((syndrom << 8) & 0xff00) ^ ((data[i])&0xff) ^crctab[(syndrom>>8)&0xff]; } Who can tell me how to apply generic crc to ac3? |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 22:28 |