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

                            int is_mpeg12)

{

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



#if FF_API_XVMC

FF_DISABLE_DEPRECATION_WARNINGS

    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){

        ff_xvmc_decode_mb(s);//xvmc uses pblocks

        return;

    }

FF_ENABLE_DEPRECATION_WARNINGS

#endif /* FF_API_XVMC */



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

       /* print DCT coefficients */

       int i,j;

       av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y);

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

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

               av_log(s->avctx, AV_LOG_DEBUG, "%5d", block[i][s->dsp.idct_permutation[j]]);

           }

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

       }

    }



    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==AV_PICTURE_TYPE_B) && 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.f.linesize[0]; //not s->linesize as this would be wrong for field pics

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

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

        const int block_size = 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];



            if (s->mb_skipped) {

                s->mb_skipped= 0;

                assert(s->pict_type!=AV_PICTURE_TYPE_I);

                *mbskip_ptr = 1;

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

                *mbskip_ptr = 1;

            } 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(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) {

                    if (s->mv_dir & MV_DIR_FORWARD) {

                        ff_thread_await_progress(&s->last_picture_ptr->tf,

                                                 ff_MPV_lowest_referenced_row(s, 0),

                                                 0);

                    }

                    if (s->mv_dir & MV_DIR_BACKWARD) {

                        ff_thread_await_progress(&s->next_picture_ptr->tf,

                                                 ff_MPV_lowest_referenced_row(s, 1),

                                                 0);

                    }

                }



                op_qpix= s->me.qpel_put;

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

                    op_pix = s->hdsp.put_pixels_tab;

                }else{

                    op_pix = s->hdsp.put_no_rnd_pixels_tab;

                }

                if (s->mv_dir & MV_DIR_FORWARD) {

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

                    op_pix = s->hdsp.avg_pixels_tab;

                    op_qpix= s->me.qpel_avg;

                }

                if (s->mv_dir & MV_DIR_BACKWARD) {

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

                }

            }



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

            if(s->avctx->skip_idct){

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

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

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

                    goto skip_idct;

            }



            /* add dct residue */

            if(s->encoding || !(   s->msmpeg4_version || s->codec_id==AV_CODEC_ID_MPEG1VIDEO || s->codec_id==AV_CODEC_ID_MPEG2VIDEO

                                || (s->codec_id==AV_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 != AV_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_DECODER || CONFIG_WMV2_ENCODER) {

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

            }

        } else {

            /* dct only in intra block */

            if(s->encoding || !(s->codec_id==AV_CODEC_ID_MPEG1VIDEO || s->codec_id==AV_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->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y ,   linesize,16);

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

            s->hdsp.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, int16_t block[12][64],

                            int is_mpeg12)

{

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



#if FF_API_XVMC

FF_DISABLE_DEPRECATION_WARNINGS

    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){

        ff_xvmc_decode_mb(s);

        return;

    }

FF_ENABLE_DEPRECATION_WARNINGS

#endif 



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

       

       int i,j;

       av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y);

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

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

               av_log(s->avctx, AV_LOG_DEBUG, "%5d", block[i][s->dsp.idct_permutation[j]]);

           }

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

       }

    }



    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==AV_PICTURE_TYPE_B) && 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.f.linesize[0]; 

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

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

        const int block_size = 8;



        

        

        if(!s->encoding){

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



            if (s->mb_skipped) {

                s->mb_skipped= 0;

                assert(s->pict_type!=AV_PICTURE_TYPE_I);

                *mbskip_ptr = 1;

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

                *mbskip_ptr = 1;

            } 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(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) {

                    if (s->mv_dir & MV_DIR_FORWARD) {

                        ff_thread_await_progress(&s->last_picture_ptr->tf,

                                                 ff_MPV_lowest_referenced_row(s, 0),

                                                 0);

                    }

                    if (s->mv_dir & MV_DIR_BACKWARD) {

                        ff_thread_await_progress(&s->next_picture_ptr->tf,

                                                 ff_MPV_lowest_referenced_row(s, 1),

                                                 0);

                    }

                }



                op_qpix= s->me.qpel_put;

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

                    op_pix = s->hdsp.put_pixels_tab;

                }else{

                    op_pix = s->hdsp.put_no_rnd_pixels_tab;

                }

                if (s->mv_dir & MV_DIR_FORWARD) {

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

                    op_pix = s->hdsp.avg_pixels_tab;

                    op_qpix= s->me.qpel_avg;

                }

                if (s->mv_dir & MV_DIR_BACKWARD) {

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

                }

            }



            

            if(s->avctx->skip_idct){

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

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

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

                    goto skip_idct;

            }



            

            if(s->encoding || !(   s->msmpeg4_version || s->codec_id==AV_CODEC_ID_MPEG1VIDEO || s->codec_id==AV_CODEC_ID_MPEG2VIDEO

                                || (s->codec_id==AV_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 != AV_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_DECODER || CONFIG_WMV2_ENCODER) {

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

            }

        } else {

            

            if(s->encoding || !(s->codec_id==AV_CODEC_ID_MPEG1VIDEO || s->codec_id==AV_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->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y ,   linesize,16);

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

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

        }

    }

}

        const int uvlinesize = s->current_picture.f.linesize[1];                     ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f.data, op_pix, op_qpix);                     ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f.data, op_pix, op_qpix);
void FUNC_0(MpegEncContext *VAR_0, int16_t VAR_1[12][64],

                            int VAR_2)

{

    const int VAR_3 = VAR_0->mb_y * VAR_0->mb_stride + VAR_0->mb_x;



#if FF_API_XVMC

FF_DISABLE_DEPRECATION_WARNINGS

    if(CONFIG_MPEG_XVMC_DECODER && VAR_0->avctx->xvmc_acceleration){

        ff_xvmc_decode_mb(VAR_0);

        return;

    }

FF_ENABLE_DEPRECATION_WARNINGS

#endif 



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

       

       int VAR_4,VAR_5;

       av_log(VAR_0->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", VAR_0->mb_x, VAR_0->mb_y);

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

           for(VAR_5=0; VAR_5<64; VAR_5++){

               av_log(VAR_0->avctx, AV_LOG_DEBUG, "%5d", VAR_1[VAR_4][VAR_0->dsp.idct_permutation[VAR_5]]);

           }

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

       }

    }



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



    

    if (!VAR_0->mb_intra) {

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

            if(VAR_0->mbintra_table[VAR_3])

                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_2 && (VAR_0->h263_pred || VAR_0->h263_aic))

        VAR_0->mbintra_table[VAR_3]=1;



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

        uint8_t *dest_y, *dest_cb, *dest_cr;

        int VAR_6, VAR_7;

        op_pixels_func (*op_pix)[4];

        qpel_mc_func (*op_qpix)[16];

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

        const int VAR_9 = VAR_0->current_picture.f.VAR_8[1];

        const int VAR_10= VAR_0->pict_type != AV_PICTURE_TYPE_B || VAR_0->encoding || VAR_0->avctx->draw_horiz_band;

        const int VAR_11 = 8;



        

        

        if(!VAR_0->encoding){

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



            if (VAR_0->mb_skipped) {

                VAR_0->mb_skipped= 0;

                assert(VAR_0->pict_type!=AV_PICTURE_TYPE_I);

                *mbskip_ptr = 1;

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

                *mbskip_ptr = 1;

            } else{

                *mbskip_ptr = 0; 

            }

        }



        VAR_6 = VAR_8 << VAR_0->interlaced_dct;

        VAR_7   = VAR_0->interlaced_dct ? VAR_8 : VAR_8 * VAR_11;



        if(VAR_10){

            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_8;

            dest_cr= VAR_0->b_scratchpad+32*VAR_8;

        }



        if (!VAR_0->mb_intra) {

            

            

            if(!VAR_0->encoding){



                if(HAVE_THREADS && VAR_0->avctx->active_thread_type&FF_THREAD_FRAME) {

                    if (VAR_0->mv_dir & MV_DIR_FORWARD) {

                        ff_thread_await_progress(&VAR_0->last_picture_ptr->tf,

                                                 ff_MPV_lowest_referenced_row(VAR_0, 0),

                                                 0);

                    }

                    if (VAR_0->mv_dir & MV_DIR_BACKWARD) {

                        ff_thread_await_progress(&VAR_0->next_picture_ptr->tf,

                                                 ff_MPV_lowest_referenced_row(VAR_0, 1),

                                                 0);

                    }

                }



                op_qpix= VAR_0->me.qpel_put;

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

                    op_pix = VAR_0->hdsp.put_pixels_tab;

                }else{

                    op_pix = VAR_0->hdsp.put_no_rnd_pixels_tab;

                }

                if (VAR_0->mv_dir & MV_DIR_FORWARD) {

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

                    op_pix = VAR_0->hdsp.avg_pixels_tab;

                    op_qpix= VAR_0->me.qpel_avg;

                }

                if (VAR_0->mv_dir & MV_DIR_BACKWARD) {

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

                }

            }



            

            if(VAR_0->avctx->skip_idct){

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

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

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

                    goto skip_idct;

            }



            

            if(VAR_0->encoding || !(   VAR_0->msmpeg4_version || VAR_0->codec_id==AV_CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==AV_CODEC_ID_MPEG2VIDEO

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

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

                add_dequant_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_11, VAR_6, VAR_0->qscale);

                add_dequant_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_7             , VAR_6, VAR_0->qscale);

                add_dequant_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_7 + VAR_11, VAR_6, 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_9, VAR_0->chroma_qscale);

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

                    }else{

                        VAR_6 >>= 1;

                        VAR_7 >>=1;

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

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

                        add_dequant_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_7, VAR_6, VAR_0->chroma_qscale);

                        add_dequant_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_7, VAR_6, VAR_0->chroma_qscale);

                    }

                }

            } else if(VAR_2 || (VAR_0->codec_id != AV_CODEC_ID_WMV2)){

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

                add_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_11, VAR_6);

                add_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_7             , VAR_6);

                add_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_7 + VAR_11, VAR_6);



                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_9);

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

                    }else{

                        

                        VAR_6 = VAR_9 << VAR_0->interlaced_dct;

                        VAR_7   = VAR_0->interlaced_dct ? VAR_9 : VAR_9 * 8;



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

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

                        add_dct(VAR_0, VAR_1[6], 6, dest_cb+VAR_7, VAR_6);

                        add_dct(VAR_0, VAR_1[7], 7, dest_cr+VAR_7, VAR_6);

                        if(!VAR_0->chroma_x_shift){

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

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

                            add_dct(VAR_0, VAR_1[10], 10, dest_cb+8+VAR_7, VAR_6);

                            add_dct(VAR_0, VAR_1[11], 11, dest_cr+8+VAR_7, VAR_6);

                        }

                    }

                }

            }

            else if (CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER) {

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

            }

        } else {

            

            if(VAR_0->encoding || !(VAR_0->codec_id==AV_CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==AV_CODEC_ID_MPEG2VIDEO)){

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

                put_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_11, VAR_6, VAR_0->qscale);

                put_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_7             , VAR_6, VAR_0->qscale);

                put_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_7 + VAR_11, VAR_6, 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_9, VAR_0->chroma_qscale);

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

                    }else{

                        VAR_7 >>=1;

                        VAR_6 >>=1;

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

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

                        put_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_7, VAR_6, VAR_0->chroma_qscale);

                        put_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_7, VAR_6, VAR_0->chroma_qscale);

                    }

                }

            }else{

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

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

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

                VAR_0->dsp.idct_put(dest_y + VAR_7 + VAR_11, VAR_6, 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_9, VAR_1[4]);

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

                    }else{



                        VAR_6 = VAR_9 << VAR_0->interlaced_dct;

                        VAR_7   = VAR_0->interlaced_dct ? VAR_9 : VAR_9 * 8;



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

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

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

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

                        if(!VAR_0->chroma_x_shift){

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

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

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

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

                        }

                    }

                }

            }

        }

skip_idct:

        if(!VAR_10){

            VAR_0->hdsp.put_pixels_tab[0][0](VAR_0->dest[0], dest_y ,   VAR_8,16);

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

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

        }

    }

}

void FUNC_0(MpegEncContext *VAR_0, int16_t VAR_1[12][64],
int VAR_2)
{ const int VAR_3 = VAR_0->mb_y * VAR_0->mb_stride + VAR_0->mb_x; #if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
if(CONFIG_MPEG_XVMC_DECODER && VAR_0->avctx->xvmc_acceleration){ ff_xvmc_decode_mb(VAR_0); return; } FF_ENABLE_DEPRECATION_WARNINGS
#endif
if(VAR_0->avctx->debug&FF_DEBUG_DCT_COEFF) { int VAR_4,VAR_5; av_log(VAR_0->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", VAR_0->mb_x, VAR_0->mb_y); for(VAR_4=0; VAR_4<6; VAR_4++){ for(VAR_5=0; VAR_5<64; VAR_5++){ av_log(VAR_0->avctx, AV_LOG_DEBUG, "%5d", VAR_1[VAR_4][VAR_0->dsp.idct_permutation[VAR_5]]); } av_log(VAR_0->avctx, AV_LOG_DEBUG, "\n"); } } VAR_0->current_picture.qscale_table[VAR_3] = VAR_0->qscale; if (!VAR_0->mb_intra) { if (!VAR_2 && (VAR_0->h263_pred || VAR_0->h263_aic)) { if(VAR_0->mbintra_table[VAR_3])
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_2 && (VAR_0->h263_pred || VAR_0->h263_aic))
VAR_0->mbintra_table[VAR_3]=1; if ((VAR_0->flags&CODEC_FLAG_PSNR) || !(VAR_0->encoding && (VAR_0->intra_only || VAR_0->pict_type==AV_PICTURE_TYPE_B) && VAR_0->avctx->mb_decision != FF_MB_DECISION_RD)) { uint8_t *dest_y, *dest_cb, *dest_cr; int VAR_6, VAR_7; op_pixels_func (*op_pix)[4]; qpel_mc_func (*op_qpix)[16]; const int VAR_8   = VAR_0->current_picture.f.VAR_8[0]; const int VAR_9 = VAR_0->current_picture.f.VAR_8[1]; const int VAR_10= VAR_0->pict_type != AV_PICTURE_TYPE_B || VAR_0->encoding || VAR_0->avctx->draw_horiz_band; const int VAR_11 = 8; if(!VAR_0->encoding){ uint8_t *mbskip_ptr = &VAR_0->mbskip_table[VAR_3]; if (VAR_0->mb_skipped) { VAR_0->mb_skipped= 0; assert(VAR_0->pict_type!=AV_PICTURE_TYPE_I); *mbskip_ptr = 1; } else if(!VAR_0->current_picture.reference) { *mbskip_ptr = 1; } else{ *mbskip_ptr = 0; } } VAR_6 = VAR_8 << VAR_0->interlaced_dct; VAR_7   = VAR_0->interlaced_dct ? VAR_8 : VAR_8 * VAR_11; if(VAR_10){ 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_8; dest_cr= VAR_0->b_scratchpad+32*VAR_8; } if (!VAR_0->mb_intra) { if(!VAR_0->encoding){ if(HAVE_THREADS && VAR_0->avctx->active_thread_type&FF_THREAD_FRAME) { if (VAR_0->mv_dir & MV_DIR_FORWARD) { ff_thread_await_progress(&VAR_0->last_picture_ptr->tf,
ff_MPV_lowest_referenced_row(VAR_0, 0),
0); } if (VAR_0->mv_dir & MV_DIR_BACKWARD) { ff_thread_await_progress(&VAR_0->next_picture_ptr->tf,
ff_MPV_lowest_referenced_row(VAR_0, 1),
0); } } op_qpix= VAR_0->me.qpel_put; if ((!VAR_0->no_rounding) || VAR_0->pict_type==AV_PICTURE_TYPE_B){ op_pix = VAR_0->hdsp.put_pixels_tab; }else{ op_pix = VAR_0->hdsp.put_no_rnd_pixels_tab; } if (VAR_0->mv_dir & MV_DIR_FORWARD) { ff_MPV_motion(VAR_0, dest_y, dest_cb, dest_cr, 0, VAR_0->last_picture.f.data, op_pix, op_qpix); op_pix = VAR_0->hdsp.avg_pixels_tab; op_qpix= VAR_0->me.qpel_avg; } if (VAR_0->mv_dir & MV_DIR_BACKWARD) { ff_MPV_motion(VAR_0, dest_y, dest_cb, dest_cr, 1, VAR_0->next_picture.f.data, op_pix, op_qpix); } } if(VAR_0->avctx->skip_idct){ if(  (VAR_0->avctx->skip_idct >= AVDISCARD_NONREF && VAR_0->pict_type == AV_PICTURE_TYPE_B)
||(VAR_0->avctx->skip_idct >= AVDISCARD_NONKEY && VAR_0->pict_type != AV_PICTURE_TYPE_I)
|| VAR_0->avctx->skip_idct >= AVDISCARD_ALL)
goto skip_idct; } if(VAR_0->encoding || !(   VAR_0->msmpeg4_version || VAR_0->codec_id==AV_CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==AV_CODEC_ID_MPEG2VIDEO
|| (VAR_0->codec_id==AV_CODEC_ID_MPEG4 && !VAR_0->mpeg_quant))){ add_dequant_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_6, VAR_0->qscale); add_dequant_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_11, VAR_6, VAR_0->qscale); add_dequant_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_7             , VAR_6, VAR_0->qscale); add_dequant_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_7 + VAR_11, VAR_6, 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_9, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_9, VAR_0->chroma_qscale); }else{ VAR_6 >>= 1; VAR_7 >>=1; add_dequant_dct(VAR_0, VAR_1[4], 4, dest_cb,              VAR_6, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[5], 5, dest_cr,              VAR_6, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_7, VAR_6, VAR_0->chroma_qscale); add_dequant_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_7, VAR_6, VAR_0->chroma_qscale); } } } else if(VAR_2 || (VAR_0->codec_id != AV_CODEC_ID_WMV2)){ add_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_6); add_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_11, VAR_6); add_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_7             , VAR_6); add_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_7 + VAR_11, VAR_6); 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_9); add_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_9); }else{ VAR_6 = VAR_9 << VAR_0->interlaced_dct; VAR_7   = VAR_0->interlaced_dct ? VAR_9 : VAR_9 * 8; add_dct(VAR_0, VAR_1[4], 4, dest_cb, VAR_6); add_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_6); add_dct(VAR_0, VAR_1[6], 6, dest_cb+VAR_7, VAR_6); add_dct(VAR_0, VAR_1[7], 7, dest_cr+VAR_7, VAR_6); if(!VAR_0->chroma_x_shift){ add_dct(VAR_0, VAR_1[8], 8, dest_cb+8, VAR_6); add_dct(VAR_0, VAR_1[9], 9, dest_cr+8, VAR_6); add_dct(VAR_0, VAR_1[10], 10, dest_cb+8+VAR_7, VAR_6); add_dct(VAR_0, VAR_1[11], 11, dest_cr+8+VAR_7, VAR_6); } } } } else if (CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER) { ff_wmv2_add_mb(VAR_0, VAR_1, dest_y, dest_cb, dest_cr); } } else { if(VAR_0->encoding || !(VAR_0->codec_id==AV_CODEC_ID_MPEG1VIDEO || VAR_0->codec_id==AV_CODEC_ID_MPEG2VIDEO)){ put_dct(VAR_0, VAR_1[0], 0, dest_y                          , VAR_6, VAR_0->qscale); put_dct(VAR_0, VAR_1[1], 1, dest_y              + VAR_11, VAR_6, VAR_0->qscale); put_dct(VAR_0, VAR_1[2], 2, dest_y + VAR_7             , VAR_6, VAR_0->qscale); put_dct(VAR_0, VAR_1[3], 3, dest_y + VAR_7 + VAR_11, VAR_6, 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_9, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[5], 5, dest_cr, VAR_9, VAR_0->chroma_qscale); }else{ VAR_7 >>=1; VAR_6 >>=1; put_dct(VAR_0, VAR_1[4], 4, dest_cb,              VAR_6, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[5], 5, dest_cr,              VAR_6, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[6], 6, dest_cb + VAR_7, VAR_6, VAR_0->chroma_qscale); put_dct(VAR_0, VAR_1[7], 7, dest_cr + VAR_7, VAR_6, VAR_0->chroma_qscale); } } }else{ VAR_0->dsp.idct_put(dest_y                          , VAR_6, VAR_1[0]); VAR_0->dsp.idct_put(dest_y              + VAR_11, VAR_6, VAR_1[1]); VAR_0->dsp.idct_put(dest_y + VAR_7             , VAR_6, VAR_1[2]); VAR_0->dsp.idct_put(dest_y + VAR_7 + VAR_11, VAR_6, 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_9, VAR_1[4]); VAR_0->dsp.idct_put(dest_cr, VAR_9, VAR_1[5]); }else{ VAR_6 = VAR_9 << VAR_0->interlaced_dct; VAR_7   = VAR_0->interlaced_dct ? VAR_9 : VAR_9 * 8; VAR_0->dsp.idct_put(dest_cb,              VAR_6, VAR_1[4]); VAR_0->dsp.idct_put(dest_cr,              VAR_6, VAR_1[5]); VAR_0->dsp.idct_put(dest_cb + VAR_7, VAR_6, VAR_1[6]); VAR_0->dsp.idct_put(dest_cr + VAR_7, VAR_6, VAR_1[7]); if(!VAR_0->chroma_x_shift){ VAR_0->dsp.idct_put(dest_cb + 8,              VAR_6, VAR_1[8]); VAR_0->dsp.idct_put(dest_cr + 8,              VAR_6, VAR_1[9]); VAR_0->dsp.idct_put(dest_cb + 8 + VAR_7, VAR_6, VAR_1[10]); VAR_0->dsp.idct_put(dest_cr + 8 + VAR_7, VAR_6, VAR_1[11]); } } } } } skip_idct:
if(!VAR_10){ VAR_0->hdsp.put_pixels_tab[0][0](VAR_0->dest[0], dest_y ,   VAR_8,16); VAR_0->hdsp.put_pixels_tab[VAR_0->chroma_x_shift][0](VAR_0->dest[1], dest_cb, VAR_9,16 >> VAR_0->chroma_y_shift); VAR_0->hdsp.put_pixels_tab[VAR_0->chroma_x_shift][0](VAR_0->dest[2], dest_cr, VAR_9,16 >> VAR_0->chroma_y_shift); } } }