--- codec.c 2003/01/15 14:41:30 1.23.2.14 +++ codec.c 2003/04/04 10:34:57 1.27 @@ -386,6 +386,10 @@ frame.general |= XVID_HALFPEL; // frame.general |= XVID_ME_EPZS; + frame.general |= XVID_HQACPRED; + + frame.bframe_threshold = 255; + if (codec->config.motion_search > 4) frame.general |= XVID_INTER4V; @@ -404,11 +408,13 @@ frame.general |= XVID_GMC; if (codec->config.chromame) - frame.motion |= PMV_CHROMA16; + frame.motion |= PMV_CHROMA16 + PMV_CHROMA8; if (codec->config.reduced_resolution) frame.general |= XVID_REDUCED; + if (codec->config.chroma_opt) + frame.general |= XVID_CHROMAOPT; // added by koepi for credits greyscale check_greyscale_mode(&codec->config, &frame, codec->framenum); @@ -457,6 +463,41 @@ frame.motion |= pmvfast_presets[codec->config.motion_search]; + switch (codec->config.vhq_mode) + { + case VHQ_MODE_DECISION : + frame.general |= XVID_MODEDECISION_BITS; + break; + + case VHQ_LIMITED_SEARCH : + frame.general |= XVID_MODEDECISION_BITS; + frame.motion |= HALFPELREFINE16_BITS; + frame.motion |= QUARTERPELREFINE16_BITS; + break; + + case VHQ_MEDIUM_SEARCH : + frame.general |= XVID_MODEDECISION_BITS; + frame.motion |= HALFPELREFINE16_BITS; + frame.motion |= HALFPELREFINE8_BITS; + frame.motion |= QUARTERPELREFINE16_BITS; + frame.motion |= QUARTERPELREFINE8_BITS; + frame.motion |= CHECKPREDICTION_BITS; + break; + + case VHQ_WIDE_SEARCH : + frame.general |= XVID_MODEDECISION_BITS; + frame.motion |= HALFPELREFINE16_BITS; + frame.motion |= HALFPELREFINE8_BITS; + frame.motion |= QUARTERPELREFINE16_BITS; + frame.motion |= QUARTERPELREFINE8_BITS; + frame.motion |= CHECKPREDICTION_BITS; + frame.motion |= EXTSEARCH_BITS; + break; + + default : + break; + } + frame.image = icc->lpInput; frame.stride = (((icc->lpbiInput->biWidth * icc->lpbiInput->biBitCount) + 31) & ~31) >> 3; @@ -566,6 +607,7 @@ { *icc->lpdwFlags = 0; } + if (frame.length == 0) { frame.length = 1; *((unsigned char*)frame.bitstream) = 0x7f; } outhdr->biSizeImage = frame.length; @@ -661,15 +703,18 @@ } /* --- yv12 --- */ - result = decompress_query(codec, lpbiInput, lpbiOutput); + result = decompress_query(codec, lpbiInput, NULL); if (result != ICERR_OK) { return result; } - memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER)); outhdr->biSize = sizeof(BITMAPINFOHEADER); - outhdr->biCompression = FOURCC_YUY2; + outhdr->biWidth = inhdr->biWidth; + outhdr->biHeight = inhdr->biHeight; + outhdr->biPlanes = 1; + outhdr->biBitCount = 24; + outhdr->biCompression = BI_RGB; /* sonic foundry vegas video v3 only supports BI_RGB */ outhdr->biSizeImage = outhdr->biWidth * outhdr->biHeight * outhdr->biBitCount; outhdr->biXPelsPerMeter = 0; outhdr->biYPelsPerMeter = 0;