--- branches/release-1_3-branch/xvidcore/vfw/src/codec.c 2010/12/30 22:08:02 1933 +++ branches/release-1_3-branch/xvidcore/vfw/src/codec.c 2016/09/27 15:39:48 2139 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: codec.c,v 1.30.2.1 2010-12-30 22:07:43 Isibaar Exp $ + * $Id$ * *************************************************************************/ @@ -560,10 +560,11 @@ create.num_plugins++; } - plugins[create.num_plugins].func = vfw_debug; - plugins[create.num_plugins].param = NULL; - create.num_plugins++; - + if (config->debug > 0) { + plugins[create.num_plugins].func = vfw_debug; + plugins[create.num_plugins].param = NULL; + create.num_plugins++; + } create.profile = profiles[codec->config.profile].id; create.width = lpbiInput->bmiHeader.biWidth; @@ -608,7 +609,12 @@ if ((profiles[codec->config.profile].flags & PROFILE_EXTRA)) create.global |= XVID_GLOBAL_DIVX5_USERDATA; - create.frame_drop_ratio = quality_preset->frame_drop_ratio; + if ((profiles[codec->config.profile].flags & PROFILE_EXTRA) || + (profiles[codec->config.profile].flags & PROFILE_XVID)) { + create.frame_drop_ratio = 0; + } else { + create.frame_drop_ratio = quality_preset->frame_drop_ratio; + } switch(codec->xvid_encore_func(0, XVID_ENC_CREATE, &create, NULL)) { @@ -919,13 +925,16 @@ { BITMAPINFOHEADER * inhdr = &lpbiInput->bmiHeader; BITMAPINFOHEADER * outhdr = &lpbiOutput->bmiHeader; + int in_csp = XVID_CSP_NULL, out_csp = XVID_CSP_NULL; if (lpbiInput == NULL) { return ICERR_ERROR; } - if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX && inhdr->biCompression != FOURCC_DX50 && get_colorspace(inhdr) == XVID_CSP_NULL) + if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX && inhdr->biCompression != FOURCC_DX50 && inhdr->biCompression != FOURCC_MP4V && + inhdr->biCompression != FOURCC_xvid && inhdr->biCompression != FOURCC_divx && inhdr->biCompression != FOURCC_dx50 && inhdr->biCompression != FOURCC_mp4v && + (in_csp = get_colorspace(inhdr)) != XVID_CSP_YV12) { return ICERR_BADFORMAT; } @@ -935,9 +944,12 @@ return ICERR_OK; } + out_csp = get_colorspace(outhdr); + if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight || - get_colorspace(outhdr) == XVID_CSP_NULL) + out_csp == XVID_CSP_NULL || + (in_csp == XVID_CSP_YV12 && in_csp != out_csp)) { return ICERR_BADFORMAT; } @@ -1080,7 +1092,12 @@ /* --- yv12 --- */ if (icd->lpbiInput->biCompression != FOURCC_XVID && icd->lpbiInput->biCompression != FOURCC_DIVX && - icd->lpbiInput->biCompression != FOURCC_DX50) + icd->lpbiInput->biCompression != FOURCC_DX50 && + icd->lpbiInput->biCompression != FOURCC_MP4V && + icd->lpbiInput->biCompression != FOURCC_xvid && + icd->lpbiInput->biCompression != FOURCC_divx && + icd->lpbiInput->biCompression != FOURCC_dx50 && + icd->lpbiInput->biCompression != FOURCC_mp4v) { xvid_gbl_convert_t convert;