static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,

                                unsigned int substr)

{

    SubStream *s = &m->substream[substr];

    unsigned int ch;



    if (s->param_presence_flags & PARAM_PRESENCE)

    if (get_bits1(gbp))

        s->param_presence_flags = get_bits(gbp, 8);



    if (s->param_presence_flags & PARAM_BLOCKSIZE)

        if (get_bits1(gbp)) {

            s->blocksize = get_bits(gbp, 9);

            if (s->blocksize > MAX_BLOCKSIZE) {

                av_log(m->avctx, AV_LOG_ERROR, "block size too large\n");

                s->blocksize = 0;

                return -1;

            }

        }



    if (s->param_presence_flags & PARAM_MATRIX)

        if (get_bits1(gbp)) {

            if (read_matrix_params(m, s, gbp) < 0)

                return -1;

        }



    if (s->param_presence_flags & PARAM_OUTSHIFT)

        if (get_bits1(gbp))

            for (ch = 0; ch <= s->max_matrix_channel; ch++) {

                s->output_shift[ch] = get_sbits(gbp, 4);

                dprintf(m->avctx, "output shift[%d] = %d\n",

                        ch, s->output_shift[ch]);

            }



    if (s->param_presence_flags & PARAM_QUANTSTEP)

        if (get_bits1(gbp))

            for (ch = 0; ch <= s->max_channel; ch++) {

                ChannelParams *cp = &m->channel_params[ch];



                s->quant_step_size[ch] = get_bits(gbp, 4);



                cp->sign_huff_offset = calculate_sign_huff(m, substr, ch);

            }



    for (ch = s->min_channel; ch <= s->max_channel; ch++)

        if (get_bits1(gbp)) {

            if (read_channel_params(m, substr, gbp, ch) < 0)

                return -1;

        }



    return 0;

}

static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,

                                unsigned int substr)

{

    SubStream *s = &m->substream[substr];

    unsigned int ch;



    if (s->param_presence_flags & PARAM_PRESENCE)

    if (get_bits1(gbp))

        s->param_presence_flags = get_bits(gbp, 8);



    if (s->param_presence_flags & PARAM_BLOCKSIZE)

        if (get_bits1(gbp)) {

            s->blocksize = get_bits(gbp, 9);

            if (s->blocksize > MAX_BLOCKSIZE) {

                av_log(m->avctx, AV_LOG_ERROR, "block size too large\n");

                s->blocksize = 0;

                return -1;

            }

        }



    if (s->param_presence_flags & PARAM_MATRIX)

        if (get_bits1(gbp)) {

            if (read_matrix_params(m, s, gbp) < 0)

                return -1;

        }



    if (s->param_presence_flags & PARAM_OUTSHIFT)

        if (get_bits1(gbp))

            for (ch = 0; ch <= s->max_matrix_channel; ch++) {

                s->output_shift[ch] = get_sbits(gbp, 4);

                dprintf(m->avctx, "output shift[%d] = %d\n",

                        ch, s->output_shift[ch]);

            }



    if (s->param_presence_flags & PARAM_QUANTSTEP)

        if (get_bits1(gbp))

            for (ch = 0; ch <= s->max_channel; ch++) {

                ChannelParams *cp = &m->channel_params[ch];



                s->quant_step_size[ch] = get_bits(gbp, 4);



                cp->sign_huff_offset = calculate_sign_huff(m, substr, ch);

            }



    for (ch = s->min_channel; ch <= s->max_channel; ch++)

        if (get_bits1(gbp)) {

            if (read_channel_params(m, substr, gbp, ch) < 0)

                return -1;

        }



    return 0;

}

static int FUNC_0(MLPDecodeContext *VAR_0, GetBitContext *VAR_1,

                                unsigned int VAR_2)

{

    SubStream *s = &VAR_0->substream[VAR_2];

    unsigned int VAR_3;



    if (s->param_presence_flags & PARAM_PRESENCE)

    if (get_bits1(VAR_1))

        s->param_presence_flags = get_bits(VAR_1, 8);



    if (s->param_presence_flags & PARAM_BLOCKSIZE)

        if (get_bits1(VAR_1)) {

            s->blocksize = get_bits(VAR_1, 9);

            if (s->blocksize > MAX_BLOCKSIZE) {

                av_log(VAR_0->avctx, AV_LOG_ERROR, "block size too large\n");

                s->blocksize = 0;

                return -1;

            }

        }



    if (s->param_presence_flags & PARAM_MATRIX)

        if (get_bits1(VAR_1)) {

            if (read_matrix_params(VAR_0, s, VAR_1) < 0)

                return -1;

        }



    if (s->param_presence_flags & PARAM_OUTSHIFT)

        if (get_bits1(VAR_1))

            for (VAR_3 = 0; VAR_3 <= s->max_matrix_channel; VAR_3++) {

                s->output_shift[VAR_3] = get_sbits(VAR_1, 4);

                dprintf(VAR_0->avctx, "output shift[%d] = %d\n",

                        VAR_3, s->output_shift[VAR_3]);

            }



    if (s->param_presence_flags & PARAM_QUANTSTEP)

        if (get_bits1(VAR_1))

            for (VAR_3 = 0; VAR_3 <= s->max_channel; VAR_3++) {

                ChannelParams *cp = &VAR_0->channel_params[VAR_3];



                s->quant_step_size[VAR_3] = get_bits(VAR_1, 4);



                cp->sign_huff_offset = calculate_sign_huff(VAR_0, VAR_2, VAR_3);

            }



    for (VAR_3 = s->min_channel; VAR_3 <= s->max_channel; VAR_3++)

        if (get_bits1(VAR_1)) {

            if (read_channel_params(VAR_0, VAR_2, VAR_1, VAR_3) < 0)

                return -1;

        }



    return 0;

}

static int FUNC_0(MLPDecodeContext *VAR_0, GetBitContext *VAR_1,
unsigned int VAR_2)
{ SubStream *s = &VAR_0->substream[VAR_2]; unsigned int VAR_3; if (s->param_presence_flags & PARAM_PRESENCE)
if (get_bits1(VAR_1))
s->param_presence_flags = get_bits(VAR_1, 8); if (s->param_presence_flags & PARAM_BLOCKSIZE)
if (get_bits1(VAR_1)) { s->blocksize = get_bits(VAR_1, 9); if (s->blocksize > MAX_BLOCKSIZE) { av_log(VAR_0->avctx, AV_LOG_ERROR, "block size too large\n"); s->blocksize = 0; return -1; } } if (s->param_presence_flags & PARAM_MATRIX)
if (get_bits1(VAR_1)) { if (read_matrix_params(VAR_0, s, VAR_1) < 0)
return -1; } if (s->param_presence_flags & PARAM_OUTSHIFT)
if (get_bits1(VAR_1))
for (VAR_3 = 0; VAR_3 <= s->max_matrix_channel; VAR_3++) { s->output_shift[VAR_3] = get_sbits(VAR_1, 4); dprintf(VAR_0->avctx, "output shift[%d] = %d\n",
VAR_3, s->output_shift[VAR_3]); } if (s->param_presence_flags & PARAM_QUANTSTEP)
if (get_bits1(VAR_1))
for (VAR_3 = 0; VAR_3 <= s->max_channel; VAR_3++) { ChannelParams *cp = &VAR_0->channel_params[VAR_3]; s->quant_step_size[VAR_3] = get_bits(VAR_1, 4); cp->sign_huff_offset = calculate_sign_huff(VAR_0, VAR_2, VAR_3); } for (VAR_3 = s->min_channel; VAR_3 <= s->max_channel; VAR_3++) if (get_bits1(VAR_1)) { if (read_channel_params(VAR_0, VAR_2, VAR_1, VAR_3) < 0)
return -1; } return 0; }