[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.44, Thu Jun 20 14:05:57 2002 UTC revision 1.53, Wed Jul 10 19:16:32 2002 UTC
# Line 51  Line 51 
51  #include "global.h"  #include "global.h"
52  #include "utils/timer.h"  #include "utils/timer.h"
53  #include "image/image.h"  #include "image/image.h"
54    #ifdef BFRAMES
55    #include "image/font.h"
56    #endif
57  #include "motion/motion.h"  #include "motion/motion.h"
58  #include "bitstream/cbp.h"  #include "bitstream/cbp.h"
59  #include "utils/mbfunctions.h"  #include "utils/mbfunctions.h"
# Line 63  Line 66 
66  #include "quant/quant_matrix.h"  #include "quant/quant_matrix.h"
67  #include "utils/mem_align.h"  #include "utils/mem_align.h"
68    
69    #ifdef _SMP
70    #include "motion/smp_motion_est.h"
71    #endif
72  /*****************************************************************************  /*****************************************************************************
73   * Local macros   * Local macros
74   ****************************************************************************/   ****************************************************************************/
# Line 330  Line 336 
336          /* B Frames specific init */          /* B Frames specific init */
337  #ifdef BFRAMES  #ifdef BFRAMES
338    
339          pEnc->packed = pParam->packed;          pEnc->global = pParam->global;
340          pEnc->mbParam.max_bframes = pParam->max_bframes;          pEnc->mbParam.max_bframes = pParam->max_bframes;
341          pEnc->bquant_ratio = pParam->bquant_ratio;          pEnc->bquant_ratio = pParam->bquant_ratio;
342          pEnc->bframes = NULL;          pEnc->bframes = NULL;
# Line 375  Line 381 
381          pEnc->bframenum_head = 0;          pEnc->bframenum_head = 0;
382          pEnc->bframenum_tail = 0;          pEnc->bframenum_tail = 0;
383          pEnc->flush_bframes = 0;          pEnc->flush_bframes = 0;
384            pEnc->bframenum_dx50bvop = -1;
385    
386          pEnc->queue = NULL;          pEnc->queue = NULL;
387    
# Line 408  Line 415 
415    
416          pEnc->mbParam.m_seconds = 0;          pEnc->mbParam.m_seconds = 0;
417          pEnc->mbParam.m_ticks = 0;          pEnc->mbParam.m_ticks = 0;
418            pEnc->m_framenum = 0;
419  #endif  #endif
420    
421          pParam->handle = (void *) pEnc;          pParam->handle = (void *) pEnc;
# Line 608  Line 616 
616  {  {
617          pEnc->iFrameNum++;          pEnc->iFrameNum++;
618          pEnc->mbParam.m_ticks += pEnc->mbParam.fincr;          pEnc->mbParam.m_ticks += pEnc->mbParam.fincr;
         if (pEnc->mbParam.m_ticks > pEnc->mbParam.fbase) {  
                 pEnc->mbParam.m_seconds++;  
                 pEnc->mbParam.m_ticks = 0;  
         }  
619    
620            pEnc->mbParam.m_seconds = pEnc->mbParam.m_ticks / pEnc->mbParam.fbase;
621            pEnc->mbParam.m_ticks = pEnc->mbParam.m_ticks % pEnc->mbParam.fbase;
622  }  }
623  #endif  #endif
624    
# Line 622  Line 628 
628  {  {
629          if (pEnc->queue_size >= pEnc->mbParam.max_bframes)          if (pEnc->queue_size >= pEnc->mbParam.max_bframes)
630          {          {
631                  DPRINTF("FATAL: QUEUE FULL");                  DPRINTF(DPRINTF_DEBUG,"FATAL: QUEUE FULL");
632                  return;                  return;
633          }          }
634    
635          DPRINTF("*** QUEUE bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",          DPRINTF(DPRINTF_DEBUG,"*** QUEUE bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
636                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
637                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
638    
# Line 694  Line 700 
700                           * frame as a pframe                           * frame as a pframe
701                           */                           */
702    
703                          DPRINTF("*** BFRAME (final frame) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                          DPRINTF(DPRINTF_DEBUG,"*** BFRAME (final frame) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
704                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
705                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
706    
# Line 713  Line 719 
719                  }                  }
720    
721    
722                  DPRINTF("*** BFRAME (flush) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** BFRAME (flush) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
723                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
724                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
725    
# Line 733  Line 739 
739          if (pEnc->bframenum_head > 0) {          if (pEnc->bframenum_head > 0) {
740                  pEnc->bframenum_head = pEnc->bframenum_tail = 0;                  pEnc->bframenum_head = pEnc->bframenum_tail = 0;
741    
742                  if (pEnc->packed) {                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {
743    
744                          DPRINTF("*** EMPTY bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                          DPRINTF(DPRINTF_DEBUG,"*** EMPTY bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
745                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
746                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
747    
   
748                          BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0);                          BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0);
749                          BitstreamPad(&bs);                          BitstreamPad(&bs);
750                          BitstreamPutBits(&bs, 0x7f, 8);                          BitstreamPutBits(&bs, 0x7f, 8);
# Line 757  Line 762 
762    
763  bvop_loop:  bvop_loop:
764    
765          if (input_valid) {          if (pEnc->bframenum_dx50bvop != -1)
766            {
767    
768                    SWAP(pEnc->current, pEnc->reference);
769                    SWAP(pEnc->current, pEnc->bframes[pEnc->bframenum_dx50bvop]);
770    
771                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
772                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 100, "DX50 IVOP");
773                    }
774    
775                    if (input_valid)
776                    {
777                            queue_image(pEnc, pFrame);
778                            input_valid = 0;
779                    }
780    
781            } else if (input_valid) {
782    
783                  SWAP(pEnc->current, pEnc->reference);                  SWAP(pEnc->current, pEnc->reference);
784    
# Line 790  Line 811 
811    
812          } else if (BitstreamPos(&bs) == 0) {          } else if (BitstreamPos(&bs) == 0) {
813    
814                  DPRINTF("*** SKIP bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** SKIP bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
815                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
816                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
817    
   
818                  pFrame->intra = 0;                  pFrame->intra = 0;
819    
820                  BitstreamPutBits(&bs, 0x7f, 8);                  BitstreamPutBits(&bs, 0x7f, 8);
# Line 816  Line 836 
836           * comment style :-)           * comment style :-)
837           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
838    
 //$$    SWAP(pEnc->current, pEnc->reference);  
   
839          emms();          emms();
840    
841            // only inc frame num, adapt quant, etc. if we havent seen it before
842            if (pEnc->bframenum_dx50bvop < 0 )
843            {
844          if (pFrame->quant == 0)          if (pFrame->quant == 0)
845                  pEnc->current->quant = RateControlGetQ(&pEnc->rate_control, 0);                  pEnc->current->quant = RateControlGetQ(&pEnc->rate_control, 0);
846          else          else
# Line 833  Line 854 
854    
855          pEnc->current->global_flags = pFrame->general;          pEnc->current->global_flags = pFrame->general;
856          pEnc->current->motion_flags = pFrame->motion;          pEnc->current->motion_flags = pFrame->motion;
857          pEnc->current->seconds = pEnc->mbParam.m_seconds;  
         pEnc->current->ticks = pEnc->mbParam.m_ticks;  
858          /* ToDo : dynamic fcode (in both directions) */          /* ToDo : dynamic fcode (in both directions) */
859          pEnc->current->fcode = pEnc->mbParam.m_fcode;          pEnc->current->fcode = pEnc->mbParam.m_fcode;
860          pEnc->current->bcode = pEnc->mbParam.m_fcode;          pEnc->current->bcode = pEnc->mbParam.m_fcode;
861    
862  //$$$   start_timer();                  pEnc->current->seconds = pEnc->mbParam.m_seconds;
863  //$$$   if (image_input                  pEnc->current->ticks = pEnc->mbParam.m_ticks;
864  //$$$           (&pEnc->current->image, pEnc->mbParam.width, pEnc->mbParam.height,  
865  //$$$            pEnc->mbParam.edged_width, pFrame->image, pFrame->colorspace))                  inc_frame_num(pEnc);
 //$$$           return XVID_ERR_FORMAT;  
 //$$$   stop_conv_timer();  
866    
867  #ifdef _DEBUG_PSNR  #ifdef _DEBUG_PSNR
868          image_copy(&pEnc->sOriginal, &pEnc->current->image,          image_copy(&pEnc->sOriginal, &pEnc->current->image,
# Line 853  Line 871 
871    
872          emms();          emms();
873    
874                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
875                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 5,
876                                    "%i  if:%i  st:%i:%i", pEnc->m_framenum++, pEnc->iFrameNum, pEnc->current->seconds, pEnc->current->ticks);
877                    }
878    
879          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
880           * Luminance masking           * Luminance masking
881           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
# Line 882  Line 905 
905                          }                          }
906    
907  #undef OFFSET  #undef OFFSET
   
908                  }                  }
909    
910                  xvid_free(temp_dquants);                  xvid_free(temp_dquants);
911          }          }
912    
913            }
914    
915          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
916           * ivop/pvop/bvop selection           * ivop/pvop/bvop selection
917           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
918    
919    
920          if (pEnc->iFrameNum == 0 || pFrame->intra == 1 ||          if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop >= 0 ||
921                  (pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 &&                  (pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 &&
922                   pEnc->iFrameNum >= pEnc->iMaxKeyInterval)                   pEnc->iFrameNum >= pEnc->iMaxKeyInterval)
923                  || image_mad(&pEnc->reference->image, &pEnc->current->image,                  || image_mad(&pEnc->reference->image, &pEnc->current->image,
# Line 903  Line 927 
927                   * This will be coded as an Intra Frame                   * This will be coded as an Intra Frame
928                   */                   */
929    
930                  DPRINTF("*** IFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** IFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
931                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
932                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
933    
934                  FrameCodeI(pEnc, &bs, &bits);                  if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
935                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "IVOP");
936                    }
937    
938                    // when we reach an iframe in DX50BVOP mode, encode the last bframe as a pframe
939    
940                    if ((pEnc->global & XVID_GLOBAL_DX50BVOP) && pEnc->bframenum_tail > 0) {
941    
942                            pEnc->bframenum_tail--;
943                            pEnc->bframenum_dx50bvop = pEnc->bframenum_tail;
944    
945                            SWAP(pEnc->current, pEnc->bframes[pEnc->bframenum_dx50bvop]);
946                            if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
947                                    image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 100, "DX50 BVOP->PVOP");
948                            }
949                            FrameCodeP(pEnc, &bs, &bits, 1, 0);
950    
951                            pFrame->intra = 0;
952    
953                    } else {
954    
955                            FrameCodeI(pEnc, &bs, &bits);
956                  pFrame->intra = 1;                  pFrame->intra = 1;
                 pEnc->flush_bframes = 1;  
957    
958                  inc_frame_num(pEnc);                          pEnc->bframenum_dx50bvop = -1;
959                    }
960    
961                    pEnc->flush_bframes = 1;
962    
963                  if (pEnc->packed) {                  if ((pEnc->global & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0) {
964                          BitstreamPad(&bs);                          BitstreamPad(&bs);
965                          input_valid = 0;                          input_valid = 0;
966                          goto ipvop_loop;                          goto ipvop_loop;
# Line 929  Line 975 
975                   * This will be coded as a Predicted Frame                   * This will be coded as a Predicted Frame
976                   */                   */
977    
978                  DPRINTF("*** PFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** PFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
979                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
980                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
981    
982                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
983                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "PVOP");
984                    }
985    
986                  FrameCodeP(pEnc, &bs, &bits, 1, 0);                  FrameCodeP(pEnc, &bs, &bits, 1, 0);
987                  pFrame->intra = 0;                  pFrame->intra = 0;
988                  pEnc->flush_bframes = 1;                  pEnc->flush_bframes = 1;
989    
990                  inc_frame_num(pEnc);                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {
   
                 if (pEnc->packed) {  
991                          BitstreamPad(&bs);                          BitstreamPad(&bs);
992                          input_valid = 0;                          input_valid = 0;
993                          goto ipvop_loop;                          goto ipvop_loop;
# Line 950  Line 998 
998                   * This will be coded as a Bidirectional Frame                   * This will be coded as a Bidirectional Frame
999                   */                   */
1000    
1001                  DPRINTF("*** BFRAME (store) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** BFRAME (store) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
1002                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
1003                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
1004    
1005                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
1006                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "BVOP");
1007                    }
1008    
1009                  if (pFrame->bquant < 1) {                  if (pFrame->bquant < 1) {
1010                          pEnc->current->quant =                          pEnc->current->quant =
1011                                  ((pEnc->reference->quant +                                  ((pEnc->reference->quant +
# Line 971  Line 1023 
1023                  pFrame->intra = 0;                  pFrame->intra = 0;
1024                  pFrame->length = 0;                  pFrame->length = 0;
1025    
                 inc_frame_num(pEnc);  
   
1026                  input_valid = 0;                  input_valid = 0;
1027                  goto bvop_loop;                  goto bvop_loop;
1028          }          }
# Line 1265  Line 1315 
1315                                  &pEnc->current->mbs[x + y * pEnc->mbParam.mb_width];                                  &pEnc->current->mbs[x + y * pEnc->mbParam.mb_width];
1316                          MVBLOCKHINT *bhint =                          MVBLOCKHINT *bhint =
1317                                  &hint->mvhint.block[x + y * pEnc->mbParam.mb_width];                                  &hint->mvhint.block[x + y * pEnc->mbParam.mb_width];
1318                          VECTOR pred[4];                          VECTOR pred;
1319                          VECTOR tmp;                          VECTOR tmp;
                         int32_t dummy[4];  
1320                          int vec;                          int vec;
1321    
1322                          pMB->mode =                          pMB->mode =
# Line 1287  Line 1336 
1336                                  tmp.x -= (tmp.x >= high) ? high * 2 : 0;                                  tmp.x -= (tmp.x >= high) ? high * 2 : 0;
1337                                  tmp.y -= (tmp.y >= high) ? high * 2 : 0;                                  tmp.y -= (tmp.y >= high) ? high * 2 : 0;
1338    
1339                                  get_pmvdata(pEnc->current->mbs, x, y, pEnc->mbParam.mb_width,                                  pred = get_pmv2(pEnc->current->mbs,pEnc->mbParam.mb_width,0,x,y,0);
                                                         0, pred, dummy);  
1340    
1341                                  for (vec = 0; vec < 4; ++vec) {                                  for (vec = 0; vec < 4; ++vec) {
1342                                          pMB->mvs[vec].x = tmp.x;                                          pMB->mvs[vec].x = tmp.x;
1343                                          pMB->mvs[vec].y = tmp.y;                                          pMB->mvs[vec].y = tmp.y;
1344                                          pMB->pmvs[vec].x = pMB->mvs[0].x - pred[0].x;                                          pMB->pmvs[vec].x = pMB->mvs[0].x - pred.x;
1345                                          pMB->pmvs[vec].y = pMB->mvs[0].y - pred[0].y;                                          pMB->pmvs[vec].y = pMB->mvs[0].y - pred.y;
1346                                  }                                  }
1347                          } else if (pMB->mode == MODE_INTER4V) {                          } else if (pMB->mode == MODE_INTER4V) {
1348                                  for (vec = 0; vec < 4; ++vec) {                                  for (vec = 0; vec < 4; ++vec) {
# Line 1307  Line 1355 
1355                                          tmp.x -= (tmp.x >= high) ? high * 2 : 0;                                          tmp.x -= (tmp.x >= high) ? high * 2 : 0;
1356                                          tmp.y -= (tmp.y >= high) ? high * 2 : 0;                                          tmp.y -= (tmp.y >= high) ? high * 2 : 0;
1357    
1358                                          get_pmvdata(pEnc->current->mbs, x, y,                                          pred = get_pmv2(pEnc->current->mbs,pEnc->mbParam.mb_width,0,x,y,vec);
                                                                 pEnc->mbParam.mb_width, vec, pred, dummy);  
1359    
1360                                          pMB->mvs[vec].x = tmp.x;                                          pMB->mvs[vec].x = tmp.x;
1361                                          pMB->mvs[vec].y = tmp.y;                                          pMB->mvs[vec].y = tmp.y;
1362                                          pMB->pmvs[vec].x = pMB->mvs[vec].x - pred[0].x;                                          pMB->pmvs[vec].x = pMB->mvs[vec].x - pred.x;
1363                                          pMB->pmvs[vec].y = pMB->mvs[vec].y - pred[0].y;                                          pMB->pmvs[vec].y = pMB->mvs[vec].y - pred.y;
1364                                  }                                  }
1365                          } else                          // intra / stuffing / not_coded                          } else                          // intra / stuffing / not_coded
1366                          {                          {
# Line 1445  Line 1492 
1492          BitstreamWriteVolHeader(bs, &pEnc->mbParam, pEnc->current);          BitstreamWriteVolHeader(bs, &pEnc->mbParam, pEnc->current);
1493  #ifdef BFRAMES  #ifdef BFRAMES
1494  #define DIVX501B481P "DivX501b481p"  #define DIVX501B481P "DivX501b481p"
1495          if (pEnc->packed) {          if ((pEnc->global & XVID_GLOBAL_PACKED)) {
1496                  BitstreamWriteUserData(bs, DIVX501B481P, strlen(DIVX501B481P));                  BitstreamWriteUserData(bs, DIVX501B481P, strlen(DIVX501B481P));
1497          }          }
1498  #endif  #endif
# Line 1544  Line 1591 
1591          if (pEnc->current->global_flags & XVID_HINTEDME_SET) {          if (pEnc->current->global_flags & XVID_HINTEDME_SET) {
1592                  HintedMESet(pEnc, &bIntra);                  HintedMESet(pEnc, &bIntra);
1593          } else {          } else {
1594    
1595    #ifdef _SMP
1596                    if (NUMTHREADS > 1)
1597                            bIntra =
1598                                    SMP_MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,
1599                                                             &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,
1600                                                             iLimit);
1601                    else
1602    #endif
1603    
1604                  bIntra =                  bIntra =
1605                          MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,                          MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,
1606                                                           &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,                                                           &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,
1607                                                           iLimit);                                                           iLimit);
1608    
1609    
1610          }          }
1611          stop_motion_timer();          stop_motion_timer();
1612    
# Line 1781  Line 1840 
1840                                  backward.x = mb->b_mvs[0].x;                                  backward.x = mb->b_mvs[0].x;
1841                                  backward.y = mb->b_mvs[0].y;                                  backward.y = mb->b_mvs[0].y;
1842                          }                          }
1843  //          printf("[%i %i] M=%i CBP=%i MVX=%i MVY=%i %i,%i  %i,%i\n", x, y, pMB->mode, pMB->cbp, pMB->mvs[0].x, bmb->pmvs[0].x, bmb->pmvs[0].y, forward.x, forward.y);  //                      DPRINTF("%05i : [%i %i] M=%i CBP=%i MVS=%i,%i forward=%i,%i", pEnc->m_framenum, x, y, mb->mode, mb->cbp, mb->mvs[0].x, mb->mvs[0].y, forward.x, forward.y);
1844    
1845                          start_timer();                          start_timer();
1846                          MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs,                          MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs,

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.53

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