[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.55, Thu Apr 15 12:05:19 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 1361  Line 1360 
1360                                          xvid_dec_frame_t * frame, xvid_dec_stats_t * stats,                                          xvid_dec_frame_t * frame, xvid_dec_stats_t * stats,
1361                                          int coding_type, int quant)                                          int coding_type, int quant)
1362  {  {
1363            const int brightness = XVID_VERSION_MINOR(frame->version) >= 1 ? frame->brightness : 0;
1364    
1365          if (dec->cartoon_mode)          if (dec->cartoon_mode)
1366                  frame->general &= ~XVID_FILMEFFECT;                  frame->general &= ~XVID_FILMEFFECT;
1367    
1368          if ((frame->general & (XVID_DEBLOCKY|XVID_DEBLOCKUV|XVID_FILMEFFECT) || frame->brightness!=0)          if ((frame->general & (XVID_DEBLOCKY|XVID_DEBLOCKUV|XVID_FILMEFFECT) || brightness!=0)
1369                  && mbs != NULL) /* post process */                  && mbs != NULL) /* post process */
1370          {          {
1371                  /* note: image is stored to tmp */                  /* note: image is stored to tmp */
1372                  image_copy(&dec->tmp, img, dec->edged_width, dec->height);                  image_copy(&dec->tmp, img, dec->edged_width, dec->height);
1373                  image_postproc(&dec->postproc, &dec->tmp, dec->edged_width,                  image_postproc(&dec->postproc, &dec->tmp, dec->edged_width,
1374                                             mbs, dec->mb_width, dec->mb_height, dec->mb_width,                                             mbs, dec->mb_width, dec->mb_height, dec->mb_width,
1375                                             frame->general, frame->brightness, dec->frames, (coding_type == B_VOP));                                             frame->general, brightness, dec->frames, (coding_type == B_VOP));
1376                  img = &dec->tmp;                  img = &dec->tmp;
1377          }          }
1378    
# Line 1453  Line 1454 
1454    
1455          success = 0;          success = 0;
1456          output = 0;          output = 0;
         if (stats) stats->type = XVID_TYPE_NOTHING;  
1457          seen_something = 0;          seen_something = 0;
1458    
1459  repeat:  repeat:

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

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