static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,

                                  int ecpl, int start_subband, int end_subband,

                                  const uint8_t *default_band_struct,

                                  int *num_bands, uint8_t *band_sizes)

{

    int subbnd, bnd, n_subbands, n_bands=0;

    uint8_t bnd_sz[22];

    uint8_t coded_band_struct[22];

    const uint8_t *band_struct;



    n_subbands = end_subband - start_subband;



    /* decode band structure from bitstream or use default */

    if (!eac3 || get_bits1(gbc)) {

        for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {

            coded_band_struct[subbnd] = get_bits1(gbc);

        }

        band_struct = coded_band_struct;

    } else if (!blk) {

        band_struct = &default_band_struct[start_subband+1];

    } else {

        /* no change in band structure */

        return;

    }



    /* calculate number of bands and band sizes based on band structure.

       note that the first 4 subbands in enhanced coupling span only 6 bins

       instead of 12. */

    if (num_bands || band_sizes ) {

        n_bands = n_subbands;

        bnd_sz[0] = ecpl ? 6 : 12;

        for (bnd = 0, subbnd = 1; subbnd < n_subbands; subbnd++) {

            int subbnd_size = (ecpl && subbnd < 4) ? 6 : 12;

            if (band_struct[subbnd - 1]) {

                n_bands--;

                bnd_sz[bnd] += subbnd_size;

            } else {

                bnd_sz[++bnd] = subbnd_size;

            }

        }

    }



    /* set optional output params */

    if (num_bands)

        *num_bands = n_bands;

    if (band_sizes)

        memcpy(band_sizes, bnd_sz, n_bands);

}

static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,

                                  int ecpl, int start_subband, int end_subband,

                                  const uint8_t *default_band_struct,

                                  int *num_bands, uint8_t *band_sizes)

{

    int subbnd, bnd, n_subbands, n_bands=0;

    uint8_t bnd_sz[22];

    uint8_t coded_band_struct[22];

    const uint8_t *band_struct;



    n_subbands = end_subband - start_subband;



    

    if (!eac3 || get_bits1(gbc)) {

        for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {

            coded_band_struct[subbnd] = get_bits1(gbc);

        }

        band_struct = coded_band_struct;

    } else if (!blk) {

        band_struct = &default_band_struct[start_subband+1];

    } else {

        

        return;

    }



    





    if (num_bands || band_sizes ) {

        n_bands = n_subbands;

        bnd_sz[0] = ecpl ? 6 : 12;

        for (bnd = 0, subbnd = 1; subbnd < n_subbands; subbnd++) {

            int subbnd_size = (ecpl && subbnd < 4) ? 6 : 12;

            if (band_struct[subbnd - 1]) {

                n_bands--;

                bnd_sz[bnd] += subbnd_size;

            } else {

                bnd_sz[++bnd] = subbnd_size;

            }

        }

    }



    

    if (num_bands)

        *num_bands = n_bands;

    if (band_sizes)

        memcpy(band_sizes, bnd_sz, n_bands);

}

                                  int *num_bands, uint8_t *band_sizes)     uint8_t coded_band_struct[22];     const uint8_t *band_struct;             coded_band_struct[subbnd] = get_bits1(gbc);         band_struct = coded_band_struct;     } else if (!blk) {         band_struct = &default_band_struct[start_subband+1];     } else {
static void FUNC_0(GetBitContext *VAR_0, int VAR_1, int VAR_2,

                                  int VAR_3, int VAR_4, int VAR_5,

                                  const uint8_t *VAR_6,

                                  int *VAR_7, uint8_t *VAR_8)

{

    int VAR_9, VAR_10, VAR_11, VAR_12=0;

    uint8_t bnd_sz[22];

    uint8_t coded_band_struct[22];

    const uint8_t *VAR_13;



    VAR_11 = VAR_5 - VAR_4;



    

    if (!VAR_2 || get_bits1(VAR_0)) {

        for (VAR_9 = 0; VAR_9 < VAR_11 - 1; VAR_9++) {

            coded_band_struct[VAR_9] = get_bits1(VAR_0);

        }

        VAR_13 = coded_band_struct;

    } else if (!VAR_1) {

        VAR_13 = &VAR_6[VAR_4+1];

    } else {

        

        return;

    }



    





    if (VAR_7 || VAR_8 ) {

        VAR_12 = VAR_11;

        bnd_sz[0] = VAR_3 ? 6 : 12;

        for (VAR_10 = 0, VAR_9 = 1; VAR_9 < VAR_11; VAR_9++) {

            int VAR_14 = (VAR_3 && VAR_9 < 4) ? 6 : 12;

            if (VAR_13[VAR_9 - 1]) {

                VAR_12--;

                bnd_sz[VAR_10] += VAR_14;

            } else {

                bnd_sz[++VAR_10] = VAR_14;

            }

        }

    }



    

    if (VAR_7)

        *VAR_7 = VAR_12;

    if (VAR_8)

        memcpy(VAR_8, bnd_sz, VAR_12);

}

static void FUNC_0(GetBitContext *VAR_0, int VAR_1, int VAR_2,
int VAR_3, int VAR_4, int VAR_5,
const uint8_t *VAR_6,
int *VAR_7, uint8_t *VAR_8)
{ int VAR_9, VAR_10, VAR_11, VAR_12=0; uint8_t bnd_sz[22]; uint8_t coded_band_struct[22]; const uint8_t *VAR_13; VAR_11 = VAR_5 - VAR_4; if (!VAR_2 || get_bits1(VAR_0)) { for (VAR_9 = 0; VAR_9 < VAR_11 - 1; VAR_9++) { coded_band_struct[VAR_9] = get_bits1(VAR_0); } VAR_13 = coded_band_struct; } else if (!VAR_1) { VAR_13 = &VAR_6[VAR_4+1]; } else { return; } if (VAR_7 || VAR_8 ) { VAR_12 = VAR_11; bnd_sz[0] = VAR_3 ? 6 : 12; for (VAR_10 = 0, VAR_9 = 1; VAR_9 < VAR_11; VAR_9++) { int VAR_14 = (VAR_3 && VAR_9 < 4) ? 6 : 12; if (VAR_13[VAR_9 - 1]) { VAR_12--; bnd_sz[VAR_10] += VAR_14; } else { bnd_sz[++VAR_10] = VAR_14; } } } if (VAR_7)
*VAR_7 = VAR_12; if (VAR_8)
memcpy(VAR_8, bnd_sz, VAR_12); }