[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.114, Fri Dec 10 03:45:18 2004 UTC revision 1.115, Fri Dec 10 04:10:12 2004 UTC
# Line 1479  Line 1479 
1479                          stop_prediction_timer();                          stop_prediction_timer();
1480    
1481                          start_timer();                          start_timer();
                         if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE)  
                         {       pMB->cbp &= 0x3C;               /* keep only bits 5-2 */  
                                 qcoeff[4*64+0]=0;               /* zero, because for INTRA MBs DC value is saved */  
                                 qcoeff[5*64+0]=0;  
                         }  
1482                          MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->current->sStat);                          MBCoding(pEnc->current, pMB, qcoeff, bs, &pEnc->current->sStat);
1483                          stop_coding_timer();                          stop_coding_timer();
1484                  }                  }
# Line 1651  Line 1646 
1646                          MACROBLOCK *pMB =                          MACROBLOCK *pMB =
1647                                  &current->mbs[x + y * pParam->mb_width];                                  &current->mbs[x + y * pParam->mb_width];
1648    
1649                          int bIntra = (pMB->mode == MODE_INTRA) || (pMB->mode == MODE_INTRA_Q);                          if (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q) {
   
                         if (bIntra) {  
1650                                  CodeIntraMB(pEnc, pMB);                                  CodeIntraMB(pEnc, pMB);
1651                                  MBTransQuantIntra(&pEnc->mbParam, current, pMB, x, y,                                  MBTransQuantIntra(&pEnc->mbParam, current, pMB, x, y,
1652                                                                    dct_codes, qcoeff);                                                                    dct_codes, qcoeff);
# Line 1664  Line 1657 
1657    
1658                                  current->sStat.kblks++;                                  current->sStat.kblks++;
1659    
                                 if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE) {  
                                         pMB->cbp &= 0x3C;               /* keep only bits 5-2 */  
                                         qcoeff[4*64+0]=0;               /* zero, because for INTRA MBs DC value is saved */  
                                         qcoeff[5*64+0]=0;  
                                 }  
1660                                  MBCoding(current, pMB, qcoeff, bs, &current->sStat);                                  MBCoding(current, pMB, qcoeff, bs, &current->sStat);
1661                                  stop_coding_timer();                                  stop_coding_timer();
1662                                  continue;                                  continue;
# Line 1770  Line 1758 
1758                          }                          }
1759                          /* ordinary case: normal coded INTER/INTER4V block */                          /* ordinary case: normal coded INTER/INTER4V block */
1760    
                         if ((current->vop_flags & XVID_VOP_GREYSCALE))  
                         {       pMB->cbp &= 0x3C;               /* keep only bits 5-2 */  
                                 qcoeff[4*64+0]=0;               /* zero, because DC for INTRA MBs DC value is saved */  
                                 qcoeff[5*64+0]=0;  
                         }  
   
1761                          if((pParam->vol_flags & XVID_VOL_QUARTERPEL)) {                          if((pParam->vol_flags & XVID_VOL_QUARTERPEL)) {
1762                                  VECTOR predMV = get_qpmv2(current->mbs, pParam->mb_width, 0, x, y, 0);                                  VECTOR predMV = get_qpmv2(current->mbs, pParam->mb_width, 0, x, y, 0);
1763                                  pMB->pmvs[0].x = pMB->qmvs[0].x - predMV.x;                                  pMB->pmvs[0].x = pMB->qmvs[0].x - predMV.x;
# Line 1995  Line 1977 
1977    
1978                          if (mb->mode == MODE_DIRECT && (mb->cbp | mb->pmvs[3].x | mb->pmvs[3].y) == 0)                          if (mb->mode == MODE_DIRECT && (mb->cbp | mb->pmvs[3].x | mb->pmvs[3].y) == 0)
1979                                  mb->mode = MODE_DIRECT_NONE_MV; /* skipped */                                  mb->mode = MODE_DIRECT_NONE_MV; /* skipped */
1980                            else
                         /* keep only bits 5-2 -- Chroma blocks will just be skipped by the  
                          * coding function for BFrames, that's why we don't zero teh DC  
                          * coeffs */  
1981                          if (frame->vop_flags & XVID_VOP_GREYSCALE)                          if (frame->vop_flags & XVID_VOP_GREYSCALE)
1982                                            /* keep only bits 5-2 -- Chroma blocks will just be skipped by MBCodingBVOP */
1983                                  mb->cbp &= 0x3C;                                  mb->cbp &= 0x3C;
1984    
1985                          start_timer();                          start_timer();
# Line 2011  Line 1991 
1991    
1992          emms();          emms();
1993    
         /* TODO: dynamic fcode/bcode ??? */  
   
1994          BitstreamPadAlways(bs); /* next_start_code() at the end of VideoObjectPlane() */          BitstreamPadAlways(bs); /* next_start_code() at the end of VideoObjectPlane() */
1995          frame->length = (BitstreamPos(bs) - bits) / 8;          frame->length = (BitstreamPos(bs) - bits) / 8;
1996    

Legend:
Removed from v.1.114  
changed lines
  Added in v.1.115

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