[cvs] / xvidcore / src / decoder.c Repository:
ViewVC logotype

Diff of /xvidcore/src/decoder.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53, Sat Apr 10 04:30:07 2004 UTC revision 1.54, Sun Apr 11 09:41:27 2004 UTC
# Line 496  Line 496 
496                          mv[i] = pMB->mvs[i];                          mv[i] = pMB->mvs[i];
497          }          }
498    
499            for (i = 0; i < 4; i++) {
500                    /* clip to valid range */
501                    int border = (int)(dec->mb_width - x_pos) << (5 + dec->quarterpel);
502                    if (mv[i].x > border) {
503                            DPRINTF(XVID_DEBUG_MV, "mv.x > max -- %d > %d, MB %d, %d", mv[i].x, border, x_pos, y_pos);
504                            mv[i].x = border;
505                    } else {
506                            border = (-(int)x_pos-1) << (5 + dec->quarterpel);
507                            if (mv[i].x < border) {
508                                    DPRINTF(XVID_DEBUG_MV, "mv.x < min -- %d < %d, MB %d, %d", mv[i].x, border, x_pos, y_pos);
509                                    mv[i].x = border;
510                            }
511                    }
512    
513                    border = (int)(dec->mb_height - y_pos) << (5 + dec->quarterpel);
514                    if (mv[i].y >  border) {
515                            DPRINTF(XVID_DEBUG_MV, "mv.y > max -- %d > %d, MB %d, %d", mv[i].y, border, x_pos, y_pos);
516                            mv[i].y = border;
517                    } else {
518                            border = (-(int)y_pos-1) << (5 + dec->quarterpel);
519                            if (mv[i].y < border) {
520                                    DPRINTF(XVID_DEBUG_MV, "mv.y < min -- %d < %d, MB %d, %d", mv[i].y, border, x_pos, y_pos);
521                                    mv[i].y = border;
522                            }
523                    }
524            }
525    
526          start_timer();          start_timer();
527    
528          if (pMB->mode != MODE_INTER4V) { /* INTER, INTER_Q, NOT_CODED, FORWARD, BACKWARD */          if (pMB->mode != MODE_INTER4V) { /* INTER, INTER_Q, NOT_CODED, FORWARD, BACKWARD */
# Line 761  Line 788 
788                  mv.y -= range;                  mv.y -= range;
789          }          }
790    
         /* clip to valid range */  
   
         if (mv.x > ((int)(dec->mb_width - x) << (5 + dec->quarterpel)) )  
                 mv.x = (int)(dec->mb_width - x) << (5 + dec->quarterpel);  
   
         else if (mv.x < (int)(-x-1) << (5 + dec->quarterpel))  
                 mv.x = (int)(-x-1) << (5 + dec->quarterpel);  
   
         if (mv.y > ((int)(dec->mb_height - y) << (5 + dec->quarterpel)) )  
                 mv.y = (int)(dec->mb_height - y) << (5 + dec->quarterpel);  
   
         else if (mv.y < ((int)(-y-1)) << (5 + dec->quarterpel) )  
                 mv.y = (int)(-y-1) << (5 + dec->quarterpel);  
   
791          ret_mv->x = mv.x;          ret_mv->x = mv.x;
792          ret_mv->y = mv.y;          ret_mv->y = mv.y;
793  }  }
# Line 986  Line 999 
999          else if (mv_y > high)          else if (mv_y > high)
1000                  mv_y -= range;                  mv_y -= range;
1001    
   
         /* clip to valid range */  
         if (mv_x > ((int)(dec->mb_width - x) << (5 + dec->quarterpel)) )  
                 mv_x = (int)(dec->mb_width - x) << (5 + dec->quarterpel);  
   
         else if (mv_x < (int)(-x-1) << (5 + dec->quarterpel))  
                 mv_x = (int)(-x-1) << (5 + dec->quarterpel);  
   
         if (mv_y > ((int)(dec->mb_height - y) << (5 + dec->quarterpel)) )  
                 mv_y = (int)(dec->mb_height - y) << (5 + dec->quarterpel);  
   
         else if (mv_y < ((int)(-y-1)) << (5 + dec->quarterpel) )  
                 mv_y = (int)(-y-1) << (5 + dec->quarterpel);  
   
1002          mv->x = mv_x;          mv->x = mv_x;
1003          mv->y = mv_y;          mv->y = mv_y;
1004  }  }
# Line 1453  Line 1452 
1452    
1453          success = 0;          success = 0;
1454          output = 0;          output = 0;
         if (stats) stats->type = XVID_TYPE_NOTHING;  
1455          seen_something = 0;          seen_something = 0;
1456    
1457  repeat:  repeat:

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4