void ff_h263_encode_mb(MpegEncContext * s,

                       int16_t block[6][64],

                       int motion_x, int motion_y)

{

    int cbpc, cbpy, i, cbp, pred_x, pred_y;

    int16_t pred_dc;

    int16_t rec_intradc[6];

    int16_t *dc_ptr[6];

    const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1);



    if (!s->mb_intra) {

        /* compute cbp */

        cbp= get_p_cbp(s, block, motion_x, motion_y);



        if ((cbp | motion_x | motion_y | s->dquant | (s->mv_type - MV_TYPE_16X16)) == 0) {

            /* skip macroblock */

            put_bits(&s->pb, 1, 1);

            if(interleaved_stats){

                s->misc_bits++;

                s->last_bits++;

            }

            s->skip_count++;



            return;

        }

        put_bits(&s->pb, 1, 0);         /* mb coded */



        cbpc = cbp & 3;

        cbpy = cbp >> 2;

        if(s->alt_inter_vlc==0 || cbpc!=3)

            cbpy ^= 0xF;

        if(s->dquant) cbpc+= 8;

        if(s->mv_type==MV_TYPE_16X16){

            put_bits(&s->pb,

                    ff_h263_inter_MCBPC_bits[cbpc],

                    ff_h263_inter_MCBPC_code[cbpc]);



            put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);

            if(s->dquant)

                put_bits(&s->pb, 2, dquant_code[s->dquant+2]);



            if(interleaved_stats){

                s->misc_bits+= get_bits_diff(s);

            }



            /* motion vectors: 16x16 mode */

            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);



            if (!s->umvplus) {

                ff_h263_encode_motion_vector(s, motion_x - pred_x,

                                                motion_y - pred_y, 1);

            }

            else {

                h263p_encode_umotion(s, motion_x - pred_x);

                h263p_encode_umotion(s, motion_y - pred_y);

                if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))

                    /* To prevent Start Code emulation */

                    put_bits(&s->pb,1,1);

            }

        }else{

            put_bits(&s->pb,

                    ff_h263_inter_MCBPC_bits[cbpc+16],

                    ff_h263_inter_MCBPC_code[cbpc+16]);

            put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);

            if(s->dquant)

                put_bits(&s->pb, 2, dquant_code[s->dquant+2]);



            if(interleaved_stats){

                s->misc_bits+= get_bits_diff(s);

            }



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

                /* motion vectors: 8x8 mode*/

                ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);



                motion_x = s->current_picture.motion_val[0][s->block_index[i]][0];

                motion_y = s->current_picture.motion_val[0][s->block_index[i]][1];

                if (!s->umvplus) {

                    ff_h263_encode_motion_vector(s, motion_x - pred_x,

                                                    motion_y - pred_y, 1);

                }

                else {

                    h263p_encode_umotion(s, motion_x - pred_x);

                    h263p_encode_umotion(s, motion_y - pred_y);

                    if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))

                        /* To prevent Start Code emulation */

                        put_bits(&s->pb,1,1);

                }

            }

        }



        if(interleaved_stats){

            s->mv_bits+= get_bits_diff(s);

        }

    } else {

        assert(s->mb_intra);



        cbp = 0;

        if (s->h263_aic) {

            /* Predict DC */

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

                int16_t level = block[i][0];

                int scale;



                if(i<4) scale= s->y_dc_scale;

                else    scale= s->c_dc_scale;



                pred_dc = ff_h263_pred_dc(s, i, &dc_ptr[i]);

                level -= pred_dc;

                /* Quant */

                if (level >= 0)

                    level = (level + (scale>>1))/scale;

                else

                    level = (level - (scale>>1))/scale;



                /* AIC can change CBP */

                if (level == 0 && s->block_last_index[i] == 0)

                    s->block_last_index[i] = -1;



                if(!s->modified_quant){

                    if (level < -127)

                        level = -127;

                    else if (level > 127)

                        level = 127;

                }



                block[i][0] = level;

                /* Reconstruction */

                rec_intradc[i] = scale*level + pred_dc;

                /* Oddify */

                rec_intradc[i] |= 1;

                //if ((rec_intradc[i] % 2) == 0)

                //    rec_intradc[i]++;

                /* Clipping */

                if (rec_intradc[i] < 0)

                    rec_intradc[i] = 0;

                else if (rec_intradc[i] > 2047)

                    rec_intradc[i] = 2047;



                /* Update AC/DC tables */

                *dc_ptr[i] = rec_intradc[i];

                if (s->block_last_index[i] >= 0)

                    cbp |= 1 << (5 - i);

            }

        }else{

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

                /* compute cbp */

                if (s->block_last_index[i] >= 1)

                    cbp |= 1 << (5 - i);

            }

        }



        cbpc = cbp & 3;

        if (s->pict_type == AV_PICTURE_TYPE_I) {

            if(s->dquant) cbpc+=4;

            put_bits(&s->pb,

                ff_h263_intra_MCBPC_bits[cbpc],

                ff_h263_intra_MCBPC_code[cbpc]);

        } else {

            if(s->dquant) cbpc+=8;

            put_bits(&s->pb, 1, 0);     /* mb coded */

            put_bits(&s->pb,

                ff_h263_inter_MCBPC_bits[cbpc + 4],

                ff_h263_inter_MCBPC_code[cbpc + 4]);

        }

        if (s->h263_aic) {

            /* XXX: currently, we do not try to use ac prediction */

            put_bits(&s->pb, 1, 0);     /* no AC prediction */

        }

        cbpy = cbp >> 2;

        put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);

        if(s->dquant)

            put_bits(&s->pb, 2, dquant_code[s->dquant+2]);



        if(interleaved_stats){

            s->misc_bits+= get_bits_diff(s);

        }

    }



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

        /* encode each block */

        h263_encode_block(s, block[i], i);



        /* Update INTRADC for decoding */

        if (s->h263_aic && s->mb_intra) {

            block[i][0] = rec_intradc[i];



        }

    }



    if(interleaved_stats){

        if (!s->mb_intra) {

            s->p_tex_bits+= get_bits_diff(s);

            s->f_count++;

        }else{

            s->i_tex_bits+= get_bits_diff(s);

            s->i_count++;

        }

    }

}

void ff_h263_encode_mb(MpegEncContext * s,

                       int16_t block[6][64],

                       int motion_x, int motion_y)

{

    int cbpc, cbpy, i, cbp, pred_x, pred_y;

    int16_t pred_dc;

    int16_t rec_intradc[6];

    int16_t *dc_ptr[6];

    const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1);



    if (!s->mb_intra) {

        

        cbp= get_p_cbp(s, block, motion_x, motion_y);



        if ((cbp | motion_x | motion_y | s->dquant | (s->mv_type - MV_TYPE_16X16)) == 0) {

            

            put_bits(&s->pb, 1, 1);

            if(interleaved_stats){

                s->misc_bits++;

                s->last_bits++;

            }

            s->skip_count++;



            return;

        }

        put_bits(&s->pb, 1, 0);         



        cbpc = cbp & 3;

        cbpy = cbp >> 2;

        if(s->alt_inter_vlc==0 || cbpc!=3)

            cbpy ^= 0xF;

        if(s->dquant) cbpc+= 8;

        if(s->mv_type==MV_TYPE_16X16){

            put_bits(&s->pb,

                    ff_h263_inter_MCBPC_bits[cbpc],

                    ff_h263_inter_MCBPC_code[cbpc]);



            put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);

            if(s->dquant)

                put_bits(&s->pb, 2, dquant_code[s->dquant+2]);



            if(interleaved_stats){

                s->misc_bits+= get_bits_diff(s);

            }



            

            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);



            if (!s->umvplus) {

                ff_h263_encode_motion_vector(s, motion_x - pred_x,

                                                motion_y - pred_y, 1);

            }

            else {

                h263p_encode_umotion(s, motion_x - pred_x);

                h263p_encode_umotion(s, motion_y - pred_y);

                if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))

                    

                    put_bits(&s->pb,1,1);

            }

        }else{

            put_bits(&s->pb,

                    ff_h263_inter_MCBPC_bits[cbpc+16],

                    ff_h263_inter_MCBPC_code[cbpc+16]);

            put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);

            if(s->dquant)

                put_bits(&s->pb, 2, dquant_code[s->dquant+2]);



            if(interleaved_stats){

                s->misc_bits+= get_bits_diff(s);

            }



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

                

                ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);



                motion_x = s->current_picture.motion_val[0][s->block_index[i]][0];

                motion_y = s->current_picture.motion_val[0][s->block_index[i]][1];

                if (!s->umvplus) {

                    ff_h263_encode_motion_vector(s, motion_x - pred_x,

                                                    motion_y - pred_y, 1);

                }

                else {

                    h263p_encode_umotion(s, motion_x - pred_x);

                    h263p_encode_umotion(s, motion_y - pred_y);

                    if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))

                        

                        put_bits(&s->pb,1,1);

                }

            }

        }



        if(interleaved_stats){

            s->mv_bits+= get_bits_diff(s);

        }

    } else {

        assert(s->mb_intra);



        cbp = 0;

        if (s->h263_aic) {

            

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

                int16_t level = block[i][0];

                int scale;



                if(i<4) scale= s->y_dc_scale;

                else    scale= s->c_dc_scale;



                pred_dc = ff_h263_pred_dc(s, i, &dc_ptr[i]);

                level -= pred_dc;

                

                if (level >= 0)

                    level = (level + (scale>>1))/scale;

                else

                    level = (level - (scale>>1))/scale;



                

                if (level == 0 && s->block_last_index[i] == 0)

                    s->block_last_index[i] = -1;



                if(!s->modified_quant){

                    if (level < -127)

                        level = -127;

                    else if (level > 127)

                        level = 127;

                }



                block[i][0] = level;

                

                rec_intradc[i] = scale*level + pred_dc;

                

                rec_intradc[i] |= 1;

                

                

                

                if (rec_intradc[i] < 0)

                    rec_intradc[i] = 0;

                else if (rec_intradc[i] > 2047)

                    rec_intradc[i] = 2047;



                

                *dc_ptr[i] = rec_intradc[i];

                if (s->block_last_index[i] >= 0)

                    cbp |= 1 << (5 - i);

            }

        }else{

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

                

                if (s->block_last_index[i] >= 1)

                    cbp |= 1 << (5 - i);

            }

        }



        cbpc = cbp & 3;

        if (s->pict_type == AV_PICTURE_TYPE_I) {

            if(s->dquant) cbpc+=4;

            put_bits(&s->pb,

                ff_h263_intra_MCBPC_bits[cbpc],

                ff_h263_intra_MCBPC_code[cbpc]);

        } else {

            if(s->dquant) cbpc+=8;

            put_bits(&s->pb, 1, 0);     

            put_bits(&s->pb,

                ff_h263_inter_MCBPC_bits[cbpc + 4],

                ff_h263_inter_MCBPC_code[cbpc + 4]);

        }

        if (s->h263_aic) {

            

            put_bits(&s->pb, 1, 0);     

        }

        cbpy = cbp >> 2;

        put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);

        if(s->dquant)

            put_bits(&s->pb, 2, dquant_code[s->dquant+2]);



        if(interleaved_stats){

            s->misc_bits+= get_bits_diff(s);

        }

    }



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

        

        h263_encode_block(s, block[i], i);



        

        if (s->h263_aic && s->mb_intra) {

            block[i][0] = rec_intradc[i];



        }

    }



    if(interleaved_stats){

        if (!s->mb_intra) {

            s->p_tex_bits+= get_bits_diff(s);

            s->f_count++;

        }else{

            s->i_tex_bits+= get_bits_diff(s);

            s->i_count++;

        }

    }

}

void FUNC_0(MpegEncContext * VAR_0,

                       int16_t VAR_1[6][64],

                       int VAR_2, int VAR_3)

{

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

    int16_t pred_dc;

    int16_t rec_intradc[6];

    int16_t *dc_ptr[6];

    const int VAR_10= (VAR_0->flags&CODEC_FLAG_PASS1);



    if (!VAR_0->mb_intra) {

        

        VAR_7= get_p_cbp(VAR_0, VAR_1, VAR_2, VAR_3);



        if ((VAR_7 | VAR_2 | VAR_3 | VAR_0->dquant | (VAR_0->mv_type - MV_TYPE_16X16)) == 0) {

            

            put_bits(&VAR_0->pb, 1, 1);

            if(VAR_10){

                VAR_0->misc_bits++;

                VAR_0->last_bits++;

            }

            VAR_0->skip_count++;



            return;

        }

        put_bits(&VAR_0->pb, 1, 0);         



        VAR_4 = VAR_7 & 3;

        VAR_5 = VAR_7 >> 2;

        if(VAR_0->alt_inter_vlc==0 || VAR_4!=3)

            VAR_5 ^= 0xF;

        if(VAR_0->dquant) VAR_4+= 8;

        if(VAR_0->mv_type==MV_TYPE_16X16){

            put_bits(&VAR_0->pb,

                    ff_h263_inter_MCBPC_bits[VAR_4],

                    ff_h263_inter_MCBPC_code[VAR_4]);



            put_bits(&VAR_0->pb, ff_h263_cbpy_tab[VAR_5][1], ff_h263_cbpy_tab[VAR_5][0]);

            if(VAR_0->dquant)

                put_bits(&VAR_0->pb, 2, dquant_code[VAR_0->dquant+2]);



            if(VAR_10){

                VAR_0->misc_bits+= get_bits_diff(VAR_0);

            }



            

            ff_h263_pred_motion(VAR_0, 0, 0, &VAR_8, &VAR_9);



            if (!VAR_0->umvplus) {

                ff_h263_encode_motion_vector(VAR_0, VAR_2 - VAR_8,

                                                VAR_3 - VAR_9, 1);

            }

            else {

                h263p_encode_umotion(VAR_0, VAR_2 - VAR_8);

                h263p_encode_umotion(VAR_0, VAR_3 - VAR_9);

                if (((VAR_2 - VAR_8) == 1) && ((VAR_3 - VAR_9) == 1))

                    

                    put_bits(&VAR_0->pb,1,1);

            }

        }else{

            put_bits(&VAR_0->pb,

                    ff_h263_inter_MCBPC_bits[VAR_4+16],

                    ff_h263_inter_MCBPC_code[VAR_4+16]);

            put_bits(&VAR_0->pb, ff_h263_cbpy_tab[VAR_5][1], ff_h263_cbpy_tab[VAR_5][0]);

            if(VAR_0->dquant)

                put_bits(&VAR_0->pb, 2, dquant_code[VAR_0->dquant+2]);



            if(VAR_10){

                VAR_0->misc_bits+= get_bits_diff(VAR_0);

            }



            for(VAR_6=0; VAR_6<4; VAR_6++){

                

                ff_h263_pred_motion(VAR_0, VAR_6, 0, &VAR_8, &VAR_9);



                VAR_2 = VAR_0->current_picture.motion_val[0][VAR_0->block_index[VAR_6]][0];

                VAR_3 = VAR_0->current_picture.motion_val[0][VAR_0->block_index[VAR_6]][1];

                if (!VAR_0->umvplus) {

                    ff_h263_encode_motion_vector(VAR_0, VAR_2 - VAR_8,

                                                    VAR_3 - VAR_9, 1);

                }

                else {

                    h263p_encode_umotion(VAR_0, VAR_2 - VAR_8);

                    h263p_encode_umotion(VAR_0, VAR_3 - VAR_9);

                    if (((VAR_2 - VAR_8) == 1) && ((VAR_3 - VAR_9) == 1))

                        

                        put_bits(&VAR_0->pb,1,1);

                }

            }

        }



        if(VAR_10){

            VAR_0->mv_bits+= get_bits_diff(VAR_0);

        }

    } else {

        assert(VAR_0->mb_intra);



        VAR_7 = 0;

        if (VAR_0->h263_aic) {

            

            for(VAR_6=0; VAR_6<6; VAR_6++) {

                int16_t level = VAR_1[VAR_6][0];

                int VAR_11;



                if(VAR_6<4) VAR_11= VAR_0->y_dc_scale;

                else    VAR_11= VAR_0->c_dc_scale;



                pred_dc = ff_h263_pred_dc(VAR_0, VAR_6, &dc_ptr[VAR_6]);

                level -= pred_dc;

                

                if (level >= 0)

                    level = (level + (VAR_11>>1))/VAR_11;

                else

                    level = (level - (VAR_11>>1))/VAR_11;



                

                if (level == 0 && VAR_0->block_last_index[VAR_6] == 0)

                    VAR_0->block_last_index[VAR_6] = -1;



                if(!VAR_0->modified_quant){

                    if (level < -127)

                        level = -127;

                    else if (level > 127)

                        level = 127;

                }



                VAR_1[VAR_6][0] = level;

                

                rec_intradc[VAR_6] = VAR_11*level + pred_dc;

                

                rec_intradc[VAR_6] |= 1;

                

                

                

                if (rec_intradc[VAR_6] < 0)

                    rec_intradc[VAR_6] = 0;

                else if (rec_intradc[VAR_6] > 2047)

                    rec_intradc[VAR_6] = 2047;



                

                *dc_ptr[VAR_6] = rec_intradc[VAR_6];

                if (VAR_0->block_last_index[VAR_6] >= 0)

                    VAR_7 |= 1 << (5 - VAR_6);

            }

        }else{

            for(VAR_6=0; VAR_6<6; VAR_6++) {

                

                if (VAR_0->block_last_index[VAR_6] >= 1)

                    VAR_7 |= 1 << (5 - VAR_6);

            }

        }



        VAR_4 = VAR_7 & 3;

        if (VAR_0->pict_type == AV_PICTURE_TYPE_I) {

            if(VAR_0->dquant) VAR_4+=4;

            put_bits(&VAR_0->pb,

                ff_h263_intra_MCBPC_bits[VAR_4],

                ff_h263_intra_MCBPC_code[VAR_4]);

        } else {

            if(VAR_0->dquant) VAR_4+=8;

            put_bits(&VAR_0->pb, 1, 0);     

            put_bits(&VAR_0->pb,

                ff_h263_inter_MCBPC_bits[VAR_4 + 4],

                ff_h263_inter_MCBPC_code[VAR_4 + 4]);

        }

        if (VAR_0->h263_aic) {

            

            put_bits(&VAR_0->pb, 1, 0);     

        }

        VAR_5 = VAR_7 >> 2;

        put_bits(&VAR_0->pb, ff_h263_cbpy_tab[VAR_5][1], ff_h263_cbpy_tab[VAR_5][0]);

        if(VAR_0->dquant)

            put_bits(&VAR_0->pb, 2, dquant_code[VAR_0->dquant+2]);



        if(VAR_10){

            VAR_0->misc_bits+= get_bits_diff(VAR_0);

        }

    }



    for(VAR_6=0; VAR_6<6; VAR_6++) {

        

        h263_encode_block(VAR_0, VAR_1[VAR_6], VAR_6);



        

        if (VAR_0->h263_aic && VAR_0->mb_intra) {

            VAR_1[VAR_6][0] = rec_intradc[VAR_6];



        }

    }



    if(VAR_10){

        if (!VAR_0->mb_intra) {

            VAR_0->p_tex_bits+= get_bits_diff(VAR_0);

            VAR_0->f_count++;

        }else{

            VAR_0->i_tex_bits+= get_bits_diff(VAR_0);

            VAR_0->i_count++;

        }

    }

}

void FUNC_0(MpegEncContext * VAR_0,
int16_t VAR_1[6][64],
int VAR_2, int VAR_3)
{ int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9; int16_t pred_dc; int16_t rec_intradc[6]; int16_t *dc_ptr[6]; const int VAR_10= (VAR_0->flags&CODEC_FLAG_PASS1); if (!VAR_0->mb_intra) { VAR_7= get_p_cbp(VAR_0, VAR_1, VAR_2, VAR_3); if ((VAR_7 | VAR_2 | VAR_3 | VAR_0->dquant | (VAR_0->mv_type - MV_TYPE_16X16)) == 0) { put_bits(&VAR_0->pb, 1, 1); if(VAR_10){ VAR_0->misc_bits++; VAR_0->last_bits++; } VAR_0->skip_count++; return; } put_bits(&VAR_0->pb, 1, 0); VAR_4 = VAR_7 & 3; VAR_5 = VAR_7 >> 2; if(VAR_0->alt_inter_vlc==0 || VAR_4!=3)
VAR_5 ^= 0xF; if(VAR_0->dquant) VAR_4+= 8; if(VAR_0->mv_type==MV_TYPE_16X16){ put_bits(&VAR_0->pb,
ff_h263_inter_MCBPC_bits[VAR_4],
ff_h263_inter_MCBPC_code[VAR_4]); put_bits(&VAR_0->pb, ff_h263_cbpy_tab[VAR_5][1], ff_h263_cbpy_tab[VAR_5][0]); if(VAR_0->dquant)
put_bits(&VAR_0->pb, 2, dquant_code[VAR_0->dquant+2]); if(VAR_10){ VAR_0->misc_bits+= get_bits_diff(VAR_0); } ff_h263_pred_motion(VAR_0, 0, 0, &VAR_8, &VAR_9); if (!VAR_0->umvplus) { ff_h263_encode_motion_vector(VAR_0, VAR_2 - VAR_8,
VAR_3 - VAR_9, 1); } else { h263p_encode_umotion(VAR_0, VAR_2 - VAR_8); h263p_encode_umotion(VAR_0, VAR_3 - VAR_9); if (((VAR_2 - VAR_8) == 1) && ((VAR_3 - VAR_9) == 1))
put_bits(&VAR_0->pb,1,1); } }else{ put_bits(&VAR_0->pb,
ff_h263_inter_MCBPC_bits[VAR_4+16],
ff_h263_inter_MCBPC_code[VAR_4+16]); put_bits(&VAR_0->pb, ff_h263_cbpy_tab[VAR_5][1], ff_h263_cbpy_tab[VAR_5][0]); if(VAR_0->dquant)
put_bits(&VAR_0->pb, 2, dquant_code[VAR_0->dquant+2]); if(VAR_10){ VAR_0->misc_bits+= get_bits_diff(VAR_0); } for(VAR_6=0; VAR_6<4; VAR_6++){ ff_h263_pred_motion(VAR_0, VAR_6, 0, &VAR_8, &VAR_9); VAR_2 = VAR_0->current_picture.motion_val[0][VAR_0->block_index[VAR_6]][0]; VAR_3 = VAR_0->current_picture.motion_val[0][VAR_0->block_index[VAR_6]][1]; if (!VAR_0->umvplus) { ff_h263_encode_motion_vector(VAR_0, VAR_2 - VAR_8,
VAR_3 - VAR_9, 1); } else { h263p_encode_umotion(VAR_0, VAR_2 - VAR_8); h263p_encode_umotion(VAR_0, VAR_3 - VAR_9); if (((VAR_2 - VAR_8) == 1) && ((VAR_3 - VAR_9) == 1))
put_bits(&VAR_0->pb,1,1); } } } if(VAR_10){ VAR_0->mv_bits+= get_bits_diff(VAR_0); } } else { assert(VAR_0->mb_intra); VAR_7 = 0; if (VAR_0->h263_aic) { for(VAR_6=0; VAR_6<6; VAR_6++) { int16_t level = VAR_1[VAR_6][0]; int VAR_11; if(VAR_6<4) VAR_11= VAR_0->y_dc_scale; else    VAR_11= VAR_0->c_dc_scale; pred_dc = ff_h263_pred_dc(VAR_0, VAR_6, &dc_ptr[VAR_6]); level -= pred_dc; if (level >= 0)
level = (level + (VAR_11>>1))/VAR_11; else
level = (level - (VAR_11>>1))/VAR_11; if (level == 0 && VAR_0->block_last_index[VAR_6] == 0)
VAR_0->block_last_index[VAR_6] = -1; if(!VAR_0->modified_quant){ if (level < -127)
level = -127; else if (level > 127)
level = 127; } VAR_1[VAR_6][0] = level; rec_intradc[VAR_6] = VAR_11*level + pred_dc; rec_intradc[VAR_6] |= 1; if (rec_intradc[VAR_6] < 0)
rec_intradc[VAR_6] = 0; else if (rec_intradc[VAR_6] > 2047)
rec_intradc[VAR_6] = 2047; *dc_ptr[VAR_6] = rec_intradc[VAR_6]; if (VAR_0->block_last_index[VAR_6] >= 0)
VAR_7 |= 1 << (5 - VAR_6); } }else{ for(VAR_6=0; VAR_6<6; VAR_6++) { if (VAR_0->block_last_index[VAR_6] >= 1)
VAR_7 |= 1 << (5 - VAR_6); } } VAR_4 = VAR_7 & 3; if (VAR_0->pict_type == AV_PICTURE_TYPE_I) { if(VAR_0->dquant) VAR_4+=4; put_bits(&VAR_0->pb,
ff_h263_intra_MCBPC_bits[VAR_4],
ff_h263_intra_MCBPC_code[VAR_4]); } else { if(VAR_0->dquant) VAR_4+=8; put_bits(&VAR_0->pb, 1, 0); put_bits(&VAR_0->pb,
ff_h263_inter_MCBPC_bits[VAR_4 + 4],
ff_h263_inter_MCBPC_code[VAR_4 + 4]); } if (VAR_0->h263_aic) { put_bits(&VAR_0->pb, 1, 0); } VAR_5 = VAR_7 >> 2; put_bits(&VAR_0->pb, ff_h263_cbpy_tab[VAR_5][1], ff_h263_cbpy_tab[VAR_5][0]); if(VAR_0->dquant)
put_bits(&VAR_0->pb, 2, dquant_code[VAR_0->dquant+2]); if(VAR_10){ VAR_0->misc_bits+= get_bits_diff(VAR_0); } } for(VAR_6=0; VAR_6<6; VAR_6++) { h263_encode_block(VAR_0, VAR_1[VAR_6], VAR_6); if (VAR_0->h263_aic && VAR_0->mb_intra) { VAR_1[VAR_6][0] = rec_intradc[VAR_6]; } } if(VAR_10){ if (!VAR_0->mb_intra) { VAR_0->p_tex_bits+= get_bits_diff(VAR_0); VAR_0->f_count++; }else{ VAR_0->i_tex_bits+= get_bits_diff(VAR_0); VAR_0->i_count++; } } }