void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],

                            int lowres_flag, int is_mpeg12)

{

    int mb_x, mb_y;

    const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;

#if CONFIG_MPEG_XVMC_DECODER

    if(s->avctx->xvmc_acceleration){

        ff_xvmc_decode_mb(s);//xvmc uses pblocks

        return;

    }

#endif



    mb_x = s->mb_x;

    mb_y = s->mb_y;



    if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {

       /* save DCT coefficients */

       int i,j;

       DCTELEM *dct = &s->current_picture.dct_coeff[mb_xy*64*6];

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

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

               *dct++ = block[i][s->dsp.idct_permutation[j]];

    }



    s->current_picture.qscale_table[mb_xy]= s->qscale;



    /* update DC predictors for P macroblocks */

    if (!s->mb_intra) {

        if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) {

            if(s->mbintra_table[mb_xy])

                ff_clean_intra_table_entries(s);

        } else {

            s->last_dc[0] =

            s->last_dc[1] =

            s->last_dc[2] = 128 << s->intra_dc_precision;

        }

    }

    else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))

        s->mbintra_table[mb_xy]=1;



    if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==FF_B_TYPE) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc

        uint8_t *dest_y, *dest_cb, *dest_cr;

        int dct_linesize, dct_offset;

        op_pixels_func (*op_pix)[4];

        qpel_mc_func (*op_qpix)[16];

        const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics

        const int uvlinesize= s->current_picture.linesize[1];

        const int readable= s->pict_type != FF_B_TYPE || s->encoding || s->avctx->draw_horiz_band || lowres_flag;

        const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8;



        /* avoid copy if macroblock skipped in last frame too */

        /* skip only during decoding as we might trash the buffers during encoding a bit */

        if(!s->encoding){

            uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy];

            const int age= s->current_picture.age;



            assert(age);



            if (s->mb_skipped) {

                s->mb_skipped= 0;

                assert(s->pict_type!=FF_I_TYPE);



                (*mbskip_ptr) ++; /* indicate that this time we skipped it */

                if(*mbskip_ptr >99) *mbskip_ptr= 99;



                /* if previous was skipped too, then nothing to do !  */

                if (*mbskip_ptr >= age && s->current_picture.reference){

                    return;

                }

            } else if(!s->current_picture.reference){

                (*mbskip_ptr) ++; /* increase counter so the age can be compared cleanly */

                if(*mbskip_ptr >99) *mbskip_ptr= 99;

            } else{

                *mbskip_ptr = 0; /* not skipped */

            }

        }



        dct_linesize = linesize << s->interlaced_dct;

        dct_offset =(s->interlaced_dct)? linesize : linesize*block_size;



        if(readable){

            dest_y=  s->dest[0];

            dest_cb= s->dest[1];

            dest_cr= s->dest[2];

        }else{

            dest_y = s->b_scratchpad;

            dest_cb= s->b_scratchpad+16*linesize;

            dest_cr= s->b_scratchpad+32*linesize;

        }



        if (!s->mb_intra) {

            /* motion handling */

            /* decoding or more than one mb_type (MC was already done otherwise) */

            if(!s->encoding){

                if(lowres_flag){

                    h264_chroma_mc_func *op_pix = s->dsp.put_h264_chroma_pixels_tab;



                    if (s->mv_dir & MV_DIR_FORWARD) {

                        MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix);

                        op_pix = s->dsp.avg_h264_chroma_pixels_tab;

                    }

                    if (s->mv_dir & MV_DIR_BACKWARD) {

                        MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix);

                    }

                }else{

                    op_qpix= s->me.qpel_put;

                    if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){

                        op_pix = s->dsp.put_pixels_tab;

                    }else{

                        op_pix = s->dsp.put_no_rnd_pixels_tab;

                    }

                    if (s->mv_dir & MV_DIR_FORWARD) {

                        MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix);

                        op_pix = s->dsp.avg_pixels_tab;

                        op_qpix= s->me.qpel_avg;

                    }

                    if (s->mv_dir & MV_DIR_BACKWARD) {

                        MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix);

                    }

                }

            }



            /* skip dequant / idct if we are really late ;) */

            if(s->hurry_up>1) goto skip_idct;

            if(s->avctx->skip_idct){

                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)

                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)

                   || s->avctx->skip_idct >= AVDISCARD_ALL)

                    goto skip_idct;

            }



            /* add dct residue */

            if(s->encoding || !(   s->h263_msmpeg4 || s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO

                                || (s->codec_id==CODEC_ID_MPEG4 && !s->mpeg_quant))){

                add_dequant_dct(s, block[0], 0, dest_y                          , dct_linesize, s->qscale);

                add_dequant_dct(s, block[1], 1, dest_y              + block_size, dct_linesize, s->qscale);

                add_dequant_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);

                add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if (s->chroma_y_shift){

                        add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);

                        add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);

                    }else{

                        dct_linesize >>= 1;

                        dct_offset >>=1;

                        add_dequant_dct(s, block[4], 4, dest_cb,              dct_linesize, s->chroma_qscale);

                        add_dequant_dct(s, block[5], 5, dest_cr,              dct_linesize, s->chroma_qscale);

                        add_dequant_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);

                        add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);

                    }

                }

            } else if(is_mpeg12 || (s->codec_id != CODEC_ID_WMV2)){

                add_dct(s, block[0], 0, dest_y                          , dct_linesize);

                add_dct(s, block[1], 1, dest_y              + block_size, dct_linesize);

                add_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize);

                add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if(s->chroma_y_shift){//Chroma420

                        add_dct(s, block[4], 4, dest_cb, uvlinesize);

                        add_dct(s, block[5], 5, dest_cr, uvlinesize);

                    }else{

                        //chroma422

                        dct_linesize = uvlinesize << s->interlaced_dct;

                        dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;



                        add_dct(s, block[4], 4, dest_cb, dct_linesize);

                        add_dct(s, block[5], 5, dest_cr, dct_linesize);

                        add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize);

                        add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize);

                        if(!s->chroma_x_shift){//Chroma444

                            add_dct(s, block[8], 8, dest_cb+8, dct_linesize);

                            add_dct(s, block[9], 9, dest_cr+8, dct_linesize);

                            add_dct(s, block[10], 10, dest_cb+8+dct_offset, dct_linesize);

                            add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize);

                        }

                    }

                }//fi gray

            }

            else if (CONFIG_WMV2) {

                ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr);

            }

        } else {

            /* dct only in intra block */

            if(s->encoding || !(s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO)){

                put_dct(s, block[0], 0, dest_y                          , dct_linesize, s->qscale);

                put_dct(s, block[1], 1, dest_y              + block_size, dct_linesize, s->qscale);

                put_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);

                put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if(s->chroma_y_shift){

                        put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);

                        put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);

                    }else{

                        dct_offset >>=1;

                        dct_linesize >>=1;

                        put_dct(s, block[4], 4, dest_cb,              dct_linesize, s->chroma_qscale);

                        put_dct(s, block[5], 5, dest_cr,              dct_linesize, s->chroma_qscale);

                        put_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);

                        put_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);

                    }

                }

            }else{

                s->dsp.idct_put(dest_y                          , dct_linesize, block[0]);

                s->dsp.idct_put(dest_y              + block_size, dct_linesize, block[1]);

                s->dsp.idct_put(dest_y + dct_offset             , dct_linesize, block[2]);

                s->dsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if(s->chroma_y_shift){

                        s->dsp.idct_put(dest_cb, uvlinesize, block[4]);

                        s->dsp.idct_put(dest_cr, uvlinesize, block[5]);

                    }else{



                        dct_linesize = uvlinesize << s->interlaced_dct;

                        dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;



                        s->dsp.idct_put(dest_cb,              dct_linesize, block[4]);

                        s->dsp.idct_put(dest_cr,              dct_linesize, block[5]);

                        s->dsp.idct_put(dest_cb + dct_offset, dct_linesize, block[6]);

                        s->dsp.idct_put(dest_cr + dct_offset, dct_linesize, block[7]);

                        if(!s->chroma_x_shift){//Chroma444

                            s->dsp.idct_put(dest_cb + 8,              dct_linesize, block[8]);

                            s->dsp.idct_put(dest_cr + 8,              dct_linesize, block[9]);

                            s->dsp.idct_put(dest_cb + 8 + dct_offset, dct_linesize, block[10]);

                            s->dsp.idct_put(dest_cr + 8 + dct_offset, dct_linesize, block[11]);

                        }

                    }

                }//gray

            }

        }

skip_idct:

        if(!readable){

            s->dsp.put_pixels_tab[0][0](s->dest[0], dest_y ,   linesize,16);

            s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);

            s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift);

        }

    }

}

void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],

                            int lowres_flag, int is_mpeg12)

{

    int mb_x, mb_y;

    const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;

#if CONFIG_MPEG_XVMC_DECODER

    if(s->avctx->xvmc_acceleration){

        ff_xvmc_decode_mb(s);

        return;

    }

#endif



    mb_x = s->mb_x;

    mb_y = s->mb_y;



    if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {

       

       int i,j;

       DCTELEM *dct = &s->current_picture.dct_coeff[mb_xy*64*6];

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

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

               *dct++ = block[i][s->dsp.idct_permutation[j]];

    }



    s->current_picture.qscale_table[mb_xy]= s->qscale;



    

    if (!s->mb_intra) {

        if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) {

            if(s->mbintra_table[mb_xy])

                ff_clean_intra_table_entries(s);

        } else {

            s->last_dc[0] =

            s->last_dc[1] =

            s->last_dc[2] = 128 << s->intra_dc_precision;

        }

    }

    else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))

        s->mbintra_table[mb_xy]=1;



    if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==FF_B_TYPE) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { 

        uint8_t *dest_y, *dest_cb, *dest_cr;

        int dct_linesize, dct_offset;

        op_pixels_func (*op_pix)[4];

        qpel_mc_func (*op_qpix)[16];

        const int linesize= s->current_picture.linesize[0]; 

        const int uvlinesize= s->current_picture.linesize[1];

        const int readable= s->pict_type != FF_B_TYPE || s->encoding || s->avctx->draw_horiz_band || lowres_flag;

        const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8;



        

        

        if(!s->encoding){

            uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy];

            const int age= s->current_picture.age;



            assert(age);



            if (s->mb_skipped) {

                s->mb_skipped= 0;

                assert(s->pict_type!=FF_I_TYPE);



                (*mbskip_ptr) ++; 

                if(*mbskip_ptr >99) *mbskip_ptr= 99;



                

                if (*mbskip_ptr >= age && s->current_picture.reference){

                    return;

                }

            } else if(!s->current_picture.reference){

                (*mbskip_ptr) ++; 

                if(*mbskip_ptr >99) *mbskip_ptr= 99;

            } else{

                *mbskip_ptr = 0; 

            }

        }



        dct_linesize = linesize << s->interlaced_dct;

        dct_offset =(s->interlaced_dct)? linesize : linesize*block_size;



        if(readable){

            dest_y=  s->dest[0];

            dest_cb= s->dest[1];

            dest_cr= s->dest[2];

        }else{

            dest_y = s->b_scratchpad;

            dest_cb= s->b_scratchpad+16*linesize;

            dest_cr= s->b_scratchpad+32*linesize;

        }



        if (!s->mb_intra) {

            

            

            if(!s->encoding){

                if(lowres_flag){

                    h264_chroma_mc_func *op_pix = s->dsp.put_h264_chroma_pixels_tab;



                    if (s->mv_dir & MV_DIR_FORWARD) {

                        MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix);

                        op_pix = s->dsp.avg_h264_chroma_pixels_tab;

                    }

                    if (s->mv_dir & MV_DIR_BACKWARD) {

                        MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix);

                    }

                }else{

                    op_qpix= s->me.qpel_put;

                    if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){

                        op_pix = s->dsp.put_pixels_tab;

                    }else{

                        op_pix = s->dsp.put_no_rnd_pixels_tab;

                    }

                    if (s->mv_dir & MV_DIR_FORWARD) {

                        MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix);

                        op_pix = s->dsp.avg_pixels_tab;

                        op_qpix= s->me.qpel_avg;

                    }

                    if (s->mv_dir & MV_DIR_BACKWARD) {

                        MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix);

                    }

                }

            }



            

            if(s->hurry_up>1) goto skip_idct;

            if(s->avctx->skip_idct){

                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)

                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)

                   || s->avctx->skip_idct >= AVDISCARD_ALL)

                    goto skip_idct;

            }



            

            if(s->encoding || !(   s->h263_msmpeg4 || s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO

                                || (s->codec_id==CODEC_ID_MPEG4 && !s->mpeg_quant))){

                add_dequant_dct(s, block[0], 0, dest_y                          , dct_linesize, s->qscale);

                add_dequant_dct(s, block[1], 1, dest_y              + block_size, dct_linesize, s->qscale);

                add_dequant_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);

                add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if (s->chroma_y_shift){

                        add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);

                        add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);

                    }else{

                        dct_linesize >>= 1;

                        dct_offset >>=1;

                        add_dequant_dct(s, block[4], 4, dest_cb,              dct_linesize, s->chroma_qscale);

                        add_dequant_dct(s, block[5], 5, dest_cr,              dct_linesize, s->chroma_qscale);

                        add_dequant_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);

                        add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);

                    }

                }

            } else if(is_mpeg12 || (s->codec_id != CODEC_ID_WMV2)){

                add_dct(s, block[0], 0, dest_y                          , dct_linesize);

                add_dct(s, block[1], 1, dest_y              + block_size, dct_linesize);

                add_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize);

                add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if(s->chroma_y_shift){

                        add_dct(s, block[4], 4, dest_cb, uvlinesize);

                        add_dct(s, block[5], 5, dest_cr, uvlinesize);

                    }else{

                        

                        dct_linesize = uvlinesize << s->interlaced_dct;

                        dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;



                        add_dct(s, block[4], 4, dest_cb, dct_linesize);

                        add_dct(s, block[5], 5, dest_cr, dct_linesize);

                        add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize);

                        add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize);

                        if(!s->chroma_x_shift){

                            add_dct(s, block[8], 8, dest_cb+8, dct_linesize);

                            add_dct(s, block[9], 9, dest_cr+8, dct_linesize);

                            add_dct(s, block[10], 10, dest_cb+8+dct_offset, dct_linesize);

                            add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize);

                        }

                    }

                }

            }

            else if (CONFIG_WMV2) {

                ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr);

            }

        } else {

            

            if(s->encoding || !(s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO)){

                put_dct(s, block[0], 0, dest_y                          , dct_linesize, s->qscale);

                put_dct(s, block[1], 1, dest_y              + block_size, dct_linesize, s->qscale);

                put_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);

                put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if(s->chroma_y_shift){

                        put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);

                        put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);

                    }else{

                        dct_offset >>=1;

                        dct_linesize >>=1;

                        put_dct(s, block[4], 4, dest_cb,              dct_linesize, s->chroma_qscale);

                        put_dct(s, block[5], 5, dest_cr,              dct_linesize, s->chroma_qscale);

                        put_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);

                        put_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);

                    }

                }

            }else{

                s->dsp.idct_put(dest_y                          , dct_linesize, block[0]);

                s->dsp.idct_put(dest_y              + block_size, dct_linesize, block[1]);

                s->dsp.idct_put(dest_y + dct_offset             , dct_linesize, block[2]);

                s->dsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);



                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){

                    if(s->chroma_y_shift){

                        s->dsp.idct_put(dest_cb, uvlinesize, block[4]);

                        s->dsp.idct_put(dest_cr, uvlinesize, block[5]);

                    }else{



                        dct_linesize = uvlinesize << s->interlaced_dct;

                        dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;



                        s->dsp.idct_put(dest_cb,              dct_linesize, block[4]);

                        s->dsp.idct_put(dest_cr,              dct_linesize, block[5]);

                        s->dsp.idct_put(dest_cb + dct_offset, dct_linesize, block[6]);

                        s->dsp.idct_put(dest_cr + dct_offset, dct_linesize, block[7]);

                        if(!s->chroma_x_shift){

                            s->dsp.idct_put(dest_cb + 8,              dct_linesize, block[8]);

                            s->dsp.idct_put(dest_cr + 8,              dct_linesize, block[9]);

                            s->dsp.idct_put(dest_cb + 8 + dct_offset, dct_linesize, block[10]);

                            s->dsp.idct_put(dest_cr + 8 + dct_offset, dct_linesize, block[11]);

                        }

                    }

                }

            }

        }

skip_idct:

        if(!readable){

            s->dsp.put_pixels_tab[0][0](s->dest[0], dest_y ,   linesize,16);

            s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);

            s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift);

        }

    }

}

void FUNC_0(MpegEncContext *VAR_0, DCTELEM VAR_1[12][64],

                            int VAR_2, int VAR_3)

{

    int VAR_4, VAR_5;

    const int VAR_6 = VAR_0->VAR_5 * VAR_0->mb_stride + VAR_0->VAR_4;

#if CONFIG_MPEG_XVMC_DECODER

    if(VAR_0->avctx->xvmc_acceleration){

        ff_xvmc_decode_mb(VAR_0);

        return;

    }

#endif



    VAR_4 = VAR_0->VAR_4;

    VAR_5 = VAR_0->VAR_5;



    if(VAR_0->avctx->debug&FF_DEBUG_DCT_COEFF) {

       

       int VAR_7,VAR_8;

       DCTELEM *dct = &VAR_0->current_picture.dct_coeff[VAR_6*64*6];

       for(VAR_7=0; VAR_7<6; VAR_7++)

           for(VAR_8=0; VAR_8<64; VAR_8++)

               *dct++ = VAR_1[VAR_7][VAR_0->dsp.idct_permutation[VAR_8]];

    }



    VAR_0->current_picture.qscale_table[VAR_6]= VAR_0->qscale;



    

    if (!VAR_0->mb_intra) {

        if (!VAR_3 && (VAR_0->h263_pred || VAR_0->h263_aic)) {

            if(VAR_0->mbintra_table[VAR_6])

                ff_clean_intra_table_entries(VAR_0);

        } else {

            VAR_0->last_dc[0] =

            VAR_0->last_dc[1] =

            VAR_0->last_dc[2] = 128 << VAR_0->intra_dc_precision;

        }

    }

    else if (!VAR_3 && (VAR_0->h263_pred || VAR_0->h263_aic))

        VAR_0->mbintra_table[VAR_6]=1;



    if ((VAR_0->flags&CODEC_FLAG_PSNR) || !(VAR_0->encoding && (VAR_0->intra_only || VAR_0->pict_type==FF_B_TYPE) && VAR_0->avctx->mb_decision != FF_MB_DECISION_RD)) { 

        uint8_t *dest_y, *dest_cb, *dest_cr;

        int VAR_9, VAR_10;

        op_pixels_func (*op_pix)[4];

        qpel_mc_func (*op_qpix)[16];

        const int VAR_11= VAR_0->current_picture.VAR_11[0]; 

        const int VAR_12= VAR_0->current_picture.VAR_11[1];

        const int VAR_13= VAR_0->pict_type != FF_B_TYPE || VAR_0->encoding || VAR_0->avctx->draw_horiz_band || VAR_2;

        const int VAR_14= VAR_2 ? 8>>VAR_0->avctx->lowres : 8;



        

        

        if(!VAR_0->encoding){

            uint8_t *mbskip_ptr = &VAR_0->mbskip_table[VAR_6];

            const int VAR_15= VAR_0->current_picture.VAR_15;



            assert(VAR_15);



            if (VAR_0->mb_skipped) {

                VAR_0->mb_skipped= 0;

                assert(VAR_0->pict_type!=FF_I_TYPE);



                (*mbskip_ptr) ++; 

                if(*mbskip_ptr >99) *mbskip_ptr= 99;



                

                if (*mbskip_ptr >= VAR_15 && VAR_0->current_picture.reference){

                    return;

                }

            } else if(!VAR_0->current_picture.reference){

                (*mbskip_ptr) ++; 

                if(*mbskip_ptr >99) *mbskip_ptr= 99;

            } else{

                *mbskip_ptr = 0; 

            }

        }



        VAR_9 = VAR_11 << VAR_0->interlaced_dct;

        VAR_10 =(VAR_0->interlaced_dct)? VAR_11 : VAR_11*VAR_14;



        if(VAR_13){

            dest_y=  VAR_0->dest[0];

            dest_cb= VAR_0->dest[1];

            dest_cr= VAR_0->dest[2];

        }else{

            dest_y = VAR_0->b_scratchpad;

            dest_cb= VAR_0->b_scratchpad+16*VAR_11;

            dest_cr= VAR_0->b_scratchpad+32*VAR_11;

        }



        if (!VAR_0->mb_intra) {

            

            

            if(!VAR_0->encoding){

                if(VAR_2){

                    h264_chroma_mc_func *op_pix = VAR_0->dsp.put_h264_chroma_pixels_tab;



                    if (VAR_0->mv_dir & MV_DIR_FORWARD) {

                        MPV_motion_lowres(VAR_0, dest_y, dest_cb, dest_cr, 0, VAR_0->last_picture.data, op_pix);

                        op_pix = VAR_0->dsp.avg_h264_chroma_pixels_tab;

                    }

                    if (VAR_0->mv_dir & MV_DIR_BACKWARD) {

                        MPV_motion_lowres(VAR_0, dest_y, dest_cb, dest_cr, 1, VAR_0->next_picture.data, op_pix);

                    }

                }else{

                    op_qpix= VAR_0->me.qpel_put;

                    if ((!VAR_0->no_rounding) || VAR_0->pict_type==FF_B_TYPE){

                        op_pix = VAR_0->dsp.put_pixels_tab;

                    }else{

                        op_pix = VAR_0->dsp.put_no_rnd_pixels_tab;

                    }

                    if (VAR_0->mv_dir & MV_DIR_FORWARD) {

                        MPV_motion(VAR_0, dest_y, dest_cb, dest_cr, 0, VAR_0->last_picture.data, op_pix, op_qpix);

                        op_pix = VAR_0->dsp.avg_pixels_tab;

                        op_qpix= VAR_0->me.qpel_avg;

                    }

                    if (VAR_0->mv_dir & MV_DIR_BACKWARD) {

                        MPV_motion(VAR_0, dest_y, dest_cb, dest_cr, 1, VAR_0->next_picture.data, op_pix, op_qpix);

                    }

                }

            }



            

            if(VAR_0->hurry_up>1) goto skip_idct;

            if(VAR_0->avctx->skip_idct){

                if(  (VAR_0->avctx->skip_idct >= AVDISCARD_NONREF && VAR_0->pict_type == FF_B_TYPE)

                   ||(VAR_0->avctx->skip_idct >= AVDISCARD_NONKEY && VAR_0->pict_type != FF_I_TYPE)

                   || VAR_0->avctx->skip_idct >= AVDISCARD_ALL)

                    goto skip_idct;

            }



            

            if(VAR_0->encoding || !(   VAR_0->h263_msmpeg4 || VAR_0->codec_id==CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==CODEC_ID_MPEG2VIDEO

                                || (VAR_0->codec_id==CODEC_ID_MPEG4 && !VAR_0->mpeg_quant))){

                add_dequant_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_9, VAR_0->qscale);

                add_dequant_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_14, VAR_9, VAR_0->qscale);

                add_dequant_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_10             , VAR_9, VAR_0->qscale);

                add_dequant_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_10 + VAR_14, VAR_9, VAR_0->qscale);



                if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){

                    if (VAR_0->chroma_y_shift){

                        add_dequant_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_12, VAR_0->chroma_qscale);

                        add_dequant_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_12, VAR_0->chroma_qscale);

                    }else{

                        VAR_9 >>= 1;

                        VAR_10 >>=1;

                        add_dequant_dct(VAR_0, VAR_1[4], 4, dest_cb,              VAR_9, VAR_0->chroma_qscale);

                        add_dequant_dct(VAR_0, VAR_1[5], 5, dest_cr,              VAR_9, VAR_0->chroma_qscale);

                        add_dequant_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_10, VAR_9, VAR_0->chroma_qscale);

                        add_dequant_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_10, VAR_9, VAR_0->chroma_qscale);

                    }

                }

            } else if(VAR_3 || (VAR_0->codec_id != CODEC_ID_WMV2)){

                add_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_9);

                add_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_14, VAR_9);

                add_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_10             , VAR_9);

                add_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_10 + VAR_14, VAR_9);



                if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){

                    if(VAR_0->chroma_y_shift){

                        add_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_12);

                        add_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_12);

                    }else{

                        

                        VAR_9 = VAR_12 << VAR_0->interlaced_dct;

                        VAR_10 =(VAR_0->interlaced_dct)? VAR_12 : VAR_12*8;



                        add_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_9);

                        add_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_9);

                        add_dct(VAR_0, VAR_1[6], 6, dest_cb+VAR_10, VAR_9);

                        add_dct(VAR_0, VAR_1[7], 7, dest_cr+VAR_10, VAR_9);

                        if(!VAR_0->chroma_x_shift){

                            add_dct(VAR_0, VAR_1[8], 8, dest_cb+8, VAR_9);

                            add_dct(VAR_0, VAR_1[9], 9, dest_cr+8, VAR_9);

                            add_dct(VAR_0, VAR_1[10], 10, dest_cb+8+VAR_10, VAR_9);

                            add_dct(VAR_0, VAR_1[11], 11, dest_cr+8+VAR_10, VAR_9);

                        }

                    }

                }

            }

            else if (CONFIG_WMV2) {

                ff_wmv2_add_mb(VAR_0, VAR_1, dest_y, dest_cb, dest_cr);

            }

        } else {

            

            if(VAR_0->encoding || !(VAR_0->codec_id==CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==CODEC_ID_MPEG2VIDEO)){

                put_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_9, VAR_0->qscale);

                put_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_14, VAR_9, VAR_0->qscale);

                put_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_10             , VAR_9, VAR_0->qscale);

                put_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_10 + VAR_14, VAR_9, VAR_0->qscale);



                if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){

                    if(VAR_0->chroma_y_shift){

                        put_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_12, VAR_0->chroma_qscale);

                        put_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_12, VAR_0->chroma_qscale);

                    }else{

                        VAR_10 >>=1;

                        VAR_9 >>=1;

                        put_dct(VAR_0, VAR_1[4], 4, dest_cb,              VAR_9, VAR_0->chroma_qscale);

                        put_dct(VAR_0, VAR_1[5], 5, dest_cr,              VAR_9, VAR_0->chroma_qscale);

                        put_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_10, VAR_9, VAR_0->chroma_qscale);

                        put_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_10, VAR_9, VAR_0->chroma_qscale);

                    }

                }

            }else{

                VAR_0->dsp.idct_put(dest_y                          , VAR_9, VAR_1[0]);

                VAR_0->dsp.idct_put(dest_y              + VAR_14, VAR_9, VAR_1[1]);

                VAR_0->dsp.idct_put(dest_y + VAR_10             , VAR_9, VAR_1[2]);

                VAR_0->dsp.idct_put(dest_y + VAR_10 + VAR_14, VAR_9, VAR_1[3]);



                if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){

                    if(VAR_0->chroma_y_shift){

                        VAR_0->dsp.idct_put(dest_cb, VAR_12, VAR_1[4]);

                        VAR_0->dsp.idct_put(dest_cr, VAR_12, VAR_1[5]);

                    }else{



                        VAR_9 = VAR_12 << VAR_0->interlaced_dct;

                        VAR_10 =(VAR_0->interlaced_dct)? VAR_12 : VAR_12*8;



                        VAR_0->dsp.idct_put(dest_cb,              VAR_9, VAR_1[4]);

                        VAR_0->dsp.idct_put(dest_cr,              VAR_9, VAR_1[5]);

                        VAR_0->dsp.idct_put(dest_cb + VAR_10, VAR_9, VAR_1[6]);

                        VAR_0->dsp.idct_put(dest_cr + VAR_10, VAR_9, VAR_1[7]);

                        if(!VAR_0->chroma_x_shift){

                            VAR_0->dsp.idct_put(dest_cb + 8,              VAR_9, VAR_1[8]);

                            VAR_0->dsp.idct_put(dest_cr + 8,              VAR_9, VAR_1[9]);

                            VAR_0->dsp.idct_put(dest_cb + 8 + VAR_10, VAR_9, VAR_1[10]);

                            VAR_0->dsp.idct_put(dest_cr + 8 + VAR_10, VAR_9, VAR_1[11]);

                        }

                    }

                }

            }

        }

skip_idct:

        if(!VAR_13){

            VAR_0->dsp.put_pixels_tab[0][0](VAR_0->dest[0], dest_y ,   VAR_11,16);

            VAR_0->dsp.put_pixels_tab[VAR_0->chroma_x_shift][0](VAR_0->dest[1], dest_cb, VAR_12,16 >> VAR_0->chroma_y_shift);

            VAR_0->dsp.put_pixels_tab[VAR_0->chroma_x_shift][0](VAR_0->dest[2], dest_cr, VAR_12,16 >> VAR_0->chroma_y_shift);

        }

    }

}

void FUNC_0(MpegEncContext *VAR_0, DCTELEM VAR_1[12][64],
int VAR_2, int VAR_3)
{ int VAR_4, VAR_5; const int VAR_6 = VAR_0->VAR_5 * VAR_0->mb_stride + VAR_0->VAR_4; #if CONFIG_MPEG_XVMC_DECODER
if(VAR_0->avctx->xvmc_acceleration){ ff_xvmc_decode_mb(VAR_0); return; } #endif
VAR_4 = VAR_0->VAR_4; VAR_5 = VAR_0->VAR_5; if(VAR_0->avctx->debug&FF_DEBUG_DCT_COEFF) { int VAR_7,VAR_8; DCTELEM *dct = &VAR_0->current_picture.dct_coeff[VAR_6*64*6]; for(VAR_7=0; VAR_7<6; VAR_7++) for(VAR_8=0; VAR_8<64; VAR_8++) *dct++ = VAR_1[VAR_7][VAR_0->dsp.idct_permutation[VAR_8]]; } VAR_0->current_picture.qscale_table[VAR_6]= VAR_0->qscale; if (!VAR_0->mb_intra) { if (!VAR_3 && (VAR_0->h263_pred || VAR_0->h263_aic)) { if(VAR_0->mbintra_table[VAR_6])
ff_clean_intra_table_entries(VAR_0); } else { VAR_0->last_dc[0] =
VAR_0->last_dc[1] =
VAR_0->last_dc[2] = 128 << VAR_0->intra_dc_precision; } } else if (!VAR_3 && (VAR_0->h263_pred || VAR_0->h263_aic))
VAR_0->mbintra_table[VAR_6]=1; if ((VAR_0->flags&CODEC_FLAG_PSNR) || !(VAR_0->encoding && (VAR_0->intra_only || VAR_0->pict_type==FF_B_TYPE) && VAR_0->avctx->mb_decision != FF_MB_DECISION_RD)) { uint8_t *dest_y, *dest_cb, *dest_cr; int VAR_9, VAR_10; op_pixels_func (*op_pix)[4]; qpel_mc_func (*op_qpix)[16]; const int VAR_11= VAR_0->current_picture.VAR_11[0]; const int VAR_12= VAR_0->current_picture.VAR_11[1]; const int VAR_13= VAR_0->pict_type != FF_B_TYPE || VAR_0->encoding || VAR_0->avctx->draw_horiz_band || VAR_2; const int VAR_14= VAR_2 ? 8>>VAR_0->avctx->lowres : 8; if(!VAR_0->encoding){ uint8_t *mbskip_ptr = &VAR_0->mbskip_table[VAR_6]; const int VAR_15= VAR_0->current_picture.VAR_15; assert(VAR_15); if (VAR_0->mb_skipped) { VAR_0->mb_skipped= 0; assert(VAR_0->pict_type!=FF_I_TYPE); (*mbskip_ptr) ++; if(*mbskip_ptr >99) *mbskip_ptr= 99; if (*mbskip_ptr >= VAR_15 && VAR_0->current_picture.reference){ return; } } else if(!VAR_0->current_picture.reference){ (*mbskip_ptr) ++; if(*mbskip_ptr >99) *mbskip_ptr= 99; } else{ *mbskip_ptr = 0; } } VAR_9 = VAR_11 << VAR_0->interlaced_dct; VAR_10 =(VAR_0->interlaced_dct)? VAR_11 : VAR_11*VAR_14; if(VAR_13){ dest_y=  VAR_0->dest[0]; dest_cb= VAR_0->dest[1]; dest_cr= VAR_0->dest[2]; }else{ dest_y = VAR_0->b_scratchpad; dest_cb= VAR_0->b_scratchpad+16*VAR_11; dest_cr= VAR_0->b_scratchpad+32*VAR_11; } if (!VAR_0->mb_intra) { if(!VAR_0->encoding){ if(VAR_2){ h264_chroma_mc_func *op_pix = VAR_0->dsp.put_h264_chroma_pixels_tab; if (VAR_0->mv_dir & MV_DIR_FORWARD) { MPV_motion_lowres(VAR_0, dest_y, dest_cb, dest_cr, 0, VAR_0->last_picture.data, op_pix); op_pix = VAR_0->dsp.avg_h264_chroma_pixels_tab; } if (VAR_0->mv_dir & MV_DIR_BACKWARD) { MPV_motion_lowres(VAR_0, dest_y, dest_cb, dest_cr, 1, VAR_0->next_picture.data, op_pix); } }else{ op_qpix= VAR_0->me.qpel_put; if ((!VAR_0->no_rounding) || VAR_0->pict_type==FF_B_TYPE){ op_pix = VAR_0->dsp.put_pixels_tab; }else{ op_pix = VAR_0->dsp.put_no_rnd_pixels_tab; } if (VAR_0->mv_dir & MV_DIR_FORWARD) { MPV_motion(VAR_0, dest_y, dest_cb, dest_cr, 0, VAR_0->last_picture.data, op_pix, op_qpix); op_pix = VAR_0->dsp.avg_pixels_tab; op_qpix= VAR_0->me.qpel_avg; } if (VAR_0->mv_dir & MV_DIR_BACKWARD) { MPV_motion(VAR_0, dest_y, dest_cb, dest_cr, 1, VAR_0->next_picture.data, op_pix, op_qpix); } } } if(VAR_0->hurry_up>1) goto skip_idct; if(VAR_0->avctx->skip_idct){ if(  (VAR_0->avctx->skip_idct >= AVDISCARD_NONREF && VAR_0->pict_type == FF_B_TYPE)
||(VAR_0->avctx->skip_idct >= AVDISCARD_NONKEY && VAR_0->pict_type != FF_I_TYPE)
|| VAR_0->avctx->skip_idct >= AVDISCARD_ALL)
goto skip_idct; } if(VAR_0->encoding || !(   VAR_0->h263_msmpeg4 || VAR_0->codec_id==CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==CODEC_ID_MPEG2VIDEO
|| (VAR_0->codec_id==CODEC_ID_MPEG4 && !VAR_0->mpeg_quant))){ add_dequant_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_9, VAR_0->qscale); add_dequant_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_14, VAR_9, VAR_0->qscale); add_dequant_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_10             , VAR_9, VAR_0->qscale); add_dequant_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_10 + VAR_14, VAR_9, VAR_0->qscale); if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){ if (VAR_0->chroma_y_shift){ add_dequant_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_12, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_12, VAR_0->chroma_qscale); }else{ VAR_9 >>= 1; VAR_10 >>=1; add_dequant_dct(VAR_0, VAR_1[4], 4, dest_cb,              VAR_9, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[5], 5, dest_cr,              VAR_9, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_10, VAR_9, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_10, VAR_9, VAR_0->chroma_qscale); } } } else if(VAR_3 || (VAR_0->codec_id != CODEC_ID_WMV2)){ add_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_9); add_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_14, VAR_9); add_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_10             , VAR_9); add_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_10 + VAR_14, VAR_9); if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){ if(VAR_0->chroma_y_shift){ add_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_12); add_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_12); }else{ VAR_9 = VAR_12 << VAR_0->interlaced_dct; VAR_10 =(VAR_0->interlaced_dct)? VAR_12 : VAR_12*8; add_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_9); add_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_9); add_dct(VAR_0, VAR_1[6], 6, dest_cb+VAR_10, VAR_9); add_dct(VAR_0, VAR_1[7], 7, dest_cr+VAR_10, VAR_9); if(!VAR_0->chroma_x_shift){ add_dct(VAR_0, VAR_1[8], 8, dest_cb+8, VAR_9); add_dct(VAR_0, VAR_1[9], 9, dest_cr+8, VAR_9); add_dct(VAR_0, VAR_1[10], 10, dest_cb+8+VAR_10, VAR_9); add_dct(VAR_0, VAR_1[11], 11, dest_cr+8+VAR_10, VAR_9); } } } } else if (CONFIG_WMV2) { ff_wmv2_add_mb(VAR_0, VAR_1, dest_y, dest_cb, dest_cr); } } else { if(VAR_0->encoding || !(VAR_0->codec_id==CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==CODEC_ID_MPEG2VIDEO)){ put_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_9, VAR_0->qscale); put_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_14, VAR_9, VAR_0->qscale); put_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_10             , VAR_9, VAR_0->qscale); put_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_10 + VAR_14, VAR_9, VAR_0->qscale); if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){ if(VAR_0->chroma_y_shift){ put_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_12, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_12, VAR_0->chroma_qscale); }else{ VAR_10 >>=1; VAR_9 >>=1; put_dct(VAR_0, VAR_1[4], 4, dest_cb,              VAR_9, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[5], 5, dest_cr,              VAR_9, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_10, VAR_9, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_10, VAR_9, VAR_0->chroma_qscale); } } }else{ VAR_0->dsp.idct_put(dest_y                          , VAR_9, VAR_1[0]); VAR_0->dsp.idct_put(dest_y              + VAR_14, VAR_9, VAR_1[1]); VAR_0->dsp.idct_put(dest_y + VAR_10             , VAR_9, VAR_1[2]); VAR_0->dsp.idct_put(dest_y + VAR_10 + VAR_14, VAR_9, VAR_1[3]); if(!CONFIG_GRAY || !(VAR_0->flags&CODEC_FLAG_GRAY)){ if(VAR_0->chroma_y_shift){ VAR_0->dsp.idct_put(dest_cb, VAR_12, VAR_1[4]); VAR_0->dsp.idct_put(dest_cr, VAR_12, VAR_1[5]); }else{ VAR_9 = VAR_12 << VAR_0->interlaced_dct; VAR_10 =(VAR_0->interlaced_dct)? VAR_12 : VAR_12*8; VAR_0->dsp.idct_put(dest_cb,              VAR_9, VAR_1[4]); VAR_0->dsp.idct_put(dest_cr,              VAR_9, VAR_1[5]); VAR_0->dsp.idct_put(dest_cb + VAR_10, VAR_9, VAR_1[6]); VAR_0->dsp.idct_put(dest_cr + VAR_10, VAR_9, VAR_1[7]); if(!VAR_0->chroma_x_shift){ VAR_0->dsp.idct_put(dest_cb + 8,              VAR_9, VAR_1[8]); VAR_0->dsp.idct_put(dest_cr + 8,              VAR_9, VAR_1[9]); VAR_0->dsp.idct_put(dest_cb + 8 + VAR_10, VAR_9, VAR_1[10]); VAR_0->dsp.idct_put(dest_cr + 8 + VAR_10, VAR_9, VAR_1[11]); } } } } } skip_idct:
if(!VAR_13){ VAR_0->dsp.put_pixels_tab[0][0](VAR_0->dest[0], dest_y ,   VAR_11,16); VAR_0->dsp.put_pixels_tab[VAR_0->chroma_x_shift][0](VAR_0->dest[1], dest_cb, VAR_12,16 >> VAR_0->chroma_y_shift); VAR_0->dsp.put_pixels_tab[VAR_0->chroma_x_shift][0](VAR_0->dest[2], dest_cr, VAR_12,16 >> VAR_0->chroma_y_shift); } } }