static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order)

{

    int sum, i, j;

    int coeff_prec, qlevel;

    int coeffs[pred_order];

        

//    av_log(s->avctx, AV_LOG_DEBUG, "  SUBFRAME LPC\n");

        

    /* warm up samples */

//    av_log(s->avctx, AV_LOG_DEBUG, "   warm up samples: %d\n", pred_order);

        

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

    {

        s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);

//        av_log(s->avctx, AV_LOG_DEBUG, "    %d: %d\n", i, s->decoded[channel][i]);

    }

    

    coeff_prec = get_bits(&s->gb, 4) + 1;

    if (coeff_prec == 16)

    {

        av_log(s->avctx, AV_LOG_DEBUG, "invalid coeff precision\n");

        return -1;

    }

    av_log(s->avctx, AV_LOG_DEBUG, "   qlp coeff prec: %d\n", coeff_prec);

    qlevel = get_sbits(&s->gb, 5);

    av_log(s->avctx, AV_LOG_DEBUG, "   quant level: %d\n", qlevel);

assert(qlevel >= 0); //FIXME

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

    {

        coeffs[i] = get_sbits(&s->gb, coeff_prec);

//        av_log(s->avctx, AV_LOG_DEBUG, "    %d: %d\n", i, coeffs[i]);

    }

    

    if (decode_residuals(s, channel, pred_order) < 0)

        return -1;



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

    {

        sum = 0;

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

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

        s->decoded[channel][i] += sum >> qlevel;

    }

    

    return 0;

}

static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order)

{

    int sum, i, j;

    int coeff_prec, qlevel;

    int coeffs[pred_order];

        



        

    



        

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

    {

        s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);



    }

    

    coeff_prec = get_bits(&s->gb, 4) + 1;

    if (coeff_prec == 16)

    {

        av_log(s->avctx, AV_LOG_DEBUG, "invalid coeff precision\n");

        return -1;

    }

    av_log(s->avctx, AV_LOG_DEBUG, "   qlp coeff prec: %d\n", coeff_prec);

    qlevel = get_sbits(&s->gb, 5);

    av_log(s->avctx, AV_LOG_DEBUG, "   quant level: %d\n", qlevel);

assert(qlevel >= 0); 

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

    {

        coeffs[i] = get_sbits(&s->gb, coeff_prec);



    }

    

    if (decode_residuals(s, channel, pred_order) < 0)

        return -1;



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

    {

        sum = 0;

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

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

        s->decoded[channel][i] += sum >> qlevel;

    }

    

    return 0;

}

static int FUNC_0(FLACContext *VAR_0, int VAR_1, int VAR_2)

{

    int VAR_3, VAR_4, VAR_5;

    int VAR_6, VAR_7;

    int VAR_8[VAR_2];

        



        

    



        

    for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++)

    {

        VAR_0->decoded[VAR_1][VAR_4] = get_sbits(&VAR_0->gb, VAR_0->curr_bps);



    }

    

    VAR_6 = get_bits(&VAR_0->gb, 4) + 1;

    if (VAR_6 == 16)

    {

        av_log(VAR_0->avctx, AV_LOG_DEBUG, "invalid coeff precision\n");

        return -1;

    }

    av_log(VAR_0->avctx, AV_LOG_DEBUG, "   qlp coeff prec: %d\n", VAR_6);

    VAR_7 = get_sbits(&VAR_0->gb, 5);

    av_log(VAR_0->avctx, AV_LOG_DEBUG, "   quant level: %d\n", VAR_7);

assert(VAR_7 >= 0); 

    for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++)

    {

        VAR_8[VAR_4] = get_sbits(&VAR_0->gb, VAR_6);



    }

    

    if (decode_residuals(VAR_0, VAR_1, VAR_2) < 0)

        return -1;



    for (VAR_4 = VAR_2; VAR_4 < VAR_0->blocksize; VAR_4++)

    {

        VAR_3 = 0;

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

            VAR_3 += VAR_8[VAR_5] * VAR_0->decoded[VAR_1][VAR_4-VAR_5-1];

        VAR_0->decoded[VAR_1][VAR_4] += VAR_3 >> VAR_7;

    }

    

    return 0;

}

static int FUNC_0(FLACContext *VAR_0, int VAR_1, int VAR_2)
{ int VAR_3, VAR_4, VAR_5; int VAR_6, VAR_7; int VAR_8[VAR_2]; for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) { VAR_0->decoded[VAR_1][VAR_4] = get_sbits(&VAR_0->gb, VAR_0->curr_bps); } VAR_6 = get_bits(&VAR_0->gb, 4) + 1; if (VAR_6 == 16)
{ av_log(VAR_0->avctx, AV_LOG_DEBUG, "invalid coeff precision\n"); return -1; } av_log(VAR_0->avctx, AV_LOG_DEBUG, "   qlp coeff prec: %d\n", VAR_6); VAR_7 = get_sbits(&VAR_0->gb, 5); av_log(VAR_0->avctx, AV_LOG_DEBUG, "   quant level: %d\n", VAR_7); assert(VAR_7 >= 0); for (VAR_4 = 0; VAR_4 < VAR_2; VAR_4++) { VAR_8[VAR_4] = get_sbits(&VAR_0->gb, VAR_6); } if (decode_residuals(VAR_0, VAR_1, VAR_2) < 0)
return -1; for (VAR_4 = VAR_2; VAR_4 < VAR_0->blocksize; VAR_4++) { VAR_3 = 0; for (VAR_5 = 0; VAR_5 < VAR_2; VAR_5++) VAR_3 += VAR_8[VAR_5] * VAR_0->decoded[VAR_1][VAR_4-VAR_5-1]; VAR_0->decoded[VAR_1][VAR_4] += VAR_3 >> VAR_7; } return 0; }