aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3_parser.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2008-06-07 22:30:09 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2008-06-07 22:30:09 +0000
commit30f71adc46685f2a95d6a71d327a3dab5a6a5940 (patch)
treee10ec3f35be77b9f6f8cb3c0cf0df3850dbbac5c /libavcodec/ac3_parser.c
parentcaf0fbc8894e06694d6d79193ffcf022abd25119 (diff)
downloadffmpeg-30f71adc46685f2a95d6a71d327a3dab5a6a5940.tar.gz
move mix level tables from parser to decoder. have parser read bitstream value instead of using an index to a table in the decoder.
Originally committed as revision 13696 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3_parser.c')
-rw-r--r--libavcodec/ac3_parser.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index ae5bf30d78..6ed23d787a 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -33,18 +33,6 @@ static const uint8_t eac3_blocks[4] = {
1, 2, 3, 6
};
-/**
- * Table for center mix levels
- * reference: Section 5.4.2.4 cmixlev
- */
-static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
-
-/**
- * Table for surround mix levels
- * reference: Section 5.4.2.5 surmixlev
- */
-static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
-
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
{
@@ -64,8 +52,8 @@ 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 */
@@ -87,9 +75,9 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
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);