[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.106, Sat Jul 17 11:42:46 2004 UTC revision 1.110, Sun Dec 5 13:56:13 2004 UTC
# Line 103  Line 103 
103          if (*base > 65535 || *inc > 65535) {          if (*base > 65535 || *inc > 65535) {
104                  int *biggest;                  int *biggest;
105                  int *other;                  int *other;
106                    float div;
107    
108                  if (*base > *inc) {                  if (*base > *inc) {
109                          biggest = base;                          biggest = base;
# Line 112  Line 113 
113                          other = base;                          other = base;
114                  }                  }
115    
116                  float div = ((float)*biggest)/((float)65535);                  div = ((float)*biggest)/((float)65535);
117                  *biggest = (int)(((float)*biggest)/div);                  *biggest = (int)(((float)*biggest)/div);
118                  *other = (int)(((float)*other)/div);                  *other = (int)(((float)*other)/div);
119          }          }
# Line 1316  Line 1317 
1317    
1318                  /* prevent vol/vop misuse */                  /* prevent vol/vop misuse */
1319    
                 if (!(pEnc->current->vol_flags & XVID_VOL_REDUCED_ENABLE))  
                         pEnc->current->vop_flags &= ~XVID_VOP_REDUCED;  
   
1320                  if (!(pEnc->current->vol_flags & XVID_VOL_INTERLACING))                  if (!(pEnc->current->vol_flags & XVID_VOL_INTERLACING))
1321                          pEnc->current->vop_flags &= ~(XVID_VOP_TOPFIELDFIRST|XVID_VOP_ALTERNATESCAN);                          pEnc->current->vop_flags &= ~(XVID_VOP_TOPFIELDFIRST|XVID_VOP_ALTERNATESCAN);
1322    
# Line 1446  Line 1444 
1444    
1445          uint16_t x, y;          uint16_t x, y;
1446    
         if ((pEnc->current->vol_flags & XVID_VOL_REDUCED_ENABLE))  
         {  
                 mb_width = (pEnc->mbParam.width + 31) / 32;  
                 mb_height = (pEnc->mbParam.height + 31) / 32;  
   
                 /* 16x16->8x8 downsample requires 1 additional edge pixel*/  
                 /* XXX: setedges is overkill */  
                 start_timer();  
                 image_setedges(&pEnc->current->image,  
                         pEnc->mbParam.edged_width, pEnc->mbParam.edged_height,  
                         pEnc->mbParam.width, pEnc->mbParam.height, 0);  
                 stop_edges_timer();  
         }  
   
1447          pEnc->mbParam.m_rounding_type = 1;          pEnc->mbParam.m_rounding_type = 1;
1448          pEnc->current->rounding_type = pEnc->mbParam.m_rounding_type;          pEnc->current->rounding_type = pEnc->mbParam.m_rounding_type;
1449          pEnc->current->coding_type = I_VOP;          pEnc->current->coding_type = I_VOP;
# Line 1504  Line 1488 
1488                          stop_coding_timer();                          stop_coding_timer();
1489                  }                  }
1490    
         if ((pEnc->current->vop_flags & XVID_VOP_REDUCED))  
         {  
                 image_deblock_rrv(&pEnc->current->image, pEnc->mbParam.edged_width,  
                         pEnc->current->mbs, mb_width, mb_height, pEnc->mbParam.mb_width,  
                         16, 0);  
         }  
1491          emms();          emms();
1492    
1493          BitstreamPadAlways(bs); /* next_start_code() at the end of VideoObjectPlane() */          BitstreamPadAlways(bs); /* next_start_code() at the end of VideoObjectPlane() */
# Line 1555  Line 1533 
1533          /* IMAGE *pCurrent = &current->image; */          /* IMAGE *pCurrent = &current->image; */
1534          IMAGE *pRef = &reference->image;          IMAGE *pRef = &reference->image;
1535    
         if ((current->vop_flags & XVID_VOP_REDUCED))  
         {  
                 mb_width = (pParam->width + 31) / 32;  
                 mb_height = (pParam->height + 31) / 32;  
         }  
   
   
1536          if (!reference->is_edged) {          if (!reference->is_edged) {
1537                  start_timer();                  start_timer();
1538                  image_setedges(pRef, pParam->edged_width, pParam->edged_height,                  image_setedges(pRef, pParam->edged_width, pParam->edged_height,
# Line 1696  Line 1667 
1667                                                                   pParam->height,                                                                   pParam->height,
1668                                                                   pParam->edged_width,                                                                   pParam->edged_width,
1669                                                                   (current->vol_flags & XVID_VOL_QUARTERPEL),                                                                   (current->vol_flags & XVID_VOL_QUARTERPEL),
                                                                  (current->vop_flags & XVID_VOP_REDUCED),  
1670                                                                   current->rounding_type);                                                                   current->rounding_type);
1671    
1672                          stop_comp_timer();                          stop_comp_timer();
# Line 1829  Line 1799 
1799                  }                  }
1800          }          }
1801    
         if ((current->vop_flags & XVID_VOP_REDUCED))  
         {  
                 image_deblock_rrv(&current->image, pParam->edged_width,  
                         current->mbs, mb_width, mb_height, pParam->mb_width,  
                         16, 0);  
         }  
   
1802          emms();          emms();
1803    
1804          if (current->sStat.iMvCount == 0)          if (current->sStat.iMvCount == 0)
# Line 1944  Line 1907 
1907                  fprintf(fp,"Y=%3d   X=%3d   MB=%2d   CBP=%02X\n",y,x,mb->mode,mb->cbp); \                  fprintf(fp,"Y=%3d   X=%3d   MB=%2d   CBP=%02X\n",y,x,mb->mode,mb->cbp); \
1908          }          }
1909    
         /* XXX: pEnc->current->global_flags &= ~XVID_VOP_REDUCED;  reduced resoltion not yet supported */  
   
1910          if (!first){          if (!first){
1911                  fp=fopen("C:\\XVIDDBGE.TXT","w");                  fp=fopen("C:\\XVIDDBGE.TXT","w");
1912          }          }
# Line 2016  Line 1977 
1977                          if (mb->mode == MODE_NOT_CODED) {                          if (mb->mode == MODE_NOT_CODED) {
1978                                  if (pEnc->mbParam.plugin_flags & XVID_REQORIGINAL) {                                  if (pEnc->mbParam.plugin_flags & XVID_REQORIGINAL) {
1979                                          MBMotionCompensation(mb, x, y, f_ref, NULL, f_ref, NULL, NULL, &frame->image,                                          MBMotionCompensation(mb, x, y, f_ref, NULL, f_ref, NULL, NULL, &frame->image,
1980                                                                                          NULL, 0, 0, pEnc->mbParam.edged_width, 0, 0, 0);                                                                                          NULL, 0, 0, pEnc->mbParam.edged_width, 0, 0);
1981                                  }                                  }
1982    
1983                                  continue;                                  continue;

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

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