[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.95.2.15, Wed Mar 26 14:56:10 2003 UTC revision 1.95.2.18, Wed Apr 2 20:43:56 2003 UTC
# Line 202  Line 202 
202          pEnc->mbParam.frame_drop_ratio = MAX(create->frame_drop_ratio, 0);          pEnc->mbParam.frame_drop_ratio = MAX(create->frame_drop_ratio, 0);
203    
204      /* max keyframe interval */      /* max keyframe interval */
205      pEnc->mbParam.iMaxKeyInterval = create->max_key_interval <=0 ? 250 : create->max_key_interval;      pEnc->mbParam.iMaxKeyInterval = create->max_key_interval <= 0 ?
206      /*XXX: replace 250 hard code with "10seconds * framerate" */                  10 * pEnc->mbParam.fbase / pEnc->mbParam.fincr : create->max_key_interval;
207    
208          /* Bitrate allocator defaults          /* Bitrate allocator defaults
209    
# Line 1041  Line 1041 
1041                  }else{                  }else{
1042                          type = MEanalysis(&pEnc->reference->image, pEnc->current,                          type = MEanalysis(&pEnc->reference->image, pEnc->current,
1043                                          &pEnc->mbParam, pEnc->mbParam.iMaxKeyInterval,                                          &pEnc->mbParam, pEnc->mbParam.iMaxKeyInterval,
1044                                          pEnc->iFrameNum, pEnc->bframenum_tail);                                          pEnc->iFrameNum, pEnc->bframenum_tail, xFrame->bframe_threshold);
1045    
1046              if (type == B_VOP && !(pEnc->current->vop_flags & XVID_VOP_DYNAMIC_BFRAMES)) {              if (type == B_VOP && !(pEnc->current->vop_flags & XVID_VOP_DYNAMIC_BFRAMES)) {
1047                  type = P_VOP;   /* disable dynamic bframes */                  type = P_VOP;   /* disable dynamic bframes */
# Line 1353  Line 1353 
1353          }          }
1354          emms();          emms();
1355    
1356    /* XXX: Remove the two #if 0 blocks when we are sure we must always pad the stream */
1357    #if 0
1358          /* for divx5 compatibility, we must always pad between the packed p and b frames */          /* for divx5 compatibility, we must always pad between the packed p and b frames */
1359          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0)          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0)
1360    #endif
1361                  BitstreamPadAlways(bs);                  BitstreamPadAlways(bs);
1362    #if 0
1363          else          else
1364                  BitstreamPad(bs);                  BitstreamPad(bs);
1365    #endif
1366      pEnc->current->length = (BitstreamPos(bs) - bits) / 8;      pEnc->current->length = (BitstreamPos(bs) - bits) / 8;
1367    
1368          pEnc->fMvPrevSigma = -1;          pEnc->fMvPrevSigma = -1;
# Line 1754  Line 1759 
1759          }          }
1760          */          */
1761    
1762    /* XXX: Remove the two #if 0 blocks when we are sure we must always pad the stream */
1763    #if 0
1764          /* for divx5 compatibility, we must always pad between the packed p and b frames */          /* for divx5 compatibility, we must always pad between the packed p and b frames */
1765          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0)          if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0)
1766    #endif
1767                  BitstreamPadAlways(bs);                  BitstreamPadAlways(bs);
1768    #if 0
1769          else          else
1770                  BitstreamPad(bs);                  BitstreamPad(bs);
1771    #endif
1772    
1773      pEnc->current->length = (BitstreamPos(bs) - bits) / 8;      pEnc->current->length = (BitstreamPos(bs) - bits) / 8;
1774    
# Line 1890  Line 1900 
1900    
1901          /* TODO: dynamic fcode/bcode ??? */          /* TODO: dynamic fcode/bcode ??? */
1902    
1903      BitstreamPad(bs);      BitstreamPadAlways(bs);
1904          frame->length = (BitstreamPos(bs) - bits) / 8;          frame->length = (BitstreamPos(bs) - bits) / 8;
1905    
1906  #ifdef BFRAMES_DEC_DEBUG  #ifdef BFRAMES_DEC_DEBUG

Legend:
Removed from v.1.95.2.15  
changed lines
  Added in v.1.95.2.18

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