static int decode_residual_block(AVSContext *h, GetBitContext *gb,

                                 const struct dec_2dvlc *r, int esc_golomb_order,

                                 int qp, uint8_t *dst, int stride) {

    int i, level_code, esc_code, level, run, mask;

    DCTELEM level_buf[65];

    uint8_t run_buf[65];

    DCTELEM *block = h->block;



    for(i=0;i<65;i++) {

        level_code = get_ue_code(gb,r->golomb_order);

        if(level_code >= ESCAPE_CODE) {

            run = ((level_code - ESCAPE_CODE) >> 1) + 1;

            esc_code = get_ue_code(gb,esc_golomb_order);

            level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);

            while(level > r->inc_limit)

                r++;

            mask = -(level_code & 1);

            level = (level^mask) - mask;

        } else {

            level = r->rltab[level_code][0];

            if(!level) //end of block signal

                break;

            run   = r->rltab[level_code][1];

            r += r->rltab[level_code][2];

        }

        level_buf[i] = level;

        run_buf[i] = run;

    }

    if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp],

               ff_cavs_dequant_shift[qp], i))

        return -1;

    h->cdsp.cavs_idct8_add(dst,block,stride);

    h->s.dsp.clear_block(block);

    return 0;

}

static int decode_residual_block(AVSContext *h, GetBitContext *gb,

                                 const struct dec_2dvlc *r, int esc_golomb_order,

                                 int qp, uint8_t *dst, int stride) {

    int i, level_code, esc_code, level, run, mask;

    DCTELEM level_buf[65];

    uint8_t run_buf[65];

    DCTELEM *block = h->block;



    for(i=0;i<65;i++) {

        level_code = get_ue_code(gb,r->golomb_order);

        if(level_code >= ESCAPE_CODE) {

            run = ((level_code - ESCAPE_CODE) >> 1) + 1;

            esc_code = get_ue_code(gb,esc_golomb_order);

            level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);

            while(level > r->inc_limit)

                r++;

            mask = -(level_code & 1);

            level = (level^mask) - mask;

        } else {

            level = r->rltab[level_code][0];

            if(!level) 

                break;

            run   = r->rltab[level_code][1];

            r += r->rltab[level_code][2];

        }

        level_buf[i] = level;

        run_buf[i] = run;

    }

    if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp],

               ff_cavs_dequant_shift[qp], i))

        return -1;

    h->cdsp.cavs_idct8_add(dst,block,stride);

    h->s.dsp.clear_block(block);

    return 0;

}

        } else {
static int FUNC_0(AVSContext *VAR_0, GetBitContext *VAR_1,

                                 const struct dec_2dvlc *VAR_2, int VAR_3,

                                 int VAR_4, uint8_t *VAR_5, int VAR_6) {

    int VAR_7, VAR_8, VAR_9, VAR_10, VAR_11, VAR_12;

    DCTELEM level_buf[65];

    uint8_t run_buf[65];

    DCTELEM *block = VAR_0->block;



    for(VAR_7=0;VAR_7<65;VAR_7++) {

        VAR_8 = get_ue_code(VAR_1,VAR_2->golomb_order);

        if(VAR_8 >= ESCAPE_CODE) {

            VAR_11 = ((VAR_8 - ESCAPE_CODE) >> 1) + 1;

            VAR_9 = get_ue_code(VAR_1,VAR_3);

            VAR_10 = VAR_9 + (VAR_11 > VAR_2->max_run ? 1 : VAR_2->level_add[VAR_11]);

            while(VAR_10 > VAR_2->inc_limit)

                VAR_2++;

            VAR_12 = -(VAR_8 & 1);

            VAR_10 = (VAR_10^VAR_12) - VAR_12;

        } else {

            VAR_10 = VAR_2->rltab[VAR_8][0];

            if(!VAR_10) 

                break;

            VAR_11   = VAR_2->rltab[VAR_8][1];

            VAR_2 += VAR_2->rltab[VAR_8][2];

        }

        level_buf[VAR_7] = VAR_10;

        run_buf[VAR_7] = VAR_11;

    }

    if(dequant(VAR_0,level_buf, run_buf, block, ff_cavs_dequant_mul[VAR_4],

               ff_cavs_dequant_shift[VAR_4], VAR_7))

        return -1;

    VAR_0->cdsp.cavs_idct8_add(VAR_5,block,VAR_6);

    VAR_0->s.dsp.clear_block(block);

    return 0;

}

static int FUNC_0(AVSContext *VAR_0, GetBitContext *VAR_1,
const struct dec_2dvlc *VAR_2, int VAR_3,
int VAR_4, uint8_t *VAR_5, int VAR_6) { int VAR_7, VAR_8, VAR_9, VAR_10, VAR_11, VAR_12; DCTELEM level_buf[65]; uint8_t run_buf[65]; DCTELEM *block = VAR_0->block; for(VAR_7=0;VAR_7<65;VAR_7++) { VAR_8 = get_ue_code(VAR_1,VAR_2->golomb_order); if(VAR_8 >= ESCAPE_CODE) { VAR_11 = ((VAR_8 - ESCAPE_CODE) >> 1) + 1; VAR_9 = get_ue_code(VAR_1,VAR_3); VAR_10 = VAR_9 + (VAR_11 > VAR_2->max_run ? 1 : VAR_2->level_add[VAR_11]); while(VAR_10 > VAR_2->inc_limit)
VAR_2++; VAR_12 = -(VAR_8 & 1); VAR_10 = (VAR_10^VAR_12) - VAR_12; } else { VAR_10 = VAR_2->rltab[VAR_8][0]; if(!VAR_10)
break; VAR_11   = VAR_2->rltab[VAR_8][1]; VAR_2 += VAR_2->rltab[VAR_8][2]; } level_buf[VAR_7] = VAR_10; run_buf[VAR_7] = VAR_11; } if(dequant(VAR_0,level_buf, run_buf, block, ff_cavs_dequant_mul[VAR_4],
ff_cavs_dequant_shift[VAR_4], VAR_7))
return -1; VAR_0->cdsp.cavs_idct8_add(VAR_5,block,VAR_6); VAR_0->s.dsp.clear_block(block); return 0; }