# HG changeset patch # User reimar # Date 1170441127 0 # Node ID 8bf15e2ca61e37951abc59e3a63f3b2820a8621a # Parent d776650e0821029115d232fef319460432f4049c Add global field dominance flag instead of duplicating this "everywhere" Patch by Carl Eugen Hoyos (cehoyos (at) ag or at) diff -r d776650e0821 -r 8bf15e2ca61e DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Thu Feb 01 22:00:30 2007 +0000 +++ b/DOCS/man/en/mplayer.1 Fri Feb 02 18:32:07 2007 +0000 @@ -3983,6 +3983,20 @@ Disable automatic movie aspect ratio compensation. . .TP +.B "\-field-dominance <-1\-1> +Set first field for interlaced content. Useful for deinterlacers that double the framerate: \-vf tfields=1, \-vf yadif=1 and \-vo xvmc:bobdeint. +.PD 0 +.RSs +.IPs -1 +auto (default) If the decoder doesn't export the appropriate information, it falls back to 0 (top field first). +.IPs 0 +top field first +.IPs 1 +bottom field first +.RE +.PD 1 +. +.TP .B "\-flip \ " Flip image upside-down. . @@ -6280,7 +6294,7 @@ 2: Translate fields by 1/4 pixel with linear interpolation (no jump). .br 4: Translate fields by 1/4 pixel with 4tap filter (higher quality) (default). -.IPs +.IPs \ (DEPRECATED) -1: auto (default) Only works if the decoder exports the appropriate information and no other filters which discard that information come before tfields @@ -6289,6 +6303,9 @@ 0: top field first .br 1: bottom field first +.br +.I NOTE: +This option will possibly be removed in a future version. Use \-field-dominance instead. .RE .PD 1 . @@ -6305,8 +6322,11 @@ 2: Like 0 but skips spatial interlacing check. .br 3: Like 1 but skips spatial interlacing check. -.IPs +.IPs \ (DEPRECATED) Operates like tfields. +.br +.I NOTE: +This option will possibly be removed in a future version. Use \-field-dominance instead. .RE .PD 1 . diff -r d776650e0821 -r 8bf15e2ca61e cfg-common.h --- a/cfg-common.h Thu Feb 01 22:00:30 2007 +0000 +++ b/cfg-common.h Fri Feb 02 18:32:07 2007 +0000 @@ -241,6 +241,7 @@ // draw by slices or whole frame (useful with libmpeg2/libavcodec) {"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"noslices", &vd_use_slices, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, #ifdef USE_LIBAVCODEC {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, @@ -350,6 +351,9 @@ /* defined in codec-cfg.c */ extern char * codecs_file; +/* defined in dec_video.c */ +extern int field_dominance; + /* from dec_audio, currently used for ac3surround decoder only */ extern int audio_output_channels; diff -r d776650e0821 -r 8bf15e2ca61e libmpcodecs/dec_video.c --- a/libmpcodecs/dec_video.c Thu Feb 01 22:00:30 2007 +0000 +++ b/libmpcodecs/dec_video.c Fri Feb 02 18:32:07 2007 +0000 @@ -39,6 +39,8 @@ #include "cpudetect.h" +int field_dominance=-1; + int divx_quality=0; vd_functions_t* mpvdec=NULL; @@ -382,6 +384,11 @@ if(!mpi || drop_frame) return NULL; // error / skipped frame + if (field_dominance == 0) + mpi->fields |= MP_IMGFIELD_TOP_FIRST; + else if (field_dominance == 1) + mpi->fields &= ~MP_IMGFIELD_TOP_FIRST; + if (correct_pts) { sh_video->num_buffered_pts--; sh_video->pts = sh_video->buffered_pts[sh_video->num_buffered_pts];