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

Diff of /xvidcore/src/encoder.c

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

revision 1.111, Wed Dec 8 12:43:48 2004 UTC revision 1.112, Thu Dec 9 04:20:44 2004 UTC
# Line 1647  Line 1647 
1647    
1648                                  current->sStat.kblks++;                                  current->sStat.kblks++;
1649    
1650                                  if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE)                                  if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE) {
1651                                  {       pMB->cbp &= 0x3C;               /* keep only bits 5-2 */                                          pMB->cbp &= 0x3C;               /* keep only bits 5-2 */
1652                                          qcoeff[4*64+0]=0;               /* zero, because for INTRA MBs DC value is saved */                                          qcoeff[4*64+0]=0;               /* zero, because for INTRA MBs DC value is saved */
1653                                          qcoeff[5*64+0]=0;                                          qcoeff[5*64+0]=0;
1654                                  }                                  }
# Line 1672  Line 1672 
1672    
1673                          pMB->field_pred = 0;                          pMB->field_pred = 0;
1674    
1675                          if (pMB->mode != MODE_NOT_CODED)                          if (pMB->cbp != 0) {
                         {       pMB->cbp =  
1676                                          MBTransQuantInter(&pEnc->mbParam, current, pMB, x, y,                                          MBTransQuantInter(&pEnc->mbParam, current, pMB, x, y,
1677                                                                            dct_codes, qcoeff);                                                                            dct_codes, qcoeff);
1678                          }                          }
# Line 1972  Line 1971 
1971                                          MBMotionCompensation(mb, x, y, f_ref, NULL, f_ref, NULL, NULL, &frame->image,                                          MBMotionCompensation(mb, x, y, f_ref, NULL, f_ref, NULL, NULL, &frame->image,
1972                                                                                          NULL, 0, 0, pEnc->mbParam.edged_width, 0, 0);                                                                                          NULL, 0, 0, pEnc->mbParam.edged_width, 0, 0);
1973                                  }                                  }
   
1974                                  continue;                                  continue;
1975                          }                          }
1976    
1977                          if (mb->mode != MODE_DIRECT_NONE_MV || pEnc->mbParam.plugin_flags & XVID_REQORIGINAL) {                          mb->quant = frame->quant;
1978    
1979                            if (mb->cbp != 0 || pEnc->mbParam.plugin_flags & XVID_REQORIGINAL) {
1980                                    /* we have to motion-compensate, transfer etc,
1981                                            because there might be blocks to code */
1982    
1983                                  MBMotionCompensationBVOP(&pEnc->mbParam, mb, x, y, &frame->image,                                  MBMotionCompensationBVOP(&pEnc->mbParam, mb, x, y, &frame->image,
1984                                                                           f_ref, &pEnc->f_refh, &pEnc->f_refv,                                                                           f_ref, &pEnc->f_refh, &pEnc->f_refv,
1985                                                                           &pEnc->f_refhv, b_ref, &pEnc->vInterH,                                                                           &pEnc->f_refhv, b_ref, &pEnc->vInterH,
1986                                                                           &pEnc->vInterV, &pEnc->vInterHV,                                                                           &pEnc->vInterV, &pEnc->vInterHV,
1987                                                                           dct_codes);                                                                           dct_codes);
1988    
                                 if (mb->mode == MODE_DIRECT_NO4V) mb->mode = MODE_DIRECT;  
                                 mb->quant = frame->quant;  
   
                                 if (mb->mode != MODE_DIRECT_NONE_MV)  
1989                                          mb->cbp = MBTransQuantInterBVOP(&pEnc->mbParam, frame, mb, x, y,  dct_codes, qcoeff);                                          mb->cbp = MBTransQuantInterBVOP(&pEnc->mbParam, frame, mb, x, y,  dct_codes, qcoeff);
1990                            }
1991    
1992                            if (mb->mode == MODE_DIRECT_NO4V)
1993                                    mb->mode = MODE_DIRECT;
1994    
1995                                  if ( (mb->mode == MODE_DIRECT) && (mb->cbp == 0)                          if (mb->mode == MODE_DIRECT && (mb->cbp | mb->pmvs[3].x | mb->pmvs[3].y) == 0)
                                         && (mb->pmvs[3].x == 0) && (mb->pmvs[3].y == 0) ) {  
1996                                          mb->mode = MODE_DIRECT_NONE_MV; /* skipped */                                          mb->mode = MODE_DIRECT_NONE_MV; /* skipped */
                                 }  
                         }  
1997    
1998                          /* keep only bits 5-2 -- Chroma blocks will just be skipped by the                          /* keep only bits 5-2 -- Chroma blocks will just be skipped by the
1999                           * coding function for BFrames, that's why we don't zero teh DC                           * coding function for BFrames, that's why we don't zero teh DC
2000                           * coeffs */                           * coeffs */
2001                          if ((frame->vop_flags & XVID_VOP_GREYSCALE))                          if (frame->vop_flags & XVID_VOP_GREYSCALE)
2002                                  mb->cbp &= 0x3C;                                  mb->cbp &= 0x3C;
2003    
2004                          start_timer();                          start_timer();

Legend:
Removed from v.1.111  
changed lines
  Added in v.1.112

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