summaryrefslogtreecommitdiff
path: root/libavcodec/tak.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-06-04 16:41:05 +0000
committerPaul B Mahol <onemda@gmail.com>2013-07-10 12:07:53 +0000
commit8491f40500535bf1ab0aa1997391fb23d7b695bc (patch)
tree0d2c81541ee524200f40d2b9049eb01f61eeb174 /libavcodec/tak.c
parent410192e369588c6d025aa7feb278b9ea9a4f8868 (diff)
downloadffmpeg-8491f40500535bf1ab0aa1997391fb23d7b695bc.tar.gz
tak: use crc table from lavu
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/tak.c')
-rw-r--r--libavcodec/tak.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libavcodec/tak.c b/libavcodec/tak.c
index ccf3abf424..ed41ca8a2e 100644
--- a/libavcodec/tak.c
+++ b/libavcodec/tak.c
@@ -72,22 +72,6 @@ static int tak_get_nb_samples(int sample_rate, enum TAKFrameSizeType type)
return nb_samples;
}
-static int crc_init = 0;
-#if CONFIG_SMALL
-#define CRC_TABLE_SIZE 257
-#else
-#define CRC_TABLE_SIZE 1024
-#endif
-static AVCRC crc_24[CRC_TABLE_SIZE];
-
-av_cold void ff_tak_init_crc(void)
-{
- if (!crc_init) {
- av_crc_init(crc_24, 0, 24, 0x864CFBU, sizeof(crc_24));
- crc_init = 1;
- }
-}
-
int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size)
{
uint32_t crc, CRC;
@@ -97,7 +81,7 @@ int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size)
buf_size -= 3;
CRC = AV_RB24(buf + buf_size);
- crc = av_crc(crc_24, 0xCE04B7U, buf, buf_size);
+ crc = av_crc(av_crc_get_table(AV_CRC_24_IEEE), 0xCE04B7U, buf, buf_size);
if (CRC != crc)
return AVERROR_INVALIDDATA;