33 #define AC3_HEADER_SIZE 7 37 static const uint8_t eac3_blocks[4] = {
45 static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
51 static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
58 memset(hdr, 0,
sizeof(*hdr));
86 if(frame_size_code > 37)
98 hdr-> center_mix_level = center_levels[
get_bits(gbc, 2)];
192 int *need_next_header,
int *new_frame_start)
238 .parser_init = ac3_parse_init,
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
Parse AC-3 frame header.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
const uint16_t ff_ac3_frame_size_tab[38][3]
Possible frame sizes.
const uint16_t ff_ac3_sample_rate_tab[3]
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
#define AV_CH_LOW_FREQUENCY
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
const uint16_t avpriv_ac3_channel_layout_tab[8]
Map audio coding mode (acmod) to channel layout mask.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const uint16_t ff_ac3_bitrate_tab[19]
void ff_parse_close(AVCodecParserContext *s)
audio channel layout utility functions
int(* sync)(uint64_t state, struct AACAC3ParseContext *hdr_info, int *need_next_header, int *new_frame_start)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
AVCodecParser ff_ac3_parser
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
const uint8_t ff_ac3_channels_tab[8]
Map audio coding mode (acmod) to number of full-bandwidth channels.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int av_ac3_parse_header(const uint8_t *buf, size_t size, uint8_t *bitstream_id, uint16_t *frame_size)
Extract the bitstream ID and the frame size from AC-3 data.