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

{

    int i, tmp, partition, method_type, rice_order;

    int sample = 0, samples;



    method_type = get_bits(&s->gb, 2);

    if (method_type != 0){

        av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);





    rice_order = get_bits(&s->gb, 4);



    samples= s->blocksize >> rice_order;







    sample=

    i= pred_order;

    for (partition = 0; partition < (1 << rice_order); partition++)

    {

        tmp = get_bits(&s->gb, 4);

        if (tmp == 15)

        {

            av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");

            tmp = get_bits(&s->gb, 5);

            for (; i < samples; i++, sample++)

                s->decoded[channel][sample] = get_sbits(&s->gb, tmp);


        else

        {

//            av_log(s->avctx, AV_LOG_DEBUG, "rice coded partition k=%d\n", tmp);

            for (; i < samples; i++, sample++){

                s->decoded[channel][sample] = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);



        i= 0;




//    av_log(s->avctx, AV_LOG_DEBUG, "partitions: %d, samples: %d\n", 1 << rice_order, sample);



    return 0;

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

{

    int i, tmp, partition, method_type, rice_order;

    int sample = 0, samples;



    method_type = get_bits(&s->gb, 2);

    if (method_type != 0){

        av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);





    rice_order = get_bits(&s->gb, 4);



    samples= s->blocksize >> rice_order;







    sample=

    i= pred_order;

    for (partition = 0; partition < (1 << rice_order); partition++)

    {

        tmp = get_bits(&s->gb, 4);

        if (tmp == 15)

        {

            av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");

            tmp = get_bits(&s->gb, 5);

            for (; i < samples; i++, sample++)

                s->decoded[channel][sample] = get_sbits(&s->gb, tmp);


        else

        {



            for (; i < samples; i++, sample++){

                s->decoded[channel][sample] = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);



        i= 0;








    return 0;

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

{

    int VAR_3, VAR_4, VAR_5, VAR_6, VAR_7;

    int VAR_8 = 0, VAR_9;



    VAR_6 = get_bits(&VAR_0->gb, 2);

    if (VAR_6 != 0){

        av_log(VAR_0->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", VAR_6);





    VAR_7 = get_bits(&VAR_0->gb, 4);



    VAR_9= VAR_0->blocksize >> VAR_7;







    VAR_8=

    VAR_3= VAR_2;

    for (VAR_5 = 0; VAR_5 < (1 << VAR_7); VAR_5++)

    {

        VAR_4 = get_bits(&VAR_0->gb, 4);

        if (VAR_4 == 15)

        {

            av_log(VAR_0->avctx, AV_LOG_DEBUG, "fixed len VAR_5\n");

            VAR_4 = get_bits(&VAR_0->gb, 5);

            for (; VAR_3 < VAR_9; VAR_3++, VAR_8++)

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


        else

        {



            for (; VAR_3 < VAR_9; VAR_3++, VAR_8++){

                VAR_0->decoded[VAR_1][VAR_8] = get_sr_golomb_flac(&VAR_0->gb, VAR_4, INT_MAX, 0);



        VAR_3= 0;








    return 0;

static int FUNC_0(FLACContext *VAR_0, int VAR_1, int VAR_2)
{ int VAR_3, VAR_4, VAR_5, VAR_6, VAR_7; int VAR_8 = 0, VAR_9; VAR_6 = get_bits(&VAR_0->gb, 2); if (VAR_6 != 0){ av_log(VAR_0->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", VAR_6); VAR_7 = get_bits(&VAR_0->gb, 4); VAR_9= VAR_0->blocksize >> VAR_7; VAR_8=
VAR_3= VAR_2; for (VAR_5 = 0; VAR_5 < (1 << VAR_7); VAR_5++) { VAR_4 = get_bits(&VAR_0->gb, 4); if (VAR_4 == 15)
{ av_log(VAR_0->avctx, AV_LOG_DEBUG, "fixed len VAR_5\n"); VAR_4 = get_bits(&VAR_0->gb, 5); for (; VAR_3 < VAR_9; VAR_3++, VAR_8++) VAR_0->decoded[VAR_1][VAR_8] = get_sbits(&VAR_0->gb, VAR_4); else
{ for (; VAR_3 < VAR_9; VAR_3++, VAR_8++){ VAR_0->decoded[VAR_1][VAR_8] = get_sr_golomb_flac(&VAR_0->gb, VAR_4, INT_MAX, 0); VAR_3= 0; return 0;