--- trunk/vfw/src/codec.c 2002/08/06 23:41:01 362 +++ trunk/vfw/src/codec.c 2002/08/07 01:10:01 364 @@ -56,8 +56,8 @@ int pmvfast_presets[7] = { 0, PMV_QUICKSTOP16, PMV_EARLYSTOP16, PMV_EARLYSTOP16 | PMV_EARLYSTOP8, PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8, - PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8, - PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | + PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8 | + PMV_ADVANCEDDIAMOND16, PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8 | PMV_USESQUARES16 }; @@ -385,7 +385,8 @@ frame.intra = -1; frame.general |= XVID_HALFPEL; -// frame.general |= XVID_ME_EPZS; +// frame.general |= XVID_ME_EPZS; + if (codec->config.motion_search > 4) frame.general |= XVID_INTER4V; @@ -394,11 +395,16 @@ frame.general |= XVID_LUMIMASKING; if (codec->config.interlacing) - frame.general |= XVID_INTERLACING; - -// added by koepi for credits greyscale - check_greyscale_mode(&codec->config, &frame, codec->framenum); -// end of koepi's addition + frame.general |= XVID_INTERLACING; + + + +// added by koepi for credits greyscale + + check_greyscale_mode(&codec->config, &frame, codec->framenum); + +// end of koepi's addition + // 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)) @@ -739,9 +745,12 @@ case DLG_MODE_VBR_QUAL : if (codec_is_in_credits(&codec->config, codec->framenum)) { -// added by koepi for credits greyscale - check_greyscale_mode(&codec->config, frame, codec->framenum); -// end of koepi's addition +// added by koepi for credits greyscale + + check_greyscale_mode(&codec->config, frame, codec->framenum); + +// end of koepi's addition + switch (codec->config.credits_mode) { case CREDITS_MODE_RATE : @@ -759,9 +768,12 @@ } else { -// added by koepi for credits greyscale - check_greyscale_mode(&codec->config, frame, codec->framenum); -// end of koepi's addition +// added by koepi for credits greyscale + + check_greyscale_mode(&codec->config, frame, codec->framenum); + +// end of koepi's addition + frame->quant = codec_get_vbr_quant(&codec->config, codec->config.quality); } return ICERR_OK; @@ -769,9 +781,12 @@ case DLG_MODE_VBR_QUANT : if (codec_is_in_credits(&codec->config, codec->framenum)) { -// added by koepi for credits greyscale - check_greyscale_mode(&codec->config, frame, codec->framenum); -// end of koepi's addition +// added by koepi for credits greyscale + + check_greyscale_mode(&codec->config, frame, codec->framenum); + +// end of koepi's addition + switch (codec->config.credits_mode) { case CREDITS_MODE_RATE : @@ -791,17 +806,23 @@ } else { -// added by koepi for credits greyscale - check_greyscale_mode(&codec->config, frame, codec->framenum); -// end of koepi's addition +// added by koepi for credits greyscale + + check_greyscale_mode(&codec->config, frame, codec->framenum); + +// end of koepi's addition + frame->quant = codec->config.quant; } return ICERR_OK; case DLG_MODE_2PASS_1 : -// added by koepi for credits greyscale - check_greyscale_mode(&codec->config, frame, codec->framenum); -// end of koepi's addition +// added by koepi for credits greyscale + + check_greyscale_mode(&codec->config, frame, codec->framenum); + +// end of koepi's addition + if (codec->config.credits_mode == CREDITS_MODE_QUANT) { if (codec_is_in_credits(&codec->config, codec->framenum)) @@ -892,29 +913,55 @@ return quant; } -// added by koepi for credits greyscale -int check_greyscale_mode(CONFIG* config, XVID_ENC_FRAME* frame, int framenum) -{ - if ((codec_is_in_credits(config, framenum)) && (config->mode!=DLG_MODE_CBR)) - { - if (config->credits_greyscale) - { - if ((frame->general && XVID_GREYSCALE)) // use only if not already in greyscale - frame->general |= XVID_GREYSCALE; - } else { - if (!(frame->general && XVID_GREYSCALE)) // if movie is in greyscale, switch back - frame->general |= XVID_GREYSCALE; - } - } else { - if (config->greyscale) - { - if ((frame->general && XVID_GREYSCALE)) // use only if not already in greyscale - frame->general |= XVID_GREYSCALE; - } else { - if (!(frame->general && XVID_GREYSCALE)) // if credits is in greyscale, switch back - frame->general |= XVID_GREYSCALE; - } - } - return 0; -} -// end of koepi's addition +// added by koepi for credits greyscale + +int check_greyscale_mode(CONFIG* config, XVID_ENC_FRAME* frame, int framenum) + +{ + + if ((codec_is_in_credits(config, framenum)) && (config->mode!=DLG_MODE_CBR)) + + { + + if (config->credits_greyscale) + + { + + if ((frame->general && XVID_GREYSCALE)) // use only if not already in greyscale + + frame->general |= XVID_GREYSCALE; + + } else { + + if (!(frame->general && XVID_GREYSCALE)) // if movie is in greyscale, switch back + + frame->general |= XVID_GREYSCALE; + + } + + } else { + + if (config->greyscale) + + { + + if ((frame->general && XVID_GREYSCALE)) // use only if not already in greyscale + + frame->general |= XVID_GREYSCALE; + + } else { + + if (!(frame->general && XVID_GREYSCALE)) // if credits is in greyscale, switch back + + frame->general |= XVID_GREYSCALE; + + } + + } + + return 0; + +} + +// end of koepi's addition +