[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.47, Sun Jun 23 19:48:06 2002 UTC
# Line 330  Line 330 
330          /* B Frames specific init */          /* B Frames specific init */
331  #ifdef BFRAMES  #ifdef BFRAMES
332    
333          pEnc->packed = pParam->packed;          pEnc->global = pParam->global;
334          pEnc->mbParam.max_bframes = pParam->max_bframes;          pEnc->mbParam.max_bframes = pParam->max_bframes;
335          pEnc->bquant_ratio = pParam->bquant_ratio;          pEnc->bquant_ratio = pParam->bquant_ratio;
336          pEnc->bframes = NULL;          pEnc->bframes = NULL;
# Line 408  Line 408 
408    
409          pEnc->mbParam.m_seconds = 0;          pEnc->mbParam.m_seconds = 0;
410          pEnc->mbParam.m_ticks = 0;          pEnc->mbParam.m_ticks = 0;
411            pEnc->m_framenum = 0;
412  #endif  #endif
413    
414          pParam->handle = (void *) pEnc;          pParam->handle = (void *) pEnc;
# Line 608  Line 609 
609  {  {
610          pEnc->iFrameNum++;          pEnc->iFrameNum++;
611          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;  
         }  
612    
613            pEnc->mbParam.m_seconds = pEnc->mbParam.m_ticks / pEnc->mbParam.fbase;
614            pEnc->mbParam.m_ticks = pEnc->mbParam.m_ticks % pEnc->mbParam.fbase;
615  }  }
616  #endif  #endif
617    
# Line 733  Line 732 
732          if (pEnc->bframenum_head > 0) {          if (pEnc->bframenum_head > 0) {
733                  pEnc->bframenum_head = pEnc->bframenum_tail = 0;                  pEnc->bframenum_head = pEnc->bframenum_tail = 0;
734    
735                  if (pEnc->packed) {                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {
736    
737                          DPRINTF("*** EMPTY bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                          DPRINTF("*** EMPTY bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
738                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
# Line 853  Line 852 
852    
853          emms();          emms();
854    
855            if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
856                    image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 5,
857                            "%i  if:%i  st:%i:%i", pEnc->m_framenum++, pEnc->iFrameNum, pEnc->current->seconds, pEnc->current->ticks);
858            }
859    
860    
861          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
862           * Luminance masking           * Luminance masking
863           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
# Line 907  Line 912 
912                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
913                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
914    
915                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
916                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "IVOP");
917                    }
918    
919                  FrameCodeI(pEnc, &bs, &bits);                  FrameCodeI(pEnc, &bs, &bits);
920    
921                  pFrame->intra = 1;                  pFrame->intra = 1;
# Line 914  Line 923 
923    
924                  inc_frame_num(pEnc);                  inc_frame_num(pEnc);
925    
926                  if (pEnc->packed) {                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {
927                          BitstreamPad(&bs);                          BitstreamPad(&bs);
928                          input_valid = 0;                          input_valid = 0;
929                          goto ipvop_loop;                          goto ipvop_loop;
# Line 933  Line 942 
942                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
943                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
944    
945                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
946                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "PVOP");
947                    }
948    
949                  FrameCodeP(pEnc, &bs, &bits, 1, 0);                  FrameCodeP(pEnc, &bs, &bits, 1, 0);
950                  pFrame->intra = 0;                  pFrame->intra = 0;
951                  pEnc->flush_bframes = 1;                  pEnc->flush_bframes = 1;
952    
953                  inc_frame_num(pEnc);                  inc_frame_num(pEnc);
954    
955                  if (pEnc->packed) {                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {
956                          BitstreamPad(&bs);                          BitstreamPad(&bs);
957                          input_valid = 0;                          input_valid = 0;
958                          goto ipvop_loop;                          goto ipvop_loop;
# Line 954  Line 967 
967                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
968                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
969    
970                    if ((pEnc->global & XVID_GLOBAL_DEBUG)) {
971                            image_printf(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->mbParam.height, 5, 200, "BVOP");
972                    }
973    
974                  if (pFrame->bquant < 1) {                  if (pFrame->bquant < 1) {
975                          pEnc->current->quant =                          pEnc->current->quant =
976                                  ((pEnc->reference->quant +                                  ((pEnc->reference->quant +
# Line 1445  Line 1462 
1462          BitstreamWriteVolHeader(bs, &pEnc->mbParam, pEnc->current);          BitstreamWriteVolHeader(bs, &pEnc->mbParam, pEnc->current);
1463  #ifdef BFRAMES  #ifdef BFRAMES
1464  #define DIVX501B481P "DivX501b481p"  #define DIVX501B481P "DivX501b481p"
1465          if (pEnc->packed) {          if ((pEnc->global & XVID_GLOBAL_PACKED)) {
1466                  BitstreamWriteUserData(bs, DIVX501B481P, strlen(DIVX501B481P));                  BitstreamWriteUserData(bs, DIVX501B481P, strlen(DIVX501B481P));
1467          }          }
1468  #endif  #endif
# Line 1781  Line 1798 
1798                                  backward.x = mb->b_mvs[0].x;                                  backward.x = mb->b_mvs[0].x;
1799                                  backward.y = mb->b_mvs[0].y;                                  backward.y = mb->b_mvs[0].y;
1800                          }                          }
1801  //          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);
1802    
1803                          start_timer();                          start_timer();
1804                          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.47

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