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 |
|
|
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 */ |
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) |
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 */ |