50 3, 4, 6, 8, 4096, 8192, 16384, 512, 1024, 2048,
55 int nb_samples, max_nb_samples;
60 max_nb_samples = 16384;
63 max_nb_samples = sample_rate *
70 if (nb_samples <= 0 || nb_samples > max_nb_samples)
78 #define CRC_TABLE_SIZE 257 80 #define CRC_TABLE_SIZE 1024 110 uint64_t channel_mask = 0;
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 AV_CH_TOP_FRONT_RIGHT
#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 AV_CH_TOP_FRONT_LEFT
#define TAK_FRAME_HEADER_NO_BITS
static const int64_t tak_channel_layouts[]
#define AV_CH_TOP_FRONT_CENTER
#define TAK_FRAME_FLAG_IS_LAST
#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
#define AV_CH_TOP_BACK_LEFT
int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size)
#define AV_CH_TOP_BACK_CENTER
#define AV_CH_LOW_FREQUENCY
#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)
Read 0-64 bits.
av_cold void ff_tak_init_crc(void)
void av_log(void *avcl, int level, const char *fmt,...)
#define TAK_SIZE_SAMPLES_NUM_BITS
#define AV_CH_FRONT_LEFT_OF_CENTER
#define AV_CH_FRONT_CENTER
#define AV_CH_FRONT_RIGHT_OF_CENTER
#define TAK_FRAME_FLAG_HAS_METADATA
void avpriv_tak_parse_streaminfo(GetBitContext *gb, TAKStreamInfo *s)
Parse the Streaminfo metadata block.
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static unsigned int get_bits1(GetBitContext *s)
#define AV_CH_TOP_BACK_RIGHT
static void skip_bits(GetBitContext *s, int n)
#define TAK_SAMPLE_RATE_MIN
synthesis window for stochastic i
TAK (Tom's lossless Audio Kompressor) decoder/demuxer common functions.
#define TAK_ENCODER_CODEC_BITS
#define AV_CH_BACK_CENTER
#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)
#define AV_CH_FRONT_RIGHT
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