diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/tak.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/tak.c')
| -rw-r--r-- | ffmpeg/libavcodec/tak.c | 21 |
1 files changed, 2 insertions, 19 deletions
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; |
