[svn] / branches / dev-api-3 / xvidcore / src / decoder.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/decoder.c

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

revision 641, Mon Nov 11 15:49:29 2002 UTC revision 645, Tue Nov 12 15:53:47 2002 UTC
# Line 55  Line 55 
55   *  22.12.2001  lock based interpolation   *  22.12.2001  lock based interpolation
56   *  01.12.2001  inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>   *  01.12.2001  inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>
57   *   *
58   *  $Id: decoder.c,v 1.37.2.10 2002-11-11 15:49:29 Isibaar Exp $   *  $Id: decoder.c,v 1.37.2.11 2002-11-12 15:53:36 Isibaar Exp $
59   *   *
60   *************************************************************************/   *************************************************************************/
61    
# Line 1482  Line 1482 
1482                  return XVID_ERR_OK;                  return XVID_ERR_OK;
1483          }          }
1484    
1485    start:
1486          // add by chenm001 <chenm001@163.com>          // add by chenm001 <chenm001@163.com>
1487          // for support B-frame to reference last 2 frame          // for support B-frame to reference last 2 frame
1488          dec->frames++;          dec->frames++;
# Line 1565  Line 1566 
1566                  return XVID_ERR_FAIL;                  return XVID_ERR_FAIL;
1567          }          }
1568    
1569  #ifdef BFRAMES_DEC_DEBUG          BitstreamByteAlign(&bs);
         if (frame->length != BitstreamPos(&bs) / 8){  
                 DEBUG2("InLen/UseLen",frame->length, BitstreamPos(&bs) / 8);  
         }  
 #endif  
         frame->length = BitstreamPos(&bs) / 8;  
   
1570    
1571  #ifdef BFRAMES_DEC  #ifdef BFRAMES_DEC
1572          // test if no B_VOP          // test if no B_VOP
1573          if (dec->low_delay || dec->frames == 0) {          if (dec->low_delay || dec->frames == 0 || ((dec->packed_mode) && !(frame->length > BitstreamPos(&bs) / 8))) {
1574  #endif  #endif
1575                  image_output(&dec->cur, dec->width, dec->height, dec->edged_width,                  image_output(&dec->cur, dec->width, dec->height, dec->edged_width,
1576                                           frame->image, frame->stride, frame->colorspace, dec->interlacing);                                           frame->image, frame->stride, frame->colorspace, dec->interlacing);
1577    
1578  #ifdef BFRAMES_DEC  #ifdef BFRAMES_DEC
1579          } else {          } else {
1580                  if (dec->frames >= 1) {                  if (dec->frames >= 1 && !(dec->packed_mode)) {
1581                          start_timer();                          start_timer();
1582                          if ((vop_type == I_VOP || vop_type == P_VOP || vop_type == S_VOP)) {                          if ((vop_type == I_VOP || vop_type == P_VOP || vop_type == S_VOP)) {
1583                                  image_output(&dec->refn[0], dec->width, dec->height,                                  image_output(&dec->refn[0], dec->width, dec->height,
# Line 1614  Line 1609 
1609                          mb_swap(&dec->mbs, &dec->last_mbs);                          mb_swap(&dec->mbs, &dec->last_mbs);
1610          }          }
1611    
1612            if (frame->length > BitstreamPos(&bs) / 8)      // multiple vops packed together
1613                    goto start;
1614    
1615            frame->length = BitstreamPos(&bs) / 8;
1616    
1617          if (stats)          if (stats)
1618          {          {
1619                  stats->notify = XVID_DEC_VOP;                  stats->notify = XVID_DEC_VOP;

Legend:
Removed from v.641  
changed lines
  Added in v.645

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