comparison ac3_parser.c @ 9512:ba5d9a97ab2f libavcodec

Add channel layout support to the AC-3 decoder and AC-3 parser.
author jbr
date Sun, 19 Apr 2009 15:05:32 +0000
parents 0dce4fe6e6f3
children 6e15ce7ca0ca
comparison
equal deleted inserted replaced
9511:c2dba7ed94dc 9512:ba5d9a97ab2f
119 119
120 hdr->bit_rate = (uint32_t)(8.0 * hdr->frame_size * hdr->sample_rate / 120 hdr->bit_rate = (uint32_t)(8.0 * hdr->frame_size * hdr->sample_rate /
121 (hdr->num_blocks * 256.0)); 121 (hdr->num_blocks * 256.0));
122 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; 122 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
123 } 123 }
124 hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
125 if (hdr->lfe_on)
126 hdr->channel_layout |= CH_LOW_FREQUENCY;
124 127
125 return 0; 128 return 0;
126 } 129 }
127 130
128 int ff_ac3_parse_header_full(GetBitContext *gbc, AC3HeaderInfo *hdr){ 131 int ff_ac3_parse_header_full(GetBitContext *gbc, AC3HeaderInfo *hdr){
172 return 0; 175 return 0;
173 176
174 hdr_info->sample_rate = hdr.sample_rate; 177 hdr_info->sample_rate = hdr.sample_rate;
175 hdr_info->bit_rate = hdr.bit_rate; 178 hdr_info->bit_rate = hdr.bit_rate;
176 hdr_info->channels = hdr.channels; 179 hdr_info->channels = hdr.channels;
180 hdr_info->channel_layout = hdr.channel_layout;
177 hdr_info->samples = hdr.num_blocks * 256; 181 hdr_info->samples = hdr.num_blocks * 256;
178 if(hdr.bitstream_id>10) 182 if(hdr.bitstream_id>10)
179 hdr_info->codec_id = CODEC_ID_EAC3; 183 hdr_info->codec_id = CODEC_ID_EAC3;
180 else 184 else
181 hdr_info->codec_id = CODEC_ID_AC3; 185 hdr_info->codec_id = CODEC_ID_AC3;