Mercurial > mplayer.hg
comparison libmpcodecs/ve_lavc.c @ 8587:58e788758611
lavc 4647
author | michael |
---|---|
date | Sat, 28 Dec 2002 00:04:20 +0000 |
parents | 27da710563c2 |
children | 961e0c1e6e60 |
comparison
equal
deleted
inserted
replaced
8586:88f2362f1291 | 8587:58e788758611 |
---|---|
105 static int lavc_param_interlaced_dct= 0; | 105 static int lavc_param_interlaced_dct= 0; |
106 static int lavc_param_prediction_method= FF_PRED_LEFT; | 106 static int lavc_param_prediction_method= FF_PRED_LEFT; |
107 static char *lavc_param_format="YV12"; | 107 static char *lavc_param_format="YV12"; |
108 static int lavc_param_debug= 0; | 108 static int lavc_param_debug= 0; |
109 static int lavc_param_psnr= 0; | 109 static int lavc_param_psnr= 0; |
110 static int lavc_param_me_cmp= 0; | |
111 static int lavc_param_me_sub_cmp= 0; | |
112 static int lavc_param_mb_cmp= 0; | |
113 static int lavc_param_dia_size= 0; | |
114 static int lavc_param_qpel= 0; | |
110 | 115 |
111 #include "cfgparser.h" | 116 #include "cfgparser.h" |
112 | 117 |
113 #ifdef USE_LIBAVCODEC | 118 #ifdef USE_LIBAVCODEC |
114 struct config lavcopts_conf[]={ | 119 struct config lavcopts_conf[]={ |
168 {"debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 100000000, NULL}, | 173 {"debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 100000000, NULL}, |
169 #endif | 174 #endif |
170 #if LIBAVCODEC_BUILD >= 4643 | 175 #if LIBAVCODEC_BUILD >= 4643 |
171 {"psnr", &lavc_param_psnr, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR, NULL}, | 176 {"psnr", &lavc_param_psnr, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR, NULL}, |
172 #endif | 177 #endif |
178 {"cmp", &lavc_param_me_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, | |
179 {"subcmp", &lavc_param_me_sub_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, | |
180 {"mbcmp", &lavc_param_mb_cmp, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, | |
181 {"dia", &lavc_param_dia_size, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, | |
182 {"qpel", &lavc_param_qpel, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL, NULL}, | |
173 {NULL, NULL, 0, 0, 0, 0, NULL} | 183 {NULL, NULL, 0, 0, 0, 0, NULL} |
174 }; | 184 }; |
175 #endif | 185 #endif |
176 | 186 |
177 struct vf_priv_s { | 187 struct vf_priv_s { |
314 lavc_venc_context->flags = CODEC_FLAG_HQ; | 324 lavc_venc_context->flags = CODEC_FLAG_HQ; |
315 } | 325 } |
316 else | 326 else |
317 lavc_venc_context->flags = 0; | 327 lavc_venc_context->flags = 0; |
318 | 328 |
319 /* 4mv is currently buggy with B frames */ | 329 #if LIBAVCODEC_BUILD >= 4647 |
320 if (lavc_param_vmax_b_frames > 0 && lavc_param_v4mv) { | 330 lavc_venc_context->me_cmp= lavc_param_me_cmp; |
321 printf("4MV with B-Frames not yet supported -> 4MV disabled\n"); | 331 lavc_venc_context->me_sub_cmp= lavc_param_me_sub_cmp; |
322 lavc_param_v4mv = 0; | 332 lavc_venc_context->mb_cmp= lavc_param_mb_cmp; |
323 } | 333 lavc_venc_context->dia_size= lavc_param_dia_size; |
324 | 334 lavc_venc_context->flags|= lavc_param_qpel; |
335 #endif | |
336 | |
325 lavc_venc_context->flags|= lavc_param_v4mv ? CODEC_FLAG_4MV : 0; | 337 lavc_venc_context->flags|= lavc_param_v4mv ? CODEC_FLAG_4MV : 0; |
326 lavc_venc_context->flags|= lavc_param_data_partitioning; | 338 lavc_venc_context->flags|= lavc_param_data_partitioning; |
327 if(lavc_param_gray) lavc_venc_context->flags|= CODEC_FLAG_GRAY; | 339 if(lavc_param_gray) lavc_venc_context->flags|= CODEC_FLAG_GRAY; |
328 | 340 |
329 if(lavc_param_normalize_aqp) lavc_venc_context->flags|= CODEC_FLAG_NORMALIZE_AQP; | 341 if(lavc_param_normalize_aqp) lavc_venc_context->flags|= CODEC_FLAG_NORMALIZE_AQP; |
547 /* XXX: hack: huffyuv needs to store huffman tables (allthough we dunno the size yet ...) */ | 559 /* XXX: hack: huffyuv needs to store huffman tables (allthough we dunno the size yet ...) */ |
548 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)+1000); | 560 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)+1000); |
549 memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)+1000); | 561 memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)+1000); |
550 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+1000; | 562 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+1000; |
551 } | 563 } |
564 else if (lavc_param_vcodec && !strcasecmp(lavc_param_vcodec, "wmv2")) | |
565 { | |
566 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)+4); | |
567 memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)+4); | |
568 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+4; | |
569 } | |
552 else | 570 else |
553 { | 571 { |
554 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)); | 572 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)); |
555 memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)); | 573 memset(mux_v->bih, 0, sizeof(BITMAPINFOHEADER)); |
556 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER); | 574 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER); |
579 mux_v->bih->biCompression = mmioFOURCC('d', 'i', 'v', '3'); | 597 mux_v->bih->biCompression = mmioFOURCC('d', 'i', 'v', '3'); |
580 else if (!strcasecmp(lavc_param_vcodec, "msmpeg4v2")) | 598 else if (!strcasecmp(lavc_param_vcodec, "msmpeg4v2")) |
581 mux_v->bih->biCompression = mmioFOURCC('M', 'P', '4', '2'); | 599 mux_v->bih->biCompression = mmioFOURCC('M', 'P', '4', '2'); |
582 else if (!strcasecmp(lavc_param_vcodec, "wmv1")) | 600 else if (!strcasecmp(lavc_param_vcodec, "wmv1")) |
583 mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '1'); | 601 mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '1'); |
602 else if (!strcasecmp(lavc_param_vcodec, "wmv2")) | |
603 mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '2'); | |
584 else if (!strcasecmp(lavc_param_vcodec, "huffyuv")) | 604 else if (!strcasecmp(lavc_param_vcodec, "huffyuv")) |
585 mux_v->bih->biCompression = mmioFOURCC('H', 'F', 'Y', 'U'); | 605 mux_v->bih->biCompression = mmioFOURCC('H', 'F', 'Y', 'U'); |
586 else | 606 else |
587 mux_v->bih->biCompression = mmioFOURCC(lavc_param_vcodec[0], | 607 mux_v->bih->biCompression = mmioFOURCC(lavc_param_vcodec[0], |
588 lavc_param_vcodec[1], lavc_param_vcodec[2], lavc_param_vcodec[3]); /* FIXME!!! */ | 608 lavc_param_vcodec[1], lavc_param_vcodec[2], lavc_param_vcodec[3]); /* FIXME!!! */ |