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)];
196 int *need_next_header,
int *new_frame_start)
206 if (
tmp.u8[1] == 0x77 &&
tmp.u8[2] == 0x0b) {
248 .parser_init = ac3_parse_init,
int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
@ AAC_AC3_PARSE_ERROR_FRAME_TYPE
@ AAC_AC3_PARSE_ERROR_SYNC
@ AAC_AC3_PARSE_ERROR_BSID
@ AAC_AC3_PARSE_ERROR_SAMPLE_RATE
@ AAC_AC3_PARSE_ERROR_FRAME_SIZE
@ EAC3_FRAME_TYPE_DEPENDENT
@ EAC3_FRAME_TYPE_RESERVED
@ EAC3_FRAME_TYPE_AC3_CONVERT
@ AC3_DSURMOD_NOTINDICATED
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.
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
Parse AC-3 frame header.
const uint16_t avpriv_ac3_channel_layout_tab[8]
Map audio coding mode (acmod) to channel layout mask.
const uint8_t ff_ac3_channels_tab[8]
Map audio coding mode (acmod) to number of full-bandwidth channels.
const uint16_t ff_ac3_bitrate_tab[19]
const int ff_ac3_sample_rate_tab[]
const uint16_t ff_ac3_frame_size_tab[38][3]
Possible frame sizes.
audio channel layout utility functions
#define FFSWAP(type, a, b)
bitstream reader API header.
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CH_LOW_FREQUENCY
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void ff_parse_close(AVCodecParserContext *s)
AVCodecParser ff_ac3_parser