[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.110, Sun Dec 5 13:56:13 2004 UTC revision 1.111, Wed Dec 8 12:43:48 2004 UTC
# Line 1558  Line 1558 
1558                  }                  }
1559          }          }
1560    
1561            current->sStat.iTextBits = current->sStat.iMvSum = current->sStat.iMvCount =
1562                    current->sStat.kblks = current->sStat.mblks = current->sStat.ublks = 0;
1563    
1564          current->coding_type = P_VOP;          current->coding_type = P_VOP;
1565    
1566          call_plugins(pEnc, pEnc->current, NULL, XVID_PLG_FRAME, NULL, NULL, NULL);          call_plugins(pEnc, pEnc->current, NULL, XVID_PLG_FRAME, NULL, NULL, NULL);
# Line 1626  Line 1629 
1629    
1630          BitstreamWriteVopHeader(bs, &pEnc->mbParam, current, 1, current->mbs[0].quant);          BitstreamWriteVopHeader(bs, &pEnc->mbParam, current, 1, current->mbs[0].quant);
1631    
         current->sStat.iTextBits = current->sStat.iMvSum = current->sStat.iMvCount =  
                 current->sStat.kblks = current->sStat.mblks = current->sStat.ublks = 0;  
   
   
1632          for (y = 0; y < mb_height; y++) {          for (y = 0; y < mb_height; y++) {
1633                  for (x = 0; x < mb_width; x++) {                  for (x = 0; x < mb_width; x++) {
1634                          MACROBLOCK *pMB =                          MACROBLOCK *pMB =
# Line 1806  Line 1805 
1805    
1806          fSigma = (float) sqrt((float) current->sStat.iMvSum / current->sStat.iMvCount);          fSigma = (float) sqrt((float) current->sStat.iMvSum / current->sStat.iMvCount);
1807    
1808          iSearchRange = 1 << (3 + pParam->m_fcode);          iSearchRange = 16 << pParam->m_fcode;
1809    
1810          if ((fSigma > iSearchRange / 3)          if ((3.0 * fSigma > iSearchRange) && (pParam->m_fcode <= 5) )
                 && (pParam->m_fcode <= (3 +  (pParam->vol_flags & XVID_VOL_QUARTERPEL?1:0)  ))) /* maximum search range 128 */  
         {  
1811                  pParam->m_fcode++;                  pParam->m_fcode++;
1812                  iSearchRange *= 2;  
1813          } else if ((fSigma < iSearchRange / 6)          else if ((5.0 * fSigma < iSearchRange)
1814                             && (pEnc->fMvPrevSigma >= 0)                             && (4.0 * pEnc->fMvPrevSigma < iSearchRange)
1815                             && (pEnc->fMvPrevSigma < iSearchRange / 6)                             && (pParam->m_fcode >= 2) )  /* minimum search range 32 */
                            && (pParam->m_fcode >= (2 + (pParam->vol_flags & XVID_VOL_QUARTERPEL?1:0) )))        /* minimum search range 16 */  
         {  
1816                  pParam->m_fcode--;                  pParam->m_fcode--;
                 iSearchRange /= 2;  
         }  
1817    
1818          pEnc->fMvPrevSigma = fSigma;          pEnc->fMvPrevSigma = fSigma;
1819    

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

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