218 |
|
|
219 |
LRESULT compress_get_size(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiOutput) |
LRESULT compress_get_size(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiOutput) |
220 |
{ |
{ |
221 |
return lpbiOutput->bmiHeader.biWidth * lpbiOutput->bmiHeader.biHeight * 3; |
return |
222 |
|
#ifdef BFRAMES |
223 |
|
2 * |
224 |
|
#endif |
225 |
|
lpbiOutput->bmiHeader.biWidth * lpbiOutput->bmiHeader.biHeight * 3; |
226 |
} |
} |
227 |
|
|
228 |
|
|
293 |
param.max_quantizer = codec->config.max_pquant; |
param.max_quantizer = codec->config.max_pquant; |
294 |
param.max_key_interval = codec->config.max_key_interval; |
param.max_key_interval = codec->config.max_key_interval; |
295 |
|
|
296 |
|
#ifdef BFRAMES |
297 |
|
param.packed = codec->config.packed; |
298 |
|
param.max_bframes = codec->config.max_bframes; |
299 |
|
param.bquant_ratio = codec->config.bquant_ratio; |
300 |
|
#endif |
301 |
|
|
302 |
switch(xvid_encore(0, XVID_ENC_CREATE, ¶m, NULL)) |
switch(xvid_encore(0, XVID_ENC_CREATE, ¶m, NULL)) |
303 |
{ |
{ |
304 |
case XVID_ERR_FAIL : |
case XVID_ERR_FAIL : |
384 |
|
|
385 |
if (codec->config.interlacing) |
if (codec->config.interlacing) |
386 |
frame.general |= XVID_INTERLACING; |
frame.general |= XVID_INTERLACING; |
387 |
|
// fix 1pass modes/hinted MV by koepi |
388 |
|
if (codec->config.hinted_me && (codec->config.mode == DLG_MODE_CBR || codec->config.mode == DLG_MODE_VBR_QUAL || codec->config.mode == DLG_MODE_VBR_QUANT)) |
389 |
|
{ |
390 |
|
codec->config.hinted_me = 0; |
391 |
|
} |
392 |
|
// end of ugly hack |
393 |
|
|
394 |
if (codec->config.hinted_me && codec->config.mode == DLG_MODE_2PASS_1) |
if (codec->config.hinted_me && codec->config.mode == DLG_MODE_2PASS_1) |
395 |
{ |
{ |
506 |
frame.intra = 0; |
frame.intra = 0; |
507 |
} |
} |
508 |
|
|
509 |
|
OutputDebugString(" "); |
510 |
switch (xvid_encore(codec->ehandle, XVID_ENC_ENCODE, &frame, &stats)) |
switch (xvid_encore(codec->ehandle, XVID_ENC_ENCODE, &frame, &stats)) |
511 |
{ |
{ |
512 |
case XVID_ERR_FAIL : |
case XVID_ERR_FAIL : |