diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-01-04 23:09:58 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-01-04 23:09:58 +0000 |
commit | 3abe5fbdc4169047421e9e8794a8f190d794b929 (patch) | |
tree | 69954b6566185ceebcd2e462cdfa6c68f0393b48 /libavcodec/ac3enc.c | |
parent | 83a0d3878c54b84b21c12be1981bd30096f278f4 (diff) | |
download | ffmpeg-3abe5fbdc4169047421e9e8794a8f190d794b929.tar.gz |
improve CRC API
- don't export any global var
- provide either generated or hardcoded tables
Originally committed as revision 11409 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 4ed58e7e84..4e1fe8e475 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1141,13 +1141,16 @@ static int output_frame_end(AC3EncodeContext *s) /* Now we must compute both crcs : this is not so easy for crc1 because it is at the beginning of the data... */ frame_size_58 = (frame_size >> 1) + (frame_size >> 3); - crc1 = bswap_16(av_crc(av_crc8005, 0, frame + 4, 2 * frame_size_58 - 4)); + crc1 = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, + frame + 4, 2 * frame_size_58 - 4)); /* XXX: could precompute crc_inv */ crc_inv = pow_poly((CRC16_POLY >> 1), (16 * frame_size_58) - 16, CRC16_POLY); crc1 = mul_poly(crc_inv, crc1, CRC16_POLY); AV_WB16(frame+2,crc1); - crc2 = bswap_16(av_crc(av_crc8005, 0, frame + 2 * frame_size_58, (frame_size - frame_size_58) * 2 - 2)); + crc2 = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, + frame + 2 * frame_size_58, + (frame_size - frame_size_58) * 2 - 2)); AV_WB16(frame+2*frame_size-2,crc2); // printf("n=%d frame_size=%d\n", n, frame_size); |