/*
- * AC3 parser
+ * AC-3 parser
* Copyright (c) 2003 Fabrice Bellard.
* Copyright (c) 2003 Michael Niedermayer.
*
1, 2, 3, 6
};
-/**
- * Table for center mix levels
- * reference: Section 5.4.2.4 cmixlev
- */
-static const uint8_t center_levels[4] = { 2, 3, 4, 3 };
-
-/**
- * Table for surround mix levels
- * reference: Section 5.4.2.5 surmixlev
- */
-static const uint8_t surround_levels[4] = { 2, 4, 0, 4 };
-
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
{
hdr->num_blocks = 6;
/* set default mix levels */
- hdr->center_mix_level = 3; // -4.5dB
- hdr->surround_mix_level = 4; // -6.0dB
+ hdr->center_mix_level = 1; // -4.5dB
+ hdr->surround_mix_level = 1; // -6.0dB
if(hdr->bitstream_id <= 10) {
/* Normal AC-3 */
skip_bits(gbc, 2); // skip dsurmod
} else {
if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
- hdr->center_mix_level = center_levels[get_bits(gbc, 2)];
+ hdr->center_mix_level = get_bits(gbc, 2);
if(hdr->channel_mode & 4)
- hdr->surround_mix_level = surround_levels[get_bits(gbc, 2)];
+ hdr->surround_mix_level = get_bits(gbc, 2);
}
hdr->lfe_on = get_bits1(gbc);
AVCodecParser ac3_parser = {
- { CODEC_ID_AC3 },
+ { CODEC_ID_AC3, CODEC_ID_EAC3 },
sizeof(AACAC3ParseContext),
ac3_parse_init,
ff_aac_ac3_parse,
- NULL,
+ ff_parse_close,
};