[cvs] / xvidcore / src / plugins / plugin_2pass2.c Repository:
ViewVC logotype

Diff of /xvidcore/src/plugins/plugin_2pass2.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5, Sat Jun 12 13:53:19 2004 UTC revision 1.8, Wed Jul 1 09:25:38 2009 UTC
# Line 457  Line 457 
457          if (rc->param.vbv_size==0) {          if (rc->param.vbv_size==0) {
458                  rc->param.vbv_size      =  3145728;                  rc->param.vbv_size      =  3145728;
459                  rc->param.vbv_initial   =  2359296;                  rc->param.vbv_initial   =  2359296;
460                  rc->param.vbv_maxrate  =  4000000;                  rc->param.vbv_maxrate   =  4854000;
461                  rc->param.vbv_peakrate = 10000000;                  rc->param.vbv_peakrate  =  8000000;
462          }          }
463  #endif  #endif
464    
# Line 857  Line 857 
857                  rc->KFoverflow -= rc->KFoverflow_partial;                  rc->KFoverflow -= rc->KFoverflow_partial;
858          }          }
859    
860          rc->overflow += (s->error = s->desired_length - data->length);          s->error = s->desired_length - data->length;
861          rc->real_total += data->length;          rc->real_total += data->length;
862    
863          DPRINTF(XVID_DEBUG_RC, "[xvid rc] -- frame:%d type:%c quant:%d stats:%d scaled:%d desired:%d actual:%d error:%d overflow:%.2f\n",          DPRINTF(XVID_DEBUG_RC, "[xvid rc] -- frame:%d type:%c quant:%d stats:%d scaled:%d desired:%d actual:%d error:%d overflow:%.2f\n",
# Line 954  Line 954 
954          /* We are done with the file */          /* We are done with the file */
955          fclose(f);          fclose(f);
956    
957          return(0);          if (!rc->num_keyframes) return (-1); /* No keyframes? Then something is wrong */
958            else return(0);
959  }  }
960    
961  /* open stats file(s) and read into rc->stats array */  /* open stats file(s) and read into rc->stats array */
# Line 1461  Line 1462 
1462           * typical values from DivX Home Theater profile:           * typical values from DivX Home Theater profile:
1463           *  vbv_size= 384*1024 (384kB)           *  vbv_size= 384*1024 (384kB)
1464           *  vbv_initial= 288*1024 (75% fill)           *  vbv_initial= 288*1024 (75% fill)
1465           *  maxrate= 4000000 (4MBps)           *  maxrate= 4854000 (4.854MBps)
1466           *  peakrate= 10000000 (10MBps)           *  peakrate= 8000000 (8MBps)
1467           *           *
1468           *  PAL: offset3s = 75 (3 seconds of 25fps)           *  PAL: offset3s = 75 (3 seconds of 25fps)
1469           *  NTSC: offset3s = 90 (3 seconds of 29.97fps) or 72 (3 seconds of 23.976fps)           *  NTSC: offset3s = 90 (3 seconds of 29.97fps) or 72 (3 seconds of 23.976fps)
# Line 1490  Line 1491 
1491                  if (i>=offset3s)                  if (i>=offset3s)
1492                          bytes3s -= rc->stats[i-offset3s].scaled_length;                          bytes3s -= rc->stats[i-offset3s].scaled_length;
1493    
1494                  if (8.f*bytes3s > 3*peakrate)      /* ignore peakrate constraint if peakrate is <= 0.f */
1495                    if (peakrate>0.f && 8.f*bytes3s > 3*peakrate)
1496                          return(VBV_PEAKRATE);                          return(VBV_PEAKRATE);
1497    
1498                  /* update vbv fill level */                  /* update vbv fill level */

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.8

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