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; diff --git a/libavcodec/tak.h b/libavcodec/tak.h index 876468d00e..e8e2dacf7c 100644 --- a/libavcodec/tak.h +++ b/libavcodec/tak.h @@ -140,8 +140,6 @@ typedef struct TAKStreamInfo { int64_t samples; } TAKStreamInfo; -void ff_tak_init_crc(void); - int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size); /** diff --git a/libavcodec/tak_parser.c b/libavcodec/tak_parser.c index 9136192579..5d8460c90a 100644 --- a/libavcodec/tak_parser.c +++ b/libavcodec/tak_parser.c @@ -33,12 +33,6 @@ typedef struct TAKParseContext { int index; } TAKParseContext; -static av_cold int tak_init(AVCodecParserContext *s) -{ - ff_tak_init_crc(); - return 0; -} - static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) @@ -123,7 +117,6 @@ found: AVCodecParser ff_tak_parser = { .codec_ids = { AV_CODEC_ID_TAK }, .priv_data_size = sizeof(TAKParseContext), - .parser_init = tak_init, .parser_parse = tak_parse, .parser_close = ff_parse_close, }; diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 9e01ee02d7..0edfddd7da 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -171,7 +171,6 @@ static av_cold int tak_decode_init(AVCodecContext *avctx) { TAKDecContext *s = avctx->priv_data; - ff_tak_init_crc(); ff_dsputil_init(&s->dsp, avctx); s->avctx = avctx;