Mercurial > libavcodec.hg
comparison ac3dec.c @ 7701:20b27ee9b40f libavcodec
cosmetics: rename some functions from *get_* to *decode_*
author | jbr |
---|---|
date | Wed, 27 Aug 2008 01:24:43 +0000 |
parents | ce3402b964cd |
children | f91e273722c8 |
comparison
equal
deleted
inserted
replaced
7700:53fb5eb360d5 | 7701:20b27ee9b40f |
---|---|
441 | 441 |
442 /** | 442 /** |
443 * Get the transform coefficients for a particular channel | 443 * Get the transform coefficients for a particular channel |
444 * reference: Section 7.3 Quantization and Decoding of Mantissas | 444 * reference: Section 7.3 Quantization and Decoding of Mantissas |
445 */ | 445 */ |
446 static void get_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, mant_groups *m) | 446 static void decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, mant_groups *m) |
447 { | 447 { |
448 GetBitContext *gbc = &s->gbc; | 448 GetBitContext *gbc = &s->gbc; |
449 int i, gcode, tbap, start, end; | 449 int i, gcode, tbap, start, end; |
450 uint8_t *exps; | 450 uint8_t *exps; |
451 uint8_t *bap; | 451 uint8_t *bap; |
547 } | 547 } |
548 } | 548 } |
549 } | 549 } |
550 | 550 |
551 #if 0 | 551 #if 0 |
552 static void get_transform_coeffs_ch(AC3DecodeContext *s, int blk, int ch, | 552 static void decode_transform_coeffs_ch(AC3DecodeContext *s, int blk, int ch, |
553 mant_groups *m) | 553 mant_groups *m) |
554 { | 554 { |
555 if (!s->channel_uses_aht[ch]) { | 555 if (!s->channel_uses_aht[ch]) { |
556 ac3_get_transform_coeffs_ch(s, ch, m); | 556 ac3_decode_transform_coeffs_ch(s, ch, m); |
557 } else { | 557 } else { |
558 /* if AHT is used, mantissas for all blocks are encoded in the first | 558 /* if AHT is used, mantissas for all blocks are encoded in the first |
559 block of the frame. */ | 559 block of the frame. */ |
560 int bin; | 560 int bin; |
561 if (!blk) | 561 if (!blk) |
562 ff_eac3_get_transform_coeffs_aht_ch(s, ch); | 562 ff_eac3_decode_transform_coeffs_aht_ch(s, ch); |
563 for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) { | 563 for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) { |
564 s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin]; | 564 s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin]; |
565 } | 565 } |
566 } | 566 } |
567 } | 567 } |
568 #endif | 568 #endif |
569 | 569 |
570 /** | 570 /** |
571 * Get the transform coefficients. | 571 * Get the transform coefficients. |
572 */ | 572 */ |
573 static void get_transform_coeffs(AC3DecodeContext *s) | 573 static void decode_transform_coeffs(AC3DecodeContext *s) |
574 { | 574 { |
575 int ch, end; | 575 int ch, end; |
576 int got_cplchan = 0; | 576 int got_cplchan = 0; |
577 mant_groups m; | 577 mant_groups m; |
578 | 578 |
579 m.b1ptr = m.b2ptr = m.b4ptr = 3; | 579 m.b1ptr = m.b2ptr = m.b4ptr = 3; |
580 | 580 |
581 for (ch = 1; ch <= s->channels; ch++) { | 581 for (ch = 1; ch <= s->channels; ch++) { |
582 /* transform coefficients for full-bandwidth channel */ | 582 /* transform coefficients for full-bandwidth channel */ |
583 get_transform_coeffs_ch(s, ch, &m); | 583 decode_transform_coeffs_ch(s, ch, &m); |
584 /* tranform coefficients for coupling channel come right after the | 584 /* tranform coefficients for coupling channel come right after the |
585 coefficients for the first coupled channel*/ | 585 coefficients for the first coupled channel*/ |
586 if (s->channel_in_cpl[ch]) { | 586 if (s->channel_in_cpl[ch]) { |
587 if (!got_cplchan) { | 587 if (!got_cplchan) { |
588 get_transform_coeffs_ch(s, CPL_CH, &m); | 588 decode_transform_coeffs_ch(s, CPL_CH, &m); |
589 calc_transform_coeffs_cpl(s); | 589 calc_transform_coeffs_cpl(s); |
590 got_cplchan = 1; | 590 got_cplchan = 1; |
591 } | 591 } |
592 end = s->end_freq[CPL_CH]; | 592 end = s->end_freq[CPL_CH]; |
593 } else { | 593 } else { |
1073 skip_bits(gbc, 8); | 1073 skip_bits(gbc, 8); |
1074 } | 1074 } |
1075 | 1075 |
1076 /* unpack the transform coefficients | 1076 /* unpack the transform coefficients |
1077 this also uncouples channels if coupling is in use. */ | 1077 this also uncouples channels if coupling is in use. */ |
1078 get_transform_coeffs(s); | 1078 decode_transform_coeffs(s); |
1079 | 1079 |
1080 /* TODO: generate enhanced coupling coordinates and uncouple */ | 1080 /* TODO: generate enhanced coupling coordinates and uncouple */ |
1081 | 1081 |
1082 /* TODO: apply spectral extension */ | 1082 /* TODO: apply spectral extension */ |
1083 | 1083 |