diff options
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_tfields.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c index 1261936293..e687fdaff3 100644 --- a/libmpcodecs/vf_tfields.c +++ b/libmpcodecs/vf_tfields.c @@ -44,13 +44,16 @@ static void deint(unsigned char *dest, int ds, unsigned char *src, int ss, int w int x, y; src += ss; dest += ds; + h--; if (field) { + fast_memcpy(dest - ds, src - ss, w); src += ss; dest += ds; - h -= 2; + h--; } - for (y=h/2; y; y--) { - for (x=0; x<w; x++) { + for (y=h/2; y > 0; y--) { + dest[0] = src[0]; + for (x=1; x<w-1; x++) { if (((src[x-ss] < src[x]) && (src[x+ss] < src[x])) || ((src[x-ss] > src[x]) && (src[x+ss] > src[x]))) { //dest[x] = (src[x+ss] + src[x-ss])>>1; @@ -60,9 +63,12 @@ static void deint(unsigned char *dest, int ds, unsigned char *src, int ss, int w } else dest[x] = src[x]; } + dest[w-1] = src[w-1]; dest += ds<<1; src += ss<<1; } + if (h & 1) + fast_memcpy(dest, src, w); } #if HAVE_AMD3DNOW @@ -445,11 +451,13 @@ static int continue_buffered_image(struct vf_instance *vf) return ret; } -#if 0 static int query_format(struct vf_instance* vf, unsigned int fmt) { - /* FIXME - figure out which other formats work */ + /* FIXME - figure out which formats exactly work */ switch (fmt) { + default: + if (vf->priv->mode == 1) + return 0; case IMGFMT_YV12: case IMGFMT_IYUV: case IMGFMT_I420: @@ -457,7 +465,6 @@ static int query_format(struct vf_instance* vf, unsigned int fmt) } return 0; } -#endif static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height, @@ -485,7 +492,7 @@ static int open(vf_instance_t *vf, char* args) struct vf_priv_s *p; vf->config = config; vf->put_image = put_image; - //vf->query_format = query_format; + vf->query_format = query_format; vf->uninit = uninit; vf->default_reqs = VFCAP_ACCEPT_STRIDE; vf->priv = p = calloc(1, sizeof(struct vf_priv_s)); |