--- branches/dev-api-4/xvidcore/vfw/src/codec.c 2003/06/13 11:52:14 1069 +++ branches/dev-api-4/xvidcore/vfw/src/codec.c 2003/10/28 23:42:09 1193 @@ -208,7 +208,7 @@ if (lpbiOutput == NULL) { - return sizeof(BITMAPV4HEADER); + return sizeof(BITMAPINFOHEADER); } memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER)); @@ -531,7 +531,7 @@ } } - if ((profiles[codec->config.profile].flags & PROFILE_REDUCED) && + if ((profiles[codec->config.profile].flags & PROFILE_REDUCED) && codec->config.reduced_resolution) { frame.vol_flags |= XVID_VOL_REDUCED_ENABLE; frame.vop_flags |= XVID_VOP_REDUCED; /* XXX: need auto decion mode */ @@ -542,8 +542,10 @@ frame.motion |= XVID_ME_QUARTERPELREFINE16 | XVID_ME_QUARTERPELREFINE8; } - if ((profiles[codec->config.profile].flags & PROFILE_GMC) && codec->config.gmc) + if ((profiles[codec->config.profile].flags & PROFILE_GMC) && codec->config.gmc) { frame.vol_flags |= XVID_VOL_GMC; + frame.motion |= XVID_ME_GME_REFINE; + } if ((profiles[codec->config.profile].flags & PROFILE_INTERLACE) && codec->config.interlacing) frame.vol_flags |= XVID_VOL_INTERLACING; @@ -564,39 +566,46 @@ frame.vop_flags |= XVID_VOP_INTER4V; if (codec->config.chromame) - frame.vop_flags |= XVID_ME_CHROMA16 + XVID_ME_CHROMA8; + frame.motion |= XVID_ME_CHROMA_PVOP + XVID_ME_CHROMA_BVOP; + + if (codec->config.cartoon_mode) { + frame.vop_flags |= XVID_VOP_CARTOON; +#if 0 /* Seems to cause crashes with P4 cpus */ + frame.motion |= XVID_ME_DETECT_STATIC_MOTION; +#endif + } frame.motion |= pmvfast_presets[codec->config.motion_search]; switch (codec->config.vhq_mode) { case VHQ_MODE_DECISION : - frame.vop_flags |= XVID_VOP_MODEDECISION_BITS; + frame.vop_flags |= XVID_VOP_MODEDECISION_RD; break; case VHQ_LIMITED_SEARCH : - frame.vop_flags |= XVID_VOP_MODEDECISION_BITS; - frame.motion |= XVID_ME_HALFPELREFINE16_BITS; - frame.motion |= XVID_ME_QUARTERPELREFINE16_BITS; + frame.vop_flags |= XVID_VOP_MODEDECISION_RD; + frame.motion |= XVID_ME_HALFPELREFINE16_RD; + frame.motion |= XVID_ME_QUARTERPELREFINE16_RD; break; case VHQ_MEDIUM_SEARCH : - frame.vop_flags |= XVID_VOP_MODEDECISION_BITS; - frame.motion |= XVID_ME_HALFPELREFINE16_BITS; - frame.motion |= XVID_ME_HALFPELREFINE8_BITS; - frame.motion |= XVID_ME_QUARTERPELREFINE16_BITS; - frame.motion |= XVID_ME_QUARTERPELREFINE8_BITS; - frame.motion |= XVID_ME_CHECKPREDICTION_BITS; + frame.vop_flags |= XVID_VOP_MODEDECISION_RD; + frame.motion |= XVID_ME_HALFPELREFINE16_RD; + frame.motion |= XVID_ME_HALFPELREFINE8_RD; + frame.motion |= XVID_ME_QUARTERPELREFINE16_RD; + frame.motion |= XVID_ME_QUARTERPELREFINE8_RD; + frame.motion |= XVID_ME_CHECKPREDICTION_RD; break; case VHQ_WIDE_SEARCH : - frame.vop_flags |= XVID_VOP_MODEDECISION_BITS; - frame.motion |= XVID_ME_HALFPELREFINE16_BITS; - frame.motion |= XVID_ME_HALFPELREFINE8_BITS; - frame.motion |= XVID_ME_QUARTERPELREFINE16_BITS; - frame.motion |= XVID_ME_QUARTERPELREFINE8_BITS; - frame.motion |= XVID_ME_CHECKPREDICTION_BITS; - frame.motion |= XVID_ME_EXTSEARCH_BITS; + frame.vop_flags |= XVID_VOP_MODEDECISION_RD; + frame.motion |= XVID_ME_HALFPELREFINE16_RD; + frame.motion |= XVID_ME_HALFPELREFINE8_RD; + frame.motion |= XVID_ME_QUARTERPELREFINE16_RD; + frame.motion |= XVID_ME_QUARTERPELREFINE8_RD; + frame.motion |= XVID_ME_CHECKPREDICTION_RD; + frame.motion |= XVID_ME_EXTSEARCH_RD; break; default :