summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_softpulldown.c
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-18 14:49:06 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-18 14:49:06 +0000
commit48ecb3e717979195d45c691366da422fb7b06f90 (patch)
treee1b55aeaf9ccc75aee6952c6c40c73bf9034b841 /libmpcodecs/vf_softpulldown.c
parentdb1804fcac42a4cbec012c64efabfbc1b2e9fc7f (diff)
downloadmpv-48ecb3e717979195d45c691366da422fb7b06f90.tar.bz2
mpv-48ecb3e717979195d45c691366da422fb7b06f90.tar.xz
clean up field flags:
1) cosmetic change, no reason these need to be mpeg2-specific 2) add a flag to tell when fields are ordered, so we don't have to assume bff (which would usually be wrong) when field flags are not available. 3) add other flags for future use :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10664 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_softpulldown.c')
-rw-r--r--libmpcodecs/vf_softpulldown.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libmpcodecs/vf_softpulldown.c b/libmpcodecs/vf_softpulldown.c
index 909a22bc50..67811a1362 100644
--- a/libmpcodecs/vf_softpulldown.c
+++ b/libmpcodecs/vf_softpulldown.c
@@ -37,7 +37,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
{
mp_image_t *dmpi;
int ret = 0;
- int flags = mpi->mpeg2_flags;
+ int flags = mpi->fields;
int state = vf->priv->state;
dmpi = vf_get_image(vf->next, mpi->imgfmt,
@@ -47,19 +47,21 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
vf->priv->in++;
if ((state == 0 &&
- !(flags & MP_IMGMPEG2FLAG_TOP_FIELD_FIRST)) ||
+ !(flags & MP_IMGFIELD_TOP_FIRST)) ||
(state == 1 &&
- flags & MP_IMGMPEG2FLAG_TOP_FIELD_FIRST))
+ flags & MP_IMGFIELD_TOP_FIRST)) {
mp_msg(MSGT_VFILTER, MSGL_WARN,
- "softpulldown: Unexpected mpeg2 flags: state=%d top_field_first=%d repeat_first_field=%d\n",
+ "softpulldown: Unexpected field flags: state=%d top_field_first=%d repeat_first_field=%d\n",
state,
- (flags & MP_IMGMPEG2FLAG_TOP_FIELD_FIRST) == 1,
- (flags & MP_IMGMPEG2FLAG_REPEAT_FIRST_FIELD) == 1);
+ (flags & MP_IMGFIELD_TOP_FIRST) != 0,
+ (flags & MP_IMGFIELD_REPEAT_FIRST) != 0);
+ state ^= 1;
+ }
if (state == 0) {
ret = vf_next_put_image(vf, mpi);
vf->priv->out++;
- if (flags & MP_IMGMPEG2FLAG_REPEAT_FIRST_FIELD) {
+ if (flags & MP_IMGFIELD_REPEAT_FIRST) {
my_memcpy_pic(dmpi->planes[0],
mpi->planes[0], mpi->w, mpi->h/2,
dmpi->stride[0]*2, mpi->stride[0]*2);
@@ -95,7 +97,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
}
ret = vf_next_put_image(vf, dmpi);
vf->priv->out++;
- if (flags & MP_IMGMPEG2FLAG_REPEAT_FIRST_FIELD) {
+ if (flags & MP_IMGFIELD_REPEAT_FIRST) {
ret |= vf_next_put_image(vf, mpi);
vf->priv->out++;
state=0;