--- codec.c 2003/01/23 14:22:05 1.23.2.15 +++ codec.c 2003/02/15 06:30:02 1.23.2.18 @@ -386,6 +386,8 @@ frame.general |= XVID_HALFPEL; // frame.general |= XVID_ME_EPZS; + frame.general |= XVID_HQACPRED; + if (codec->config.motion_search > 4) frame.general |= XVID_INTER4V; @@ -409,6 +411,8 @@ 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 +461,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; @@ -661,15 +700,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;