Mercurial > libavcodec.hg
comparison ac3_parser.c @ 6530:5d9fe8d17643 libavcodec
using EAC3_STREAM_TYPE_* instead of numbers
author | bwolowiec |
---|---|
date | Mon, 24 Mar 2008 22:21:22 +0000 |
parents | 5542d0c04a55 |
children | 04763b6fd4f0 |
comparison
equal
deleted
inserted
replaced
6529:5542d0c04a55 | 6530:5d9fe8d17643 |
---|---|
82 hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8; | 82 hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8; |
83 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift; | 83 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift; |
84 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; | 84 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; |
85 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; | 85 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; |
86 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; | 86 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; |
87 hdr->stream_type = 0; | 87 hdr->stream_type = EAC3_STREAM_TYPE_INDEPENDENT; |
88 } else { | 88 } else { |
89 /* Enhanced AC-3 */ | 89 /* Enhanced AC-3 */ |
90 hdr->crc1 = 0; | 90 hdr->crc1 = 0; |
91 hdr->stream_type = get_bits(&gbc, 2); | 91 hdr->stream_type = get_bits(&gbc, 2); |
92 if(hdr->stream_type == 3) | 92 if(hdr->stream_type == EAC3_STREAM_TYPE_RESERVED) |
93 return AC3_PARSE_ERROR_STREAM_TYPE; | 93 return AC3_PARSE_ERROR_STREAM_TYPE; |
94 | 94 |
95 skip_bits(&gbc, 3); // skip substream id | 95 skip_bits(&gbc, 3); // skip substream id |
96 | 96 |
97 hdr->frame_size = (get_bits(&gbc, 11) + 1) << 1; | 97 hdr->frame_size = (get_bits(&gbc, 11) + 1) << 1; |