int xy= (y+1)* (s->mb_width+2) + 1; i= y*s->mb_width;
int xy= y*s->mb_stride;
int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type){    if(s->me_method>=ME_EPZS){        int score[8];        int i, y;        uint8_t * fcode_tab= s->fcode_tab;        int best_fcode=-1;        int best_score=-10000000;        for(i=0; i<8; i++) score[i]= s->mb_num*(8-i);        for(y=0; y<s->mb_height; y++){            int x;            int xy= (y+1)* (s->mb_width+2) + 1;            i= y*s->mb_width;            for(x=0; x<s->mb_width; x++){                if(s->mb_type[i] & type){                    int fcode= FFMAX(fcode_tab[mv_table[xy][0] + MAX_MV],                                     fcode_tab[mv_table[xy][1] + MAX_MV]);                    int j;                                        for(j=0; j<fcode && j<8; j++){                        if(s->pict_type==B_TYPE || s->current_picture.mc_mb_var[i] < s->current_picture.mb_var[i])                            score[j]-= 170;                    }                }                i++;                xy++;            }        }                for(i=1; i<8; i++){            if(score[i] > best_score){                best_score= score[i];                best_fcode= i;            }//            printf("%d %d\n", i, score[i]);        }//    printf("fcode: %d type: %d\n", i, s->pict_type);        return best_fcode;/*        for(i=0; i<=MAX_FCODE; i++){            printf("%d ", mv_num[i]);        }        printf("\n");*/    }else{        return 1;    }}