22 #include "libavutil/bswap.h"
23 #include "libavutil/crc.h"
24 #include "libavutil/intreadwrite.h"
28 3, 4, 6, 8, 4096, 8192, 16384, 512, 1024, 2048,
33 int nb_samples, max_nb_samples;
38 max_nb_samples = 16384;
41 max_nb_samples = sample_rate *
48 if (nb_samples <= 0 || nb_samples > max_nb_samples)
56 #define CRC_TABLE_SIZE 257
58 #define CRC_TABLE_SIZE 1024
88 uint64_t channel_mask = 0;
111 if (value > 0 && value <= 18)
112 channel_mask |= 1 << (value - 1);
static const uint16_t frame_duration_type_quants[]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, TAKStreamInfo *ti, int log_level_offset)
Validate and decode a frame header.
#define TAK_FORMAT_BPS_BITS
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define TAK_FRAME_HEADER_NO_BITS
#define TAK_FRAME_FLAG_IS_LAST
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
#define TAK_SIZE_FRAME_DURATION_BITS
#define TAK_FORMAT_DATA_TYPE_BITS
int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size)
#define TAK_FRAME_HEADER_FLAGS_BITS
#define TAK_FRAME_FLAG_HAS_INFO
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
Initialize a CRC table.
#define TAK_FRAME_HEADER_SYNC_ID
static uint64_t get_bits64(GetBitContext *s, int n)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
av_cold void ff_tak_init_crc(void)
#define TAK_SIZE_SAMPLES_NUM_BITS
#define FF_ARRAY_ELEMS(a)
void avpriv_tak_parse_streaminfo(GetBitContext *gb, TAKStreamInfo *s)
Parse the Streaminfo metadata block.
main external API structure.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
#define TAK_SAMPLE_RATE_MIN
TAK (Tom's lossless Audio Kompressor) decoder/demuxer common functions.
#define TAK_ENCODER_CODEC_BITS
#define TAK_ENCODER_PROFILE_BITS
#define TAK_FORMAT_CH_LAYOUT_BITS
#define TAK_FRAME_HEADER_SAMPLE_COUNT_BITS
#define TAK_FRAME_HEADER_SYNC_ID_BITS
#define TAK_FRAME_DURATION_QUANT_SHIFT
#define TAK_FORMAT_VALID_BITS
static const uint8_t * align_get_bits(GetBitContext *s)
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length) av_pure
Calculate the CRC of a block.
static AVCRC crc_24[CRC_TABLE_SIZE]
#define TAK_FORMAT_CHANNEL_BITS
static int tak_get_nb_samples(int sample_rate, enum TAKFrameSizeType type)
#define TAK_FORMAT_SAMPLE_RATE_BITS