[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.88, Tue Nov 26 23:44:09 2002 UTC revision 1.90.2.1, Mon Mar 17 23:09:27 2003 UTC
# Line 78  Line 78 
78  #include "quant/quant_matrix.h"  #include "quant/quant_matrix.h"
79  #include "utils/mem_align.h"  #include "utils/mem_align.h"
80    
 #ifdef _SMP  
 #include "motion/smp_motion_est.h"  
 #endif  
81  /*****************************************************************************  /*****************************************************************************
82   * Local macros   * Local macros
83   ****************************************************************************/   ****************************************************************************/
# Line 239  Line 236 
236    
237          pEnc->mbParam.m_quant_type = H263_QUANT;          pEnc->mbParam.m_quant_type = H263_QUANT;
238    
 #ifdef _SMP  
         pEnc->mbParam.num_threads = MIN(pParam->num_threads, MAXNUMTHREADS);  
 #endif  
   
239          pEnc->sStat.fMvPrevSigma = -1;          pEnc->sStat.fMvPrevSigma = -1;
240    
241          /* Fill rate control parameters */          /* Fill rate control parameters */
# Line 550  Line 543 
543    
544          }          }
545    
546          BitstreamPutBits(&bs, 0xFFFF, 16);          /* Fix from CVS_HEAD (2003-03-17)
547          BitstreamPutBits(&bs, 0xFFFF, 16);           *
548             * Relic from OpenDivX - now disabled
549             *
550             * BitstreamPutBits(&bs, 0xFFFF, 16);
551             * BitstreamPutBits(&bs, 0xFFFF, 16);
552             */
553          BitstreamPad(&bs);          BitstreamPad(&bs);
554          pFrame->length = BitstreamLength(&bs);          pFrame->length = BitstreamLength(&bs);
555    
# Line 643  Line 641 
641                  return;                  return;
642          }          }
643    
644          pEnc->current->fcode =          pEnc->current->fcode = (hint->rawhints != 0) ?
645                  (hint->rawhints) ? hint->mvhint.fcode : BitstreamGetBits(&bs,                  (uint32_t)hint->mvhint.fcode : BitstreamGetBits(&bs, FCODEBITS);
                                                                                                                                  FCODEBITS);  
646    
647          length = pEnc->current->fcode + 5;          length = pEnc->current->fcode + 5;
648          high = 1 << (length - 1);          high = 1 << (length - 1);
# Line 660  Line 657 
657                          VECTOR tmp;                          VECTOR tmp;
658                          int vec;                          int vec;
659    
660                          pMB->mode =                          pMB->mode = (hint->rawhints != 0) ?
661                                  (hint->rawhints) ? bhint->mode : BitstreamGetBits(&bs,                                  (uint32_t)bhint->mode : BitstreamGetBits(&bs, MODEBITS);
                                                                                                                                   MODEBITS);  
662    
663                          pMB->mode = (pMB->mode == MODE_INTER_Q) ? MODE_INTER : pMB->mode;                          pMB->mode = (pMB->mode == MODE_INTER_Q) ? MODE_INTER : pMB->mode;
664                          pMB->mode = (pMB->mode == MODE_INTRA_Q) ? MODE_INTRA : pMB->mode;                          pMB->mode = (pMB->mode == MODE_INTRA_Q) ? MODE_INTRA : pMB->mode;
665    
666                          if (pMB->mode == MODE_INTER) {                          if (pMB->mode == MODE_INTER) {
667                                  tmp.x =                                  tmp.x = (hint->rawhints) ?
668                                          (hint->rawhints) ? bhint->mvs[0].x : BitstreamGetBits(&bs,                                          bhint->mvs[0].x : (int)BitstreamGetBits(&bs, length);
669                                                                                                                                                    length);                                  tmp.y = (hint->rawhints) ?
670                                  tmp.y =                                          bhint->mvs[0].y : (int)BitstreamGetBits(&bs, length);
                                         (hint->rawhints) ? bhint->mvs[0].y : BitstreamGetBits(&bs,  
                                                                                                                                                   length);  
671                                  tmp.x -= (tmp.x >= high) ? high * 2 : 0;                                  tmp.x -= (tmp.x >= high) ? high * 2 : 0;
672                                  tmp.y -= (tmp.y >= high) ? high * 2 : 0;                                  tmp.y -= (tmp.y >= high) ? high * 2 : 0;
673    
# Line 687  Line 681 
681                                  }                                  }
682                          } else if (pMB->mode == MODE_INTER4V) {                          } else if (pMB->mode == MODE_INTER4V) {
683                                  for (vec = 0; vec < 4; ++vec) {                                  for (vec = 0; vec < 4; ++vec) {
684                                          tmp.x =                                          tmp.x = (hint->rawhints) ?
685                                                  (hint->rawhints) ? bhint->mvs[vec].                                                  bhint->mvs[vec].x : (int)BitstreamGetBits(&bs, length);
686                                                  x : BitstreamGetBits(&bs, length);                                          tmp.y = (hint->rawhints) ?
687                                          tmp.y =                                                  bhint->mvs[vec].y : (int)BitstreamGetBits(&bs, length);
                                                 (hint->rawhints) ? bhint->mvs[vec].  
                                                 y : BitstreamGetBits(&bs, length);  
688                                          tmp.x -= (tmp.x >= high) ? high * 2 : 0;                                          tmp.x -= (tmp.x >= high) ? high * 2 : 0;
689                                          tmp.y -= (tmp.y >= high) ? high * 2 : 0;                                          tmp.y -= (tmp.y >= high) ? high * 2 : 0;
690    
# Line 932  Line 924 
924                  HintedMESet(pEnc, &bIntra);                  HintedMESet(pEnc, &bIntra);
925          } else {          } else {
926    
 #ifdef _SMP  
         if (pEnc->mbParam.num_threads > 1)  
                 bIntra =  
                         SMP_MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,  
                                                  &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,  
                                                  iLimit);  
         else  
 #endif  
927                  bIntra =                  bIntra =
928                          MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,                          MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,
929                           &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,                           &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,

Legend:
Removed from v.1.88  
changed lines
  Added in v.1.90.2.1

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