Mercurial > libavcodec.hg
comparison ac3dec.c @ 7328:9309e19c2b98 libavcodec
read 'coupling in use' parameter from bitstream into decoder context first,
then copy to the local variable.
author | jbr |
---|---|
date | Sat, 19 Jul 2008 22:01:46 +0000 |
parents | b5dacf4fc65b |
children | 85ab7655ad4d |
comparison
equal
deleted
inserted
replaced
7327:483421b11d98 | 7328:9309e19c2b98 |
---|---|
751 } while(i--); | 751 } while(i--); |
752 | 752 |
753 /* coupling strategy */ | 753 /* coupling strategy */ |
754 if (get_bits1(gbc)) { | 754 if (get_bits1(gbc)) { |
755 memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS); | 755 memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS); |
756 cpl_in_use = get_bits1(gbc); | 756 s->cpl_in_use[blk] = get_bits1(gbc); |
757 if (cpl_in_use) { | 757 if (s->cpl_in_use[blk]) { |
758 /* coupling in use */ | 758 /* coupling in use */ |
759 int cpl_begin_freq, cpl_end_freq; | 759 int cpl_begin_freq, cpl_end_freq; |
760 | 760 |
761 if (channel_mode < AC3_CHMODE_STEREO) { | 761 if (channel_mode < AC3_CHMODE_STEREO) { |
762 av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n"); | 762 av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n"); |
795 } | 795 } |
796 } else if (!blk) { | 796 } else if (!blk) { |
797 av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must be present in block 0\n"); | 797 av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must be present in block 0\n"); |
798 return -1; | 798 return -1; |
799 } else { | 799 } else { |
800 cpl_in_use = s->cpl_in_use[blk-1]; | 800 s->cpl_in_use[blk] = s->cpl_in_use[blk-1]; |
801 } | 801 } |
802 s->cpl_in_use[blk] = cpl_in_use; | 802 cpl_in_use = s->cpl_in_use[blk]; |
803 | 803 |
804 /* coupling coordinates */ | 804 /* coupling coordinates */ |
805 if (cpl_in_use) { | 805 if (cpl_in_use) { |
806 int cpl_coords_exist = 0; | 806 int cpl_coords_exist = 0; |
807 | 807 |