--- branches/dev-api-3/vfw/src/codec.c 2002/11/21 12:51:28 670 +++ branches/dev-api-3/vfw/src/codec.c 2003/01/15 14:41:30 789 @@ -302,6 +302,7 @@ 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; + if (codec->config.reduced_resolution) param.global |= XVID_GLOBAL_REDUCED; param.max_bframes = codec->config.max_bframes; param.bquant_ratio = codec->config.bquant_ratio; param.bquant_offset = codec->config.bquant_offset; @@ -385,7 +386,6 @@ frame.general |= XVID_HALFPEL; // frame.general |= XVID_ME_EPZS; - if (codec->config.motion_search > 4) frame.general |= XVID_INTER4V; @@ -398,14 +398,16 @@ if (codec->config.qpel) { frame.general |= XVID_QUARTERPEL; frame.motion |= PMV_QUARTERPELREFINE16 | PMV_QUARTERPELREFINE8; - } if (codec->config.gmc) frame.general |= XVID_GMC; if (codec->config.chromame) - frame.general |= XVID_ME_COLOUR; + frame.motion |= PMV_CHROMA16; + + if (codec->config.reduced_resolution) + frame.general |= XVID_REDUCED; // added by koepi for credits greyscale @@ -456,12 +458,14 @@ frame.motion |= pmvfast_presets[codec->config.motion_search]; frame.image = icc->lpInput; - // dev-api-3 frame.stride = (((icc->lpbiInput->biWidth * icc->lpbiInput->biBitCount) + 31) & ~31) >> 3; if ((frame.colorspace = get_colorspace(inhdr)) == XVID_CSP_NULL) return ICERR_BADFORMAT; + if (frame.colorspace == XVID_CSP_I420 || frame.colorspace == XVID_CSP_YV12) + frame.stride = (frame.stride*2)/3; + frame.bitstream = icc->lpOutput; frame.length = icc->lpbiOutput->biSizeImage; @@ -726,10 +730,13 @@ frame.bitstream = icd->lpInput; frame.length = icd->lpbiInput->biSizeImage; + frame.general = XVID_DEC_LOWDELAY; /* force low_delay_default mode */ + if (codec->config.deblock_y) + frame.general |= XVID_DEC_DEBLOCKY; + if (codec->config.deblock_uv) + frame.general |= XVID_DEC_DEBLOCKUV; frame.image = icd->lpOutput; -// frame.stride = icd->lpbiOutput->biWidth; - // dev-api-3: frame.stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3; /* --- yv12 --- */ @@ -743,9 +750,15 @@ convert.input.colorspace = get_colorspace(icd->lpbiInput); convert.input.y = icd->lpInput; convert.input.y_stride = (((icd->lpbiInput->biWidth *icd->lpbiInput->biBitCount) + 31) & ~31) >> 3; + if (convert.input.colorspace == XVID_CSP_I420 || convert.input.colorspace == XVID_CSP_YV12) + convert.input.y_stride = (convert.input.y_stride*2)/3; + convert.output.colorspace = get_colorspace(icd->lpbiOutput); convert.output.y = icd->lpOutput; convert.output.y_stride = (((icd->lpbiOutput->biWidth *icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3; + if (convert.output.colorspace == XVID_CSP_I420 || convert.output.colorspace == XVID_CSP_YV12) + convert.output.y_stride = (convert.output.y_stride*2)/3; + convert.width = icd->lpbiInput->biWidth; convert.height = icd->lpbiInput->biHeight; convert.interlacing = 0; @@ -772,6 +785,9 @@ frame.colorspace = XVID_CSP_NULL; } + if (frame.colorspace == XVID_CSP_I420 || frame.colorspace == XVID_CSP_YV12) + frame.stride = (frame.stride*2)/3; + switch (xvid_decore(codec->dhandle, XVID_DEC_DECODE, &frame, NULL)) { case XVID_ERR_FAIL :