static inline int spx_strategy(AC3DecodeContext *s, int blk)

{

    GetBitContext *bc = &s->gbc;

    int fbw_channels = s->fbw_channels;

    int dst_start_freq, dst_end_freq, src_start_freq,

        start_subband, end_subband, ch;



    /* determine which channels use spx */

    if (s->channel_mode == AC3_CHMODE_MONO) {

        s->channel_uses_spx[1] = 1;

    } else {

        for (ch = 1; ch <= fbw_channels; ch++)

            s->channel_uses_spx[ch] = get_bits1(bc);

    }



    /* get the frequency bins of the spx copy region and the spx start

       and end subbands */

    dst_start_freq = get_bits(bc, 2);

    start_subband  = get_bits(bc, 3) + 2;

    if (start_subband > 7)

        start_subband += start_subband - 7;

    end_subband    = get_bits(bc, 3) + 5;

#if USE_FIXED

    s->spx_dst_end_freq = end_freq_inv_tab[end_subband-5];

#endif

    if (end_subband   > 7)

        end_subband   += end_subband   - 7;

    dst_start_freq = dst_start_freq * 12 + 25;

    src_start_freq = start_subband  * 12 + 25;

    dst_end_freq   = end_subband    * 12 + 25;



    /* check validity of spx ranges */

    if (start_subband >= end_subband) {

        av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "

               "range (%d >= %d)\n", start_subband, end_subband);

        return AVERROR_INVALIDDATA;

    }

    if (dst_start_freq >= src_start_freq) {

        av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "

               "copy start bin (%d >= %d)\n", dst_start_freq, src_start_freq);

        return AVERROR_INVALIDDATA;

    }



    s->spx_dst_start_freq = dst_start_freq;

    s->spx_src_start_freq = src_start_freq;

    if (!USE_FIXED)

        s->spx_dst_end_freq   = dst_end_freq;



    decode_band_structure(bc, blk, s->eac3, 0,

                          start_subband, end_subband,

                          ff_eac3_default_spx_band_struct,

                          &s->num_spx_bands,

                          s->spx_band_sizes);

    return 0;

}

static inline int spx_strategy(AC3DecodeContext *s, int blk)

{

    GetBitContext *bc = &s->gbc;

    int fbw_channels = s->fbw_channels;

    int dst_start_freq, dst_end_freq, src_start_freq,

        start_subband, end_subband, ch;



    

    if (s->channel_mode == AC3_CHMODE_MONO) {

        s->channel_uses_spx[1] = 1;

    } else {

        for (ch = 1; ch <= fbw_channels; ch++)

            s->channel_uses_spx[ch] = get_bits1(bc);

    }



    



    dst_start_freq = get_bits(bc, 2);

    start_subband  = get_bits(bc, 3) + 2;

    if (start_subband > 7)

        start_subband += start_subband - 7;

    end_subband    = get_bits(bc, 3) + 5;

#if USE_FIXED

    s->spx_dst_end_freq = end_freq_inv_tab[end_subband-5];

#endif

    if (end_subband   > 7)

        end_subband   += end_subband   - 7;

    dst_start_freq = dst_start_freq * 12 + 25;

    src_start_freq = start_subband  * 12 + 25;

    dst_end_freq   = end_subband    * 12 + 25;



    

    if (start_subband >= end_subband) {

        av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "

               "range (%d >= %d)\n", start_subband, end_subband);

        return AVERROR_INVALIDDATA;

    }

    if (dst_start_freq >= src_start_freq) {

        av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "

               "copy start bin (%d >= %d)\n", dst_start_freq, src_start_freq);

        return AVERROR_INVALIDDATA;

    }



    s->spx_dst_start_freq = dst_start_freq;

    s->spx_src_start_freq = src_start_freq;

    if (!USE_FIXED)

        s->spx_dst_end_freq   = dst_end_freq;



    decode_band_structure(bc, blk, s->eac3, 0,

                          start_subband, end_subband,

                          ff_eac3_default_spx_band_struct,

                          &s->num_spx_bands,

                          s->spx_band_sizes);

    return 0;

}

    } else {                           s->spx_band_sizes);
static inline int FUNC_0(AC3DecodeContext *VAR_0, int VAR_1)

{

    GetBitContext *bc = &VAR_0->gbc;

    int VAR_2 = VAR_0->VAR_2;

    int VAR_3, VAR_4, VAR_5,

        VAR_6, VAR_7, VAR_8;



    

    if (VAR_0->channel_mode == AC3_CHMODE_MONO) {

        VAR_0->channel_uses_spx[1] = 1;

    } else {

        for (VAR_8 = 1; VAR_8 <= VAR_2; VAR_8++)

            VAR_0->channel_uses_spx[VAR_8] = get_bits1(bc);

    }



    



    VAR_3 = get_bits(bc, 2);

    VAR_6  = get_bits(bc, 3) + 2;

    if (VAR_6 > 7)

        VAR_6 += VAR_6 - 7;

    VAR_7    = get_bits(bc, 3) + 5;

#if USE_FIXED

    VAR_0->spx_dst_end_freq = end_freq_inv_tab[VAR_7-5];

#endif

    if (VAR_7   > 7)

        VAR_7   += VAR_7   - 7;

    VAR_3 = VAR_3 * 12 + 25;

    VAR_5 = VAR_6  * 12 + 25;

    VAR_4   = VAR_7    * 12 + 25;



    

    if (VAR_6 >= VAR_7) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid spectral extension "

               "range (%d >= %d)\n", VAR_6, VAR_7);

        return AVERROR_INVALIDDATA;

    }

    if (VAR_3 >= VAR_5) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid spectral extension "

               "copy start bin (%d >= %d)\n", VAR_3, VAR_5);

        return AVERROR_INVALIDDATA;

    }



    VAR_0->spx_dst_start_freq = VAR_3;

    VAR_0->spx_src_start_freq = VAR_5;

    if (!USE_FIXED)

        VAR_0->spx_dst_end_freq   = VAR_4;



    decode_band_structure(bc, VAR_1, VAR_0->eac3, 0,

                          VAR_6, VAR_7,

                          ff_eac3_default_spx_band_struct,

                          &VAR_0->num_spx_bands,

                          VAR_0->spx_band_sizes);

    return 0;

}

static inline int FUNC_0(AC3DecodeContext *VAR_0, int VAR_1)
{ GetBitContext *bc = &VAR_0->gbc; int VAR_2 = VAR_0->VAR_2; int VAR_3, VAR_4, VAR_5,
VAR_6, VAR_7, VAR_8; if (VAR_0->channel_mode == AC3_CHMODE_MONO) { VAR_0->channel_uses_spx[1] = 1; } else { for (VAR_8 = 1; VAR_8 <= VAR_2; VAR_8++) VAR_0->channel_uses_spx[VAR_8] = get_bits1(bc); } VAR_3 = get_bits(bc, 2); VAR_6  = get_bits(bc, 3) + 2; if (VAR_6 > 7)
VAR_6 += VAR_6 - 7; VAR_7    = get_bits(bc, 3) + 5; #if USE_FIXED
VAR_0->spx_dst_end_freq = end_freq_inv_tab[VAR_7-5]; #endif
if (VAR_7   > 7)
VAR_7   += VAR_7   - 7; VAR_3 = VAR_3 * 12 + 25; VAR_5 = VAR_6  * 12 + 25; VAR_4   = VAR_7    * 12 + 25; if (VAR_6 >= VAR_7) { av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid spectral extension "
"range (%d >= %d)\n", VAR_6, VAR_7); return AVERROR_INVALIDDATA; } if (VAR_3 >= VAR_5) { av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid spectral extension "
"copy start bin (%d >= %d)\n", VAR_3, VAR_5); return AVERROR_INVALIDDATA; } VAR_0->spx_dst_start_freq = VAR_3; VAR_0->spx_src_start_freq = VAR_5; if (!USE_FIXED)
VAR_0->spx_dst_end_freq   = VAR_4; decode_band_structure(bc, VAR_1, VAR_0->eac3, 0,
VAR_6, VAR_7,
ff_eac3_default_spx_band_struct,
&VAR_0->num_spx_bands,
VAR_0->spx_band_sizes); return 0; }