Revision 693b0e1d libavcodec/motion_est.c

View differences:

libavcodec/motion_est.c
1546 1546
            score=fbmin;
1547 1547
            type= MB_TYPE_BIDIR;
1548 1548
        }
1549
        score= (score*score)>>8;
1549
        score= (score*score + 128*256)>>16;
1550 1550
        s->mc_mb_var_sum += score;
1551 1551
        s->mc_mb_var[mb_y*s->mb_width + mb_x] = score; //FIXME use SSD
1552 1552
    }
......
1698 1698
        int xy= (y+1)* (s->mb_width+2)+1;
1699 1699
        int i= y*s->mb_width;
1700 1700
        for(x=0; x<s->mb_width; x++){
1701
            if(s->mb_type[i]&type){
1702
                if(   fcode_tab[mv_table[xy][0] + MAX_MV] > f_code
1703
                   || fcode_tab[mv_table[xy][0] + MAX_MV] == 0
1704
                   || fcode_tab[mv_table[xy][1] + MAX_MV] > f_code
1705
                   || fcode_tab[mv_table[xy][1] + MAX_MV] == 0 ){
1706
                    if(s->mb_type[i]&(~type)) s->mb_type[i] &= ~type;
1707
                    else{
1708
                        mv_table[xy][0] = 0;
1709
                        mv_table[xy][1] = 0;
1710
                        //this is certainly bad FIXME            
1711
                    }
1712
                }
1701
            if(   fcode_tab[mv_table[xy][0] + MAX_MV] > f_code
1702
               || fcode_tab[mv_table[xy][0] + MAX_MV] == 0){
1703
                if(mv_table[xy][0]>0) mv_table[xy][0]=  (16<<f_code)-1;
1704
                else                  mv_table[xy][0]= -(16<<f_code);
1705
            }
1706
            if(   fcode_tab[mv_table[xy][1] + MAX_MV] > f_code
1707
               || fcode_tab[mv_table[xy][1] + MAX_MV] == 0){
1708
                if(mv_table[xy][1]>0) mv_table[xy][1]=  (16<<f_code)-1;
1709
                else                  mv_table[xy][1]= -(16<<f_code);
1713 1710
            }
1714 1711
            xy++;
1715 1712
            i++;

Also available in: Unified diff