comparison ac3dec.c @ 8132:4cd689b64c36 libavcodec

cosmetics: rename two variables
author jbr
date Thu, 13 Nov 2008 03:17:50 +0000
parents 8195c970d077
children 043e1096c83d
comparison
equal deleted inserted replaced
8131:c30bdda1adb1 8132:4cd689b64c36
770 memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS); 770 memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS);
771 if (!s->eac3) 771 if (!s->eac3)
772 s->cpl_in_use[blk] = get_bits1(gbc); 772 s->cpl_in_use[blk] = get_bits1(gbc);
773 if (s->cpl_in_use[blk]) { 773 if (s->cpl_in_use[blk]) {
774 /* coupling in use */ 774 /* coupling in use */
775 int cpl_begin_freq, cpl_end_freq; 775 int cpl_start_subband, cpl_end_subband;
776 776
777 if (channel_mode < AC3_CHMODE_STEREO) { 777 if (channel_mode < AC3_CHMODE_STEREO) {
778 av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n"); 778 av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n");
779 return -1; 779 return -1;
780 } 780 }
799 if (channel_mode == AC3_CHMODE_STEREO) 799 if (channel_mode == AC3_CHMODE_STEREO)
800 s->phase_flags_in_use = get_bits1(gbc); 800 s->phase_flags_in_use = get_bits1(gbc);
801 801
802 /* coupling frequency range */ 802 /* coupling frequency range */
803 /* TODO: modify coupling end freq if spectral extension is used */ 803 /* TODO: modify coupling end freq if spectral extension is used */
804 cpl_begin_freq = get_bits(gbc, 4); 804 cpl_start_subband = get_bits(gbc, 4);
805 cpl_end_freq = get_bits(gbc, 4); 805 cpl_end_subband = get_bits(gbc, 4);
806 if (3 + cpl_end_freq - cpl_begin_freq < 0) { 806 if (3 + cpl_end_subband - cpl_start_subband < 0) {
807 av_log(s->avctx, AV_LOG_ERROR, "3+cplendf = %d < cplbegf = %d\n", 3+cpl_end_freq, cpl_begin_freq); 807 av_log(s->avctx, AV_LOG_ERROR, "3+cplendf = %d < cplbegf = %d\n", 3+cpl_end_subband, cpl_start_subband);
808 return -1; 808 return -1;
809 } 809 }
810 s->num_cpl_bands = s->num_cpl_subbands = 3 + cpl_end_freq - cpl_begin_freq; 810 s->num_cpl_bands = s->num_cpl_subbands = 3 + cpl_end_subband - cpl_start_subband;
811 s->start_freq[CPL_CH] = cpl_begin_freq * 12 + 37; 811 s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37;
812 s->end_freq[CPL_CH] = cpl_end_freq * 12 + 73; 812 s->end_freq[CPL_CH] = cpl_end_subband * 12 + 73;
813 813
814 /* coupling band structure */ 814 /* coupling band structure */
815 if (!s->eac3 || get_bits1(gbc)) { 815 if (!s->eac3 || get_bits1(gbc)) {
816 for (bnd = 0; bnd < s->num_cpl_subbands - 1; bnd++) { 816 for (bnd = 0; bnd < s->num_cpl_subbands - 1; bnd++) {
817 s->cpl_band_struct[bnd] = get_bits1(gbc); 817 s->cpl_band_struct[bnd] = get_bits1(gbc);
818 } 818 }
819 } else if (!blk) { 819 } else if (!blk) {
820 memcpy(s->cpl_band_struct, 820 memcpy(s->cpl_band_struct,
821 &ff_eac3_default_cpl_band_struct[cpl_begin_freq+1], 821 &ff_eac3_default_cpl_band_struct[cpl_start_subband+1],
822 s->num_cpl_subbands-1); 822 s->num_cpl_subbands-1);
823 } 823 }
824 s->cpl_band_struct[s->num_cpl_subbands-1] = 0; 824 s->cpl_band_struct[s->num_cpl_subbands-1] = 0;
825 825
826 /* calculate number of coupling bands based on band structure */ 826 /* calculate number of coupling bands based on band structure */