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
This commit is contained in:
reimar 2007-02-02 18:32:07 +00:00
parent 3ddab299bf
commit 240b743ebd
3 changed files with 33 additions and 2 deletions

View File

@ -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 <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
@ -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 <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
.

View File

@ -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;

View File

@ -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];