static int decode_subframe_lpc(ShortenContext *s, int command, int channel,

                               int residual_size, int32_t coffset)

{

    int pred_order, sum, qshift, init_sum, i, j;

    const int *coeffs;



    if (command == FN_QLPC) {

        /* read/validate prediction order */

        pred_order = get_ur_golomb_shorten(&s->gb, LPCQSIZE);

        if (pred_order > s->nwrap) {

            av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",

                   pred_order);

            return AVERROR(EINVAL);

        }

        /* read LPC coefficients */

        for (i = 0; i < pred_order; i++)

            s->coeffs[i] = get_sr_golomb_shorten(&s->gb, LPCQUANT);

        coeffs = s->coeffs;



        qshift = LPCQUANT;

    } else {

        /* fixed LPC coeffs */

        pred_order = command;

        if (pred_order >= FF_ARRAY_ELEMS(fixed_coeffs)) {

            av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",

                   pred_order);

            return AVERROR_INVALIDDATA;

        }

        coeffs     = fixed_coeffs[pred_order];

        qshift     = 0;

    }



    /* subtract offset from previous samples to use in prediction */

    if (command == FN_QLPC && coffset)

        for (i = -pred_order; i < 0; i++)

            s->decoded[channel][i] -= coffset;



    /* decode residual and do LPC prediction */

    init_sum = pred_order ? (command == FN_QLPC ? s->lpcqoffset : 0) : coffset;

    for (i = 0; i < s->blocksize; i++) {

        sum = init_sum;

        for (j = 0; j < pred_order; j++)

            sum += coeffs[j] * s->decoded[channel][i - j - 1];

        s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) +

                                 (sum >> qshift);

    }



    /* add offset to current samples */

    if (command == FN_QLPC && coffset)

        for (i = 0; i < s->blocksize; i++)

            s->decoded[channel][i] += coffset;



    return 0;

}

static int decode_subframe_lpc(ShortenContext *s, int command, int channel,

                               int residual_size, int32_t coffset)

{

    int pred_order, sum, qshift, init_sum, i, j;

    const int *coeffs;



    if (command == FN_QLPC) {

        

        pred_order = get_ur_golomb_shorten(&s->gb, LPCQSIZE);

        if (pred_order > s->nwrap) {

            av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",

                   pred_order);

            return AVERROR(EINVAL);

        }

        

        for (i = 0; i < pred_order; i++)

            s->coeffs[i] = get_sr_golomb_shorten(&s->gb, LPCQUANT);

        coeffs = s->coeffs;



        qshift = LPCQUANT;

    } else {

        

        pred_order = command;

        if (pred_order >= FF_ARRAY_ELEMS(fixed_coeffs)) {

            av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",

                   pred_order);

            return AVERROR_INVALIDDATA;

        }

        coeffs     = fixed_coeffs[pred_order];

        qshift     = 0;

    }



    

    if (command == FN_QLPC && coffset)

        for (i = -pred_order; i < 0; i++)

            s->decoded[channel][i] -= coffset;



    

    init_sum = pred_order ? (command == FN_QLPC ? s->lpcqoffset : 0) : coffset;

    for (i = 0; i < s->blocksize; i++) {

        sum = init_sum;

        for (j = 0; j < pred_order; j++)

            sum += coeffs[j] * s->decoded[channel][i - j - 1];

        s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) +

                                 (sum >> qshift);

    }



    

    if (command == FN_QLPC && coffset)

        for (i = 0; i < s->blocksize; i++)

            s->decoded[channel][i] += coffset;



    return 0;

}

static int FUNC_0(ShortenContext *VAR_0, int VAR_1, int VAR_2,

                               int VAR_3, int32_t VAR_4)

{

    int VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10;

    const int *VAR_11;



    if (VAR_1 == FN_QLPC) {

        

        VAR_5 = get_ur_golomb_shorten(&VAR_0->gb, LPCQSIZE);

        if (VAR_5 > VAR_0->nwrap) {

            av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid VAR_5 %d\n",

                   VAR_5);

            return AVERROR(EINVAL);

        }

        

        for (VAR_9 = 0; VAR_9 < VAR_5; VAR_9++)

            VAR_0->VAR_11[VAR_9] = get_sr_golomb_shorten(&VAR_0->gb, LPCQUANT);

        VAR_11 = VAR_0->VAR_11;



        VAR_7 = LPCQUANT;

    } else {

        

        VAR_5 = VAR_1;

        if (VAR_5 >= FF_ARRAY_ELEMS(fixed_coeffs)) {

            av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid VAR_5 %d\n",

                   VAR_5);

            return AVERROR_INVALIDDATA;

        }

        VAR_11     = fixed_coeffs[VAR_5];

        VAR_7     = 0;

    }



    

    if (VAR_1 == FN_QLPC && VAR_4)

        for (VAR_9 = -VAR_5; VAR_9 < 0; VAR_9++)

            VAR_0->decoded[VAR_2][VAR_9] -= VAR_4;



    

    VAR_8 = VAR_5 ? (VAR_1 == FN_QLPC ? VAR_0->lpcqoffset : 0) : VAR_4;

    for (VAR_9 = 0; VAR_9 < VAR_0->blocksize; VAR_9++) {

        VAR_6 = VAR_8;

        for (VAR_10 = 0; VAR_10 < VAR_5; VAR_10++)

            VAR_6 += VAR_11[VAR_10] * VAR_0->decoded[VAR_2][VAR_9 - VAR_10 - 1];

        VAR_0->decoded[VAR_2][VAR_9] = get_sr_golomb_shorten(&VAR_0->gb, VAR_3) +

                                 (VAR_6 >> VAR_7);

    }



    

    if (VAR_1 == FN_QLPC && VAR_4)

        for (VAR_9 = 0; VAR_9 < VAR_0->blocksize; VAR_9++)

            VAR_0->decoded[VAR_2][VAR_9] += VAR_4;



    return 0;

}

static int FUNC_0(ShortenContext *VAR_0, int VAR_1, int VAR_2,
int VAR_3, int32_t VAR_4)
{ int VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10; const int *VAR_11; if (VAR_1 == FN_QLPC) { VAR_5 = get_ur_golomb_shorten(&VAR_0->gb, LPCQSIZE); if (VAR_5 > VAR_0->nwrap) { av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid VAR_5 %d\n",
VAR_5); return AVERROR(EINVAL); } for (VAR_9 = 0; VAR_9 < VAR_5; VAR_9++) VAR_0->VAR_11[VAR_9] = get_sr_golomb_shorten(&VAR_0->gb, LPCQUANT); VAR_11 = VAR_0->VAR_11; VAR_7 = LPCQUANT; } else { VAR_5 = VAR_1; if (VAR_5 >= FF_ARRAY_ELEMS(fixed_coeffs)) { av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid VAR_5 %d\n",
VAR_5); return AVERROR_INVALIDDATA; } VAR_11     = fixed_coeffs[VAR_5]; VAR_7     = 0; } if (VAR_1 == FN_QLPC && VAR_4)
for (VAR_9 = -VAR_5; VAR_9 < 0; VAR_9++) VAR_0->decoded[VAR_2][VAR_9] -= VAR_4; VAR_8 = VAR_5 ? (VAR_1 == FN_QLPC ? VAR_0->lpcqoffset : 0) : VAR_4; for (VAR_9 = 0; VAR_9 < VAR_0->blocksize; VAR_9++) { VAR_6 = VAR_8; for (VAR_10 = 0; VAR_10 < VAR_5; VAR_10++) VAR_6 += VAR_11[VAR_10] * VAR_0->decoded[VAR_2][VAR_9 - VAR_10 - 1]; VAR_0->decoded[VAR_2][VAR_9] = get_sr_golomb_shorten(&VAR_0->gb, VAR_3) +
(VAR_6 >> VAR_7); } if (VAR_1 == FN_QLPC && VAR_4)
for (VAR_9 = 0; VAR_9 < VAR_0->blocksize; VAR_9++) VAR_0->decoded[VAR_2][VAR_9] += VAR_4; return 0; }