comparison ac3_parser.c @ 6540:b0d44aec1ec0 libavcodec

change name from stream type to frame type in AC3 code
author bwolowiec
date Fri, 28 Mar 2008 20:42:55 +0000
parents 04763b6fd4f0
children 013def14c931
comparison
equal deleted inserted replaced
6539:04763b6fd4f0 6540:b0d44aec1ec0
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 = EAC3_STREAM_TYPE_INDEPENDENT; 87 hdr->frame_type = EAC3_FRAME_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->frame_type = get_bits(&gbc, 2);
92 if(hdr->stream_type == EAC3_STREAM_TYPE_RESERVED) 92 if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)
93 return AC3_PARSE_ERROR_STREAM_TYPE; 93 return AC3_PARSE_ERROR_FRAME_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;
98 if(hdr->frame_size < AC3_HEADER_SIZE) 98 if(hdr->frame_size < AC3_HEADER_SIZE)
136 hdr_info->sample_rate = hdr.sample_rate; 136 hdr_info->sample_rate = hdr.sample_rate;
137 hdr_info->bit_rate = hdr.bit_rate; 137 hdr_info->bit_rate = hdr.bit_rate;
138 hdr_info->channels = hdr.channels; 138 hdr_info->channels = hdr.channels;
139 hdr_info->samples = AC3_FRAME_SIZE; 139 hdr_info->samples = AC3_FRAME_SIZE;
140 140
141 switch(hdr.stream_type){ 141 switch(hdr.frame_type){
142 case EAC3_STREAM_TYPE_INDEPENDENT: 142 case EAC3_FRAME_TYPE_INDEPENDENT:
143 *flag = FRAME_START; 143 *flag = FRAME_START;
144 break; 144 break;
145 case EAC3_STREAM_TYPE_DEPENDENT: 145 case EAC3_FRAME_TYPE_DEPENDENT:
146 *flag = FRAME_CONTINUATION; 146 *flag = FRAME_CONTINUATION;
147 break; 147 break;
148 case EAC3_STREAM_TYPE_AC3_CONVERT: 148 case EAC3_FRAME_TYPE_AC3_CONVERT:
149 *flag = FRAME_COMPLETE; 149 *flag = FRAME_COMPLETE;
150 break; 150 break;
151 } 151 }
152 return hdr.frame_size; 152 return hdr.frame_size;
153 } 153 }