Go to the documentation of this file.
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)];
194 int *need_next_header,
int *new_frame_start)
204 if (
tmp.u8[1] == 0x77 &&
tmp.u8[2] == 0x0b) {
246 .parser_init = ac3_parse_init,
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
const uint16_t ff_ac3_channel_layout_tab[8]
Map audio coding mode (acmod) to channel layout mask.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int get_bits_count(const GetBitContext *s)
void ff_parse_close(AVCodecParserContext *s)
const uint8_t ff_ac3_channels_tab[8]
Map audio coding mode (acmod) to number of full-bandwidth channels.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
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.
@ EAC3_FRAME_TYPE_DEPENDENT
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define AV_CH_LOW_FREQUENCY
@ AAC_AC3_PARSE_ERROR_SYNC
@ AAC_AC3_PARSE_ERROR_BSID
int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
@ EAC3_FRAME_TYPE_AC3_CONVERT
const AVCodecParser ff_ac3_parser
static unsigned int get_bits1(GetBitContext *s)
@ AAC_AC3_PARSE_ERROR_SAMPLE_RATE
@ EAC3_FRAME_TYPE_RESERVED
const int ff_ac3_sample_rate_tab[]
@ AAC_AC3_PARSE_ERROR_FRAME_SIZE
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
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_frame_size_tab[38][3]
Possible frame sizes.
@ AAC_AC3_PARSE_ERROR_FRAME_TYPE
#define FFSWAP(type, a, b)
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
Parse AC-3 frame header.
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
#define AV_INPUT_BUFFER_PADDING_SIZE
const uint16_t ff_ac3_bitrate_tab[19]
@ AC3_DSURMOD_NOTINDICATED
#define AVERROR_INVALIDDATA
Invalid data found when processing input.