26 #define BITSTREAM_READER_LE 30 3, 4, 6, 8, 4096, 8192, 16384, 512, 1024, 2048,
35 int nb_samples, max_nb_samples;
40 max_nb_samples = 16384;
43 max_nb_samples = sample_rate *
50 if (nb_samples <= 0 || nb_samples > max_nb_samples)
58 #define CRC_TABLE_SIZE 257 60 #define CRC_TABLE_SIZE 1024 90 uint64_t channel_mask = 0;
113 if (value > 0 && value <= 18)
114 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
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
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
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
#define FF_ARRAY_ELEMS(a)
#define TAK_SIZE_FRAME_DURATION_BITS
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
Initialize a CRC table.
#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
#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
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)
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