diff flacenc.c @ 6108:75804d49f33b libavcodec

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 66317285d195
children 47a97ef90720
line wrap: on
line diff
--- a/flacenc.c	Fri Jan 04 20:02:10 2008 +0000
+++ b/flacenc.c	Fri Jan 04 23:09:58 2008 +0000
@@ -1283,7 +1283,8 @@
         put_bits(&s->pb, 16, s->sr_code[1]);
     }
     flush_put_bits(&s->pb);
-    crc = av_crc(av_crc07, 0, s->pb.buf, put_bits_count(&s->pb)>>3);
+    crc = av_crc(av_crc_get_table(AV_CRC_8_ATM), 0,
+                 s->pb.buf, put_bits_count(&s->pb)>>3);
     put_bits(&s->pb, 8, crc);
 }
 
@@ -1425,7 +1426,8 @@
 {
     int crc;
     flush_put_bits(&s->pb);
-    crc = bswap_16(av_crc(av_crc8005, 0, s->pb.buf, put_bits_count(&s->pb)>>3));
+    crc = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
+                          s->pb.buf, put_bits_count(&s->pb)>>3));
     put_bits(&s->pb, 16, crc);
     flush_put_bits(&s->pb);
 }