From f7813a5324be39d13ab536c245d15dfc602a7849 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 29 Dec 2013 12:19:38 +0000 Subject: basic type mechanism working --- ffmpeg/libavcodec/tak.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'ffmpeg/libavcodec/tak.c') diff --git a/ffmpeg/libavcodec/tak.c b/ffmpeg/libavcodec/tak.c index 92dc44c..ed41ca8 100644 --- a/ffmpeg/libavcodec/tak.c +++ b/ffmpeg/libavcodec/tak.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/bswap.h" #include "libavutil/crc.h" #include "libavutil/intreadwrite.h" #include "tak.h" @@ -73,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,8 +80,8 @@ int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size) return AVERROR_INVALIDDATA; buf_size -= 3; - CRC = av_bswap32(AV_RL24(buf + buf_size)) >> 8; - crc = av_crc(crc_24, 0xCE04B7U, buf, buf_size); + CRC = AV_RB24(buf + buf_size); + crc = av_crc(av_crc_get_table(AV_CRC_24_IEEE), 0xCE04B7U, buf, buf_size); if (CRC != crc) return AVERROR_INVALIDDATA; -- cgit v1.2.3