Mercurial > libavcodec.hg
comparison ac3_parser.c @ 6651:abc8176ddf88 libavcodec
Make most of E-AC-3 work without breaking regression tests.
author | michael |
---|---|
date | Sat, 19 Apr 2008 12:04:33 +0000 |
parents | 83f805f7a854 |
children | a409fbf1f42b |
comparison
equal
deleted
inserted
replaced
6650:2d1497d25251 | 6651:abc8176ddf88 |
---|---|
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->frame_type = EAC3_FRAME_TYPE_INDEPENDENT; | 87 hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //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->frame_type = get_bits(&gbc, 2); | 91 hdr->frame_type = get_bits(&gbc, 2); |
92 if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED) | 92 if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED) |
138 hdr_info->sample_rate = hdr.sample_rate; | 138 hdr_info->sample_rate = hdr.sample_rate; |
139 hdr_info->bit_rate = hdr.bit_rate; | 139 hdr_info->bit_rate = hdr.bit_rate; |
140 hdr_info->channels = hdr.channels; | 140 hdr_info->channels = hdr.channels; |
141 hdr_info->samples = AC3_FRAME_SIZE; | 141 hdr_info->samples = AC3_FRAME_SIZE; |
142 | 142 |
143 *need_next_header = 0;//(hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT); | 143 *need_next_header = (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT); |
144 *new_frame_start = 1;//(hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT); | 144 *new_frame_start = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT); |
145 return hdr.frame_size; | 145 return hdr.frame_size; |
146 } | 146 } |
147 | 147 |
148 static av_cold int ac3_parse_init(AVCodecParserContext *s1) | 148 static av_cold int ac3_parse_init(AVCodecParserContext *s1) |
149 { | 149 { |