--- trunk/vfw/src/codec.c 2002/08/04 23:27:40 360 +++ trunk/vfw/src/codec.c 2002/08/05 18:26:31 361 @@ -58,7 +58,8 @@ PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8, PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8, PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | - PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8 + PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8 +// | PMV_USESQUARES16 }; /* return xvid compatbile colorspace, @@ -385,6 +386,7 @@ frame.intra = -1; frame.general |= XVID_HALFPEL; +// frame.general |= XVID_ME_EPZS; if (codec->config.motion_search > 4) frame.general |= XVID_INTER4V; @@ -395,10 +397,8 @@ if (codec->config.interlacing) frame.general |= XVID_INTERLACING; -// added by koepi for gruel's greyscale_mode - if (codec->config.greyscale) - frame.general |= XVID_GREYSCALE; - +// 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 @@ -740,6 +740,9 @@ 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 switch (codec->config.credits_mode) { case CREDITS_MODE_RATE : @@ -757,6 +760,9 @@ } else { +// 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; @@ -764,6 +770,9 @@ 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 switch (codec->config.credits_mode) { case CREDITS_MODE_RATE : @@ -783,11 +792,17 @@ } else { +// 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 if (codec->config.credits_mode == CREDITS_MODE_QUANT) { if (codec_is_in_credits(&codec->config, codec->framenum)) @@ -878,3 +893,29 @@ 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