Mercurial > libavcodec.hg
comparison ac3dec.c @ 9983:68de5143aa45 libavcodec
refactoring: properly separate AC-3 and E-AC-3 code
author | diego |
---|---|
date | Thu, 23 Jul 2009 02:33:25 +0000 |
parents | daa53251c64d |
children | 0649c00003a1 |
comparison
equal
deleted
inserted
replaced
9982:daa53251c64d | 9983:68de5143aa45 |
---|---|
312 s->first_cpl_leak = 0; | 312 s->first_cpl_leak = 0; |
313 s->dba_syntax = 1; | 313 s->dba_syntax = 1; |
314 s->skip_syntax = 1; | 314 s->skip_syntax = 1; |
315 memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht)); | 315 memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht)); |
316 return ac3_parse_header(s); | 316 return ac3_parse_header(s); |
317 } else { | 317 } else if (CONFIG_EAC3_DECODER) { |
318 s->eac3 = 1; | 318 s->eac3 = 1; |
319 return ff_eac3_parse_header(s); | 319 return ff_eac3_parse_header(s); |
320 } else { | |
321 av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n"); | |
322 return -1; | |
320 } | 323 } |
321 } | 324 } |
322 | 325 |
323 /** | 326 /** |
324 * Set stereo downmixing coefficients based on frame header info. | 327 * Set stereo downmixing coefficients based on frame header info. |
557 ac3_decode_transform_coeffs_ch(s, ch, m); | 560 ac3_decode_transform_coeffs_ch(s, ch, m); |
558 } else { | 561 } else { |
559 /* if AHT is used, mantissas for all blocks are encoded in the first | 562 /* if AHT is used, mantissas for all blocks are encoded in the first |
560 block of the frame. */ | 563 block of the frame. */ |
561 int bin; | 564 int bin; |
562 if (!blk) | 565 if (!blk && CONFIG_EAC3_DECODER) |
563 ff_eac3_decode_transform_coeffs_aht_ch(s, ch); | 566 ff_eac3_decode_transform_coeffs_aht_ch(s, ch); |
564 for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) { | 567 for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) { |
565 s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin]; | 568 s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin]; |
566 } | 569 } |
567 } | 570 } |