static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,

                                  GetBitContext *gb, int id_aac)

{

    unsigned int cnt = get_bits_count(gb);



    if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {

        read_sbr_single_channel_element(ac, sbr, gb);

    } else if (id_aac == TYPE_CPE) {

        read_sbr_channel_pair_element(ac, sbr, gb);

    } else {

        av_log(ac->avccontext, AV_LOG_ERROR,

            "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac);

        sbr->start = 0;

        return get_bits_count(gb) - cnt;

    }

    if (get_bits1(gb)) { // bs_extended_data

        int num_bits_left = get_bits(gb, 4); // bs_extension_size

        if (num_bits_left == 15)

            num_bits_left += get_bits(gb, 8); // bs_esc_count



        num_bits_left <<= 3;

        while (num_bits_left > 7) {

            num_bits_left -= 2;

            read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); // bs_extension_id

        }

    }



    return get_bits_count(gb) - cnt;

}

static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,

                                  GetBitContext *gb, int id_aac)

{

    unsigned int cnt = get_bits_count(gb);



    if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {

        read_sbr_single_channel_element(ac, sbr, gb);

    } else if (id_aac == TYPE_CPE) {

        read_sbr_channel_pair_element(ac, sbr, gb);

    } else {

        av_log(ac->avccontext, AV_LOG_ERROR,

            "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac);

        sbr->start = 0;

        return get_bits_count(gb) - cnt;

    }

    if (get_bits1(gb)) { 

        int num_bits_left = get_bits(gb, 4); 

        if (num_bits_left == 15)

            num_bits_left += get_bits(gb, 8); 



        num_bits_left <<= 3;

        while (num_bits_left > 7) {

            num_bits_left -= 2;

            read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); 

        }

    }



    return get_bits_count(gb) - cnt;

}

        read_sbr_single_channel_element(ac, sbr, gb);         read_sbr_channel_pair_element(ac, sbr, gb);
static unsigned int FUNC_0(AACContext *VAR_0, SpectralBandReplication *VAR_1,

                                  GetBitContext *VAR_2, int VAR_3)

{

    unsigned int VAR_4 = get_bits_count(VAR_2);



    if (VAR_3 == TYPE_SCE || VAR_3 == TYPE_CCE) {

        read_sbr_single_channel_element(VAR_0, VAR_1, VAR_2);

    } else if (VAR_3 == TYPE_CPE) {

        read_sbr_channel_pair_element(VAR_0, VAR_1, VAR_2);

    } else {

        av_log(VAR_0->avccontext, AV_LOG_ERROR,

            "Invalid bitstream - cannot apply SBR to element type %d\n", VAR_3);

        VAR_1->start = 0;

        return get_bits_count(VAR_2) - VAR_4;

    }

    if (get_bits1(VAR_2)) { 

        int VAR_5 = get_bits(VAR_2, 4); 

        if (VAR_5 == 15)

            VAR_5 += get_bits(VAR_2, 8); 



        VAR_5 <<= 3;

        while (VAR_5 > 7) {

            VAR_5 -= 2;

            read_sbr_extension(VAR_0, VAR_1, VAR_2, get_bits(VAR_2, 2), &VAR_5); 

        }

    }



    return get_bits_count(VAR_2) - VAR_4;

}

static unsigned int FUNC_0(AACContext *VAR_0, SpectralBandReplication *VAR_1,
GetBitContext *VAR_2, int VAR_3)
{ unsigned int VAR_4 = get_bits_count(VAR_2); if (VAR_3 == TYPE_SCE || VAR_3 == TYPE_CCE) { read_sbr_single_channel_element(VAR_0, VAR_1, VAR_2); } else if (VAR_3 == TYPE_CPE) { read_sbr_channel_pair_element(VAR_0, VAR_1, VAR_2); } else { av_log(VAR_0->avccontext, AV_LOG_ERROR,
"Invalid bitstream - cannot apply SBR to element type %d\n", VAR_3); VAR_1->start = 0; return get_bits_count(VAR_2) - VAR_4; } if (get_bits1(VAR_2)) { int VAR_5 = get_bits(VAR_2, 4); if (VAR_5 == 15)
VAR_5 += get_bits(VAR_2, 8); VAR_5 <<= 3; while (VAR_5 > 7) { VAR_5 -= 2; read_sbr_extension(VAR_0, VAR_1, VAR_2, get_bits(VAR_2, 2), &VAR_5); } } return get_bits_count(VAR_2) - VAR_4; }