23 |
* |
* |
24 |
* History: |
* History: |
25 |
* |
* |
26 |
|
* 15.04.2002 updated cbr support |
27 |
* 04.04.2002 separated 2-pass code to 2pass.c |
* 04.04.2002 separated 2-pass code to 2pass.c |
28 |
* interlacing support |
* interlacing support |
29 |
* hinted ME support |
* hinted ME support |
237 |
switch (codec->config.mode) |
switch (codec->config.mode) |
238 |
{ |
{ |
239 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
240 |
param.bitrate = codec->config.bitrate; |
param.rc_bitrate = codec->config.rc_bitrate; |
241 |
param.rc_buffersize = codec->config.rc_buffersize; |
param.rc_reaction_delay_factor = codec->config.rc_reaction_delay_factor; |
242 |
|
param.rc_averaging_period = codec->config.rc_averaging_period; |
243 |
|
param.rc_buffer = codec->config.rc_buffer; |
244 |
break; |
break; |
245 |
|
|
246 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
247 |
codec->config.fquant = 0; |
codec->config.fquant = 0; |
248 |
param.bitrate = 0; |
param.rc_bitrate = 0; |
249 |
break; |
break; |
250 |
|
|
251 |
case DLG_MODE_VBR_QUANT : |
case DLG_MODE_VBR_QUANT : |
252 |
codec->config.fquant = (float) codec->config.quant; |
codec->config.fquant = (float) codec->config.quant; |
253 |
param.bitrate = 0; |
param.rc_bitrate = 0; |
254 |
break; |
break; |
255 |
|
|
256 |
case DLG_MODE_2PASS_1 : |
case DLG_MODE_2PASS_1 : |
257 |
case DLG_MODE_2PASS_2_INT : |
case DLG_MODE_2PASS_2_INT : |
258 |
case DLG_MODE_2PASS_2_EXT : |
case DLG_MODE_2PASS_2_EXT : |
259 |
param.bitrate = 0; |
param.rc_bitrate = 0; |
260 |
|
codec->twopass.max_framesize = (int)((double)codec->config.twopass_max_bitrate / 8.0 / ((double)codec->fbase / (double)codec->fincr)); |
261 |
break; |
break; |
262 |
|
|
263 |
case DLG_MODE_NULL : |
case DLG_MODE_NULL : |
283 |
param.fincr = codec->fincr; |
param.fincr = codec->fincr; |
284 |
param.fbase = codec->fbase; |
param.fbase = codec->fbase; |
285 |
|
|
|
param.rc_buffersize = codec->config.rc_buffersize; |
|
|
|
|
286 |
param.min_quantizer = codec->config.min_pquant; |
param.min_quantizer = codec->config.min_pquant; |
287 |
param.max_quantizer = codec->config.max_pquant; |
param.max_quantizer = codec->config.max_pquant; |
288 |
param.max_key_interval = codec->config.max_key_interval; |
param.max_key_interval = codec->config.max_key_interval; |
334 |
} |
} |
335 |
|
|
336 |
codec->ehandle = NULL; |
codec->ehandle = NULL; |
337 |
|
|
338 |
|
codec_2pass_finish(codec); |
339 |
} |
} |
340 |
|
|
341 |
return ICERR_OK; |
return ICERR_OK; |
482 |
{ |
{ |
483 |
frame.intra = 1; |
frame.intra = 1; |
484 |
} |
} |
485 |
else if ((codec->keyspacing < codec->config.min_key_interval && codec->framenum) && |
else if (codec->keyspacing < codec->config.min_key_interval && codec->framenum) |
|
(codec->config.mode == DLG_MODE_2PASS_1)) |
|
486 |
{ |
{ |
487 |
DEBUG("current frame forced to p-frame"); |
DEBUG("current frame forced to p-frame"); |
488 |
frame.intra = 0; |
frame.intra = 0; |