if((s->avctx->debug&FF_DEBUG_VIS_MV) && s->motion_val){ const int shift= 1 + s->quarter_sample; int mb_y; uint8_t *ptr= pict->data[0]; s->low_delay=0;  for(mb_y=0; mb_y<s->mb_height; mb_y++){ int mb_x; for(mb_x=0; mb_x<s->mb_width; mb_x++){ const int mb_index= mb_x + mb_y*s->mb_stride; if(IS_8X8(s->current_picture.mb_type[mb_index])){ int i; for(i=0; i<4; i++){ int sx= mb_x*16 + 4 + 8*(i&1); int sy= mb_y*16 + 4 + 8*(i>>1); int xy= 1 + mb_x*2 + (i&1) + (mb_y*2 + 1 + (i>>1))*(s->mb_width*2 + 2); int mx= (s->motion_val[xy][0]>>shift) + sx; int my= (s->motion_val[xy][1]>>shift) + sy; draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100); } }else{ int sx= mb_x*16 + 8; int sy= mb_y*16 + 8; int xy= 1 + mb_x*2 + (mb_y*2 + 1)*(s->mb_width*2 + 2); int mx= (s->motion_val[xy][0]>>shift) + sx; int my= (s->motion_val[xy][1]>>shift) + sy; draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100); } s->mbskip_table[mb_index]=0; } } }
void ff_print_debug_info(MpegEncContext *s, Picture *pict){    if(!pict || !pict->mb_type) return;    if(s->avctx->debug&(FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)){        int x,y;        for(y=0; y<s->mb_height; y++){            for(x=0; x<s->mb_width; x++){                if(s->avctx->debug&FF_DEBUG_SKIP){                    int count= s->mbskip_table[x + y*s->mb_stride];                    if(count>9) count=9;                    printf("%1d", count);                }                if(s->avctx->debug&FF_DEBUG_QP){                    printf("%2d", pict->qscale_table[x + y*s->mb_stride]);                }                if(s->avctx->debug&FF_DEBUG_MB_TYPE){                    int mb_type= pict->mb_type[x + y*s->mb_stride];                                        //Type & MV direction                    if(IS_PCM(mb_type))                        printf("P");                    else if(IS_INTRA(mb_type) && IS_ACPRED(mb_type))                        printf("A");                    else if(IS_INTRA4x4(mb_type))                        printf("i");                    else if(IS_INTRA16x16(mb_type))                        printf("I");                    else if(IS_DIRECT(mb_type) && IS_SKIP(mb_type))                        printf("d");                    else if(IS_DIRECT(mb_type))                        printf("D");                    else if(IS_GMC(mb_type) && IS_SKIP(mb_type))                        printf("g");                    else if(IS_GMC(mb_type))                        printf("G");                    else if(IS_SKIP(mb_type))                        printf("S");                    else if(!USES_LIST(mb_type, 1))                        printf(">");                    else if(!USES_LIST(mb_type, 0))                        printf("<");                    else{                        assert(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1));                        printf("X");                    }                                        //segmentation                    if(IS_8X8(mb_type))                        printf("+");                    else if(IS_16X8(mb_type))                        printf("-");                    else if(IS_8X16(mb_type))                        printf("");                    else if(IS_INTRA(mb_type) || IS_16X16(mb_type))                        printf(" ");                    else                        printf("?");                                                                if(IS_INTERLACED(mb_type) && s->codec_id == CODEC_ID_H264)                        printf("=");                    else                        printf(" ");                }//                printf(" ");            }            printf("\n");        }    }}