[MPlayer-dev-eng] [PATCH]Add new option -field_dominance

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Jan 27 17:29:41 CET 2007


Hi!

Attached patch adds a new option -field_dominance for all deinterlacers that 
support mpi->fields&TOP_FRAME_FIRST. The field_dominance options for yadif 
and tfields may be deprecated if this patch is accepted.
(Patch suggested by Reimar)

Carl Eugen
-------------- next part --------------
Index: cfg-common.h
===================================================================
--- cfg-common.h	(Revision 22030)
+++ cfg-common.h	(Arbeitskopie)
@@ -240,6 +240,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, 0, 0, 0, NULL},
 
 #ifdef USE_LIBAVCODEC
 	{"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
@@ -349,6 +350,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;
 
Index: libmpcodecs/dec_video.c
===================================================================
--- libmpcodecs/dec_video.c	(Revision 22030)
+++ libmpcodecs/dec_video.c	(Arbeitskopie)
@@ -37,6 +37,8 @@
 extern double video_time_usage;
 extern double vout_time_usage;
 
+int field_dominance=-1;
+
 #include "cpudetect.h"
 
 int divx_quality=0;
@@ -382,6 +384,10 @@
 
 if(!mpi || drop_frame) return NULL; // error / skipped frame
 
+ if (field_dominance >= 0 && 
+     !(field_dominance&1) == !(mpi->fields&MP_IMGFIELD_TOP_FIRST))
+         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];
Index: DOCS/man/en/mplayer.1
===================================================================
--- DOCS/man/en/mplayer.1	(Revision 22030)
+++ DOCS/man/en/mplayer.1	(Arbeitskopie)
@@ -3971,6 +3971,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.
 .
@@ -6268,7 +6282,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 <field_dominance>
+.IPs <field_dominance>\ (DEPRECATED)
 -1: auto (default)
 Only works if the decoder exports the appropriate information and
 no other filters which discard that information come before tfields
@@ -6277,6 +6291,10 @@
 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
 .
@@ -6293,8 +6311,12 @@
 2: Like 0 but skips spatial interlacing check.
 .br
 3: Like 1 but skips spatial interlacing check.
-.IPs <field_dominance>
+.IPs <field_dominance>\ (DEPRECATED)
 Operates like tfields.
+.br
+.I NOTE:
+This option will possibly be removed in a future version. Use \-field_dominance
+instead.
 .RE
 .PD 1
 .


More information about the MPlayer-dev-eng mailing list