--- trunk/vfw/src/codec.c 2002/04/25 07:16:00 137 +++ trunk/vfw/src/codec.c 2002/07/12 12:26:55 295 @@ -23,6 +23,8 @@ * * History: * + * 12.07.2002 num_threads + * 23.06.2002 XVID_CPU_CHKONLY; loading speed up * 25.04.2002 ICDECOMPRESS_PREROLL * 17.04.2002 re-enabled lumi masking for 1st pass * 15.04.2002 updated cbr support @@ -218,7 +220,11 @@ LRESULT compress_get_size(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiOutput) { - return lpbiOutput->bmiHeader.biWidth * lpbiOutput->bmiHeader.biHeight * 3; + return +#ifdef BFRAMES + 2 * +#endif + lpbiOutput->bmiHeader.biWidth * lpbiOutput->bmiHeader.biHeight * 3; } @@ -289,6 +295,19 @@ param.max_quantizer = codec->config.max_pquant; param.max_key_interval = codec->config.max_key_interval; +#ifdef _SMP + param.num_threads = codec->config.num_threads; +#endif + +#ifdef BFRAMES + param.global = 0; + if (codec->config.packed) param.global |= XVID_GLOBAL_PACKED; + if (codec->config.dx50bvop) param.global |= XVID_GLOBAL_DX50BVOP; + if (codec->config.debug) param.global |= XVID_GLOBAL_DEBUG; + param.max_bframes = codec->config.max_bframes; + param.bquant_ratio = codec->config.bquant_ratio; +#endif + switch(xvid_encore(0, XVID_ENC_CREATE, ¶m, NULL)) { case XVID_ERR_FAIL : @@ -374,6 +393,12 @@ if (codec->config.interlacing) frame.general |= XVID_INTERLACING; +// fix 1pass modes/hinted MV by koepi + 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)) + { + codec->config.hinted_me = 0; + } +// end of ugly hack if (codec->config.hinted_me && codec->config.mode == DLG_MODE_2PASS_1) { @@ -490,6 +515,11 @@ frame.intra = 0; } +#ifdef BFRAMES + frame.bquant = 0; +#endif + + OutputDebugString(" "); switch (xvid_encore(codec->ehandle, XVID_ENC_ENCODE, &frame, &stats)) { case XVID_ERR_FAIL : @@ -527,7 +557,7 @@ if (codec->twopass.hints == INVALID_HANDLE_VALUE) { codec->twopass.hints = CreateFile(codec->config.hintfile, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); - if (codec->twopass.hints == INVALID_HANDLE_VALUE) + if (codec->twopass.hints == INVALID_HANDLE_VALUE) { DEBUGERR("couldn't create hints file"); return ICERR_ERROR;