# HG changeset patch # User michael # Date 1041033860 0 # Node ID 58e78875861150842b398068bd850a1618816d01 # Parent 88f2362f12916a33570c2d2e086a55a8e4a94547 lavc 4647 diff -r 88f2362f1291 -r 58e788758611 libmpcodecs/ve_lavc.c --- a/libmpcodecs/ve_lavc.c Sat Dec 28 00:01:28 2002 +0000 +++ b/libmpcodecs/ve_lavc.c Sat Dec 28 00:04:20 2002 +0000 @@ -107,6 +107,11 @@ static char *lavc_param_format="YV12"; static int lavc_param_debug= 0; static int lavc_param_psnr= 0; +static int lavc_param_me_cmp= 0; +static int lavc_param_me_sub_cmp= 0; +static int lavc_param_mb_cmp= 0; +static int lavc_param_dia_size= 0; +static int lavc_param_qpel= 0; #include "cfgparser.h" @@ -170,6 +175,11 @@ #if LIBAVCODEC_BUILD >= 4643 {"psnr", &lavc_param_psnr, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR, NULL}, #endif + {"cmp", &lavc_param_me_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, + {"subcmp", &lavc_param_me_sub_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, + {"mbcmp", &lavc_param_mb_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, + {"dia", &lavc_param_dia_size, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, + {"qpel", &lavc_param_qpel, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif @@ -316,12 +326,14 @@ else lavc_venc_context->flags = 0; - /* 4mv is currently buggy with B frames */ - if (lavc_param_vmax_b_frames > 0 && lavc_param_v4mv) { - printf("4MV with B-Frames not yet supported -> 4MV disabled\n"); - lavc_param_v4mv = 0; - } - +#if LIBAVCODEC_BUILD >= 4647 + lavc_venc_context->me_cmp= lavc_param_me_cmp; + lavc_venc_context->me_sub_cmp= lavc_param_me_sub_cmp; + lavc_venc_context->mb_cmp= lavc_param_mb_cmp; + lavc_venc_context->dia_size= lavc_param_dia_size; + lavc_venc_context->flags|= lavc_param_qpel; +#endif + lavc_venc_context->flags|= lavc_param_v4mv ? CODEC_FLAG_4MV : 0; lavc_venc_context->flags|= lavc_param_data_partitioning; if(lavc_param_gray) lavc_venc_context->flags|= CODEC_FLAG_GRAY; @@ -549,6 +561,12 @@ memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)+1000); mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+1000; } + else if (lavc_param_vcodec && !strcasecmp(lavc_param_vcodec, "wmv2")) + { + mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)+4); + memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)+4); + mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+4; + } else { mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)); @@ -581,6 +599,8 @@ mux_v->bih->biCompression = mmioFOURCC('M', 'P', '4', '2'); else if (!strcasecmp(lavc_param_vcodec, "wmv1")) mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '1'); + else if (!strcasecmp(lavc_param_vcodec, "wmv2")) + mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '2'); else if (!strcasecmp(lavc_param_vcodec, "huffyuv")) mux_v->bih->biCompression = mmioFOURCC('H', 'F', 'Y', 'U'); else