From 240b743ebdfde9bfb9bbe311de9ab6afe9378cff Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 2 Feb 2007 18:32:07 +0000 Subject: Add global field dominance flag instead of duplicating this "everywhere" Patch by Carl Eugen Hoyos (cehoyos (at) ag or at) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22104 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 24 ++++++++++++++++++++++-- cfg-common.h | 4 ++++ libmpcodecs/dec_video.c | 7 +++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 19ebcaa40d..cf81ea8afb 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3983,6 +3983,20 @@ incorrect or missing in the file being played. 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 @@ desired (double) framerate! 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 @@ in the filter chain, otherwise it falls back to 0 (top field first). 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 @@ Yet another deinterlacing filter 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 --git a/cfg-common.h b/cfg-common.h index 21324490f8..caf7248fd2 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -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 @@ extern int divx_quality; /* 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 --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 16f919e692..230ab0f69b 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -39,6 +39,8 @@ extern double vout_time_usage; #include "cpudetect.h" +int field_dominance=-1; + int divx_quality=0; vd_functions_t* mpvdec=NULL; @@ -382,6 +384,11 @@ video_time_usage+=tt; 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]; -- cgit v1.2.3