Mercurial > libavcodec.hg
comparison ac3_parser.c @ 7016:b514562e0aef libavcodec
set default mix levels regardless of bitstream id
author | jbr |
---|---|
date | Sat, 07 Jun 2008 22:29:45 +0000 |
parents | 4156c54aedba |
children | 885cad616170 |
comparison
equal
deleted
inserted
replaced
7015:d9ac2c5a5d89 | 7016:b514562e0aef |
---|---|
60 hdr->bitstream_id = show_bits_long(gbc, 29) & 0x1F; | 60 hdr->bitstream_id = show_bits_long(gbc, 29) & 0x1F; |
61 if(hdr->bitstream_id > 16) | 61 if(hdr->bitstream_id > 16) |
62 return AC3_PARSE_ERROR_BSID; | 62 return AC3_PARSE_ERROR_BSID; |
63 | 63 |
64 hdr->num_blocks = 6; | 64 hdr->num_blocks = 6; |
65 | |
66 /* set default mix levels */ | |
67 hdr->center_mix_level = 3; // -4.5dB | |
68 hdr->surround_mix_level = 4; // -6.0dB | |
65 | 69 |
66 if(hdr->bitstream_id <= 10) { | 70 if(hdr->bitstream_id <= 10) { |
67 /* Normal AC-3 */ | 71 /* Normal AC-3 */ |
68 hdr->crc1 = get_bits(gbc, 16); | 72 hdr->crc1 = get_bits(gbc, 16); |
69 hdr->sr_code = get_bits(gbc, 2); | 73 hdr->sr_code = get_bits(gbc, 2); |
76 | 80 |
77 skip_bits(gbc, 5); // skip bsid, already got it | 81 skip_bits(gbc, 5); // skip bsid, already got it |
78 | 82 |
79 skip_bits(gbc, 3); // skip bitstream mode | 83 skip_bits(gbc, 3); // skip bitstream mode |
80 hdr->channel_mode = get_bits(gbc, 3); | 84 hdr->channel_mode = get_bits(gbc, 3); |
81 | |
82 /* set default mix levels */ | |
83 hdr->center_mix_level = 3; // -4.5dB | |
84 hdr->surround_mix_level = 4; // -6.0dB | |
85 | 85 |
86 if(hdr->channel_mode == AC3_CHMODE_STEREO) { | 86 if(hdr->channel_mode == AC3_CHMODE_STEREO) { |
87 skip_bits(gbc, 2); // skip dsurmod | 87 skip_bits(gbc, 2); // skip dsurmod |
88 } else { | 88 } else { |
89 if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO) | 89 if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO) |