From b473477fc53ba69e9117a691b00d0e248ebc9ac7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 27 Jan 2015 19:13:51 +0100 Subject: vf_ilpack: remove this filter This was apparently useful for correct interlaced scaling (although I don't know anyone who used this). It was rarely used (if at all), had an inconvenient output format (packed YUV), and now has a better solution in libavfilter (using the libavfilter "scale" filter via vf_lavfi). There is no reason to keep this filter any longer. --- DOCS/man/vf.rst | 13 ---- old-makefile | 1 - video/filter/vf.c | 2 - video/filter/vf_ilpack.c | 181 ----------------------------------------------- wscript_build.py | 1 - 5 files changed, 198 deletions(-) delete mode 100644 video/filter/vf_ilpack.c diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst index f4570ed183..02fd41d9b7 100644 --- a/DOCS/man/vf.rst +++ b/DOCS/man/vf.rst @@ -345,19 +345,6 @@ Available filters are: and just plain white. A value of 0.0 turns the gamma correction all the way down while 1.0 leaves it at its full strength (default: 1.0). -``ilpack[=mode]`` - When interlaced video is stored in YUV 4:2:0 formats, chroma interlacing - does not line up properly due to vertical downsampling of the chroma - channels. This filter packs the planar 4:2:0 data into YUY2 (4:2:2) format - with the chroma lines in their proper locations, so that in any given - scanline, the luma and chroma data both come from the same field. - - ```` - Select the sampling mode. - - :0: nearest-neighbor sampling, fast but incorrect - :1: linear interpolation (default) - ``unsharp[=lx:ly:la:cx:cy:ca]`` unsharp mask / Gaussian blur diff --git a/old-makefile b/old-makefile index bcd2fd07b5..41a30f7df7 100644 --- a/old-makefile +++ b/old-makefile @@ -258,7 +258,6 @@ SOURCES = audio/audio.c \ video/filter/vf_format.c \ video/filter/vf_gradfun.c \ video/filter/vf_hqdn3d.c \ - video/filter/vf_ilpack.c \ video/filter/vf_mirror.c \ video/filter/vf_noformat.c \ video/filter/vf_noise.c \ diff --git a/video/filter/vf.c b/video/filter/vf.c index 890c297cc0..d60379ca6b 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -54,7 +54,6 @@ extern const vf_info_t vf_info_eq; extern const vf_info_t vf_info_gradfun; extern const vf_info_t vf_info_unsharp; extern const vf_info_t vf_info_hqdn3d; -extern const vf_info_t vf_info_ilpack; extern const vf_info_t vf_info_dsize; extern const vf_info_t vf_info_pullup; extern const vf_info_t vf_info_delogo; @@ -92,7 +91,6 @@ static const vf_info_t *const filter_list[] = { &vf_info_gradfun, &vf_info_unsharp, &vf_info_hqdn3d, - &vf_info_ilpack, &vf_info_dsize, &vf_info_pullup, &vf_info_delogo, diff --git a/video/filter/vf_ilpack.c b/video/filter/vf_ilpack.c deleted file mode 100644 index 157f02eb7c..0000000000 --- a/video/filter/vf_ilpack.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include -#include - -#include "config.h" -#include "common/msg.h" -#include "options/m_option.h" - -#include "video/img_format.h" -#include "video/mp_image.h" -#include "vf.h" - -typedef void (pack_func_t)(unsigned char *dst, unsigned char *y, - unsigned char *u, unsigned char *v, int w, int us, int vs); - -struct vf_priv_s { - int mode; - pack_func_t *pack[2]; -}; - -static void pack_nn(unsigned char *dst, unsigned char *y, - unsigned char *u, unsigned char *v, int w, - int av_unused us, int av_unused vs) -{ - int j; - for (j = w/2; j; j--) { - *dst++ = *y++; - *dst++ = *u++; - *dst++ = *y++; - *dst++ = *v++; - } -} - -static void pack_li_0(unsigned char *dst, unsigned char *y, - unsigned char *u, unsigned char *v, int w, int us, int vs) -{ - int j; - for (j = w/2; j; j--) { - *dst++ = *y++; - *dst++ = (u[us+us] + 7*u[0])>>3; - *dst++ = *y++; - *dst++ = (v[vs+vs] + 7*v[0])>>3; - u++; v++; - } -} - -static void pack_li_1(unsigned char *dst, unsigned char *y, - unsigned char *u, unsigned char *v, int w, int us, int vs) -{ - int j; - for (j = w/2; j; j--) { - *dst++ = *y++; - *dst++ = (3*u[us+us] + 5*u[0])>>3; - *dst++ = *y++; - *dst++ = (3*v[vs+vs] + 5*v[0])>>3; - u++; v++; - } -} - -static void ilpack(unsigned char *dst, unsigned char *src[3], - int dststride, int srcstride[3], int w, int h, pack_func_t *pack[2]) -{ - int i; - unsigned char *y, *u, *v; - int ys = srcstride[0], us = srcstride[1], vs = srcstride[2]; - int a, b; - - y = src[0]; - u = src[1]; - v = src[2]; - - pack_nn(dst, y, u, v, w, 0, 0); - y += ys; dst += dststride; - pack_nn(dst, y, u+us, v+vs, w, 0, 0); - y += ys; dst += dststride; - for (i=2; i>1); - pack[b](dst, y, u, v, w, us*a, vs*a); - y += ys; - if ((i&3) == 1) { - u -= us; - v -= vs; - } else { - u += us; - v += vs; - } - dst += dststride; - } - pack_nn(dst, y, u, v, w, 0, 0); - y += ys; dst += dststride; u += us; v += vs; - pack_nn(dst, y, u, v, w, 0, 0); -} - - -static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi) -{ - mp_image_t *dmpi = vf_alloc_out_image(vf); - if (!dmpi) - return NULL; - mp_image_copy_attributes(dmpi, mpi); - - - ilpack(dmpi->planes[0], mpi->planes, dmpi->stride[0], mpi->stride, mpi->w, mpi->h, vf->priv->pack); - - talloc_free(mpi); - return dmpi; -} - -static int config(struct vf_instance *vf, - int width, int height, int d_width, int d_height, - unsigned int flags, unsigned int outfmt) -{ - /* FIXME - also support UYVY output? */ - return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUYV); -} - - -static int query_format(struct vf_instance *vf, unsigned int fmt) -{ - /* FIXME - really any YUV 4:2:0 input format should work */ - switch (fmt) { - case IMGFMT_420P: - return vf_next_query_format(vf,IMGFMT_YUYV); - } - return 0; -} - -static int vf_open(vf_instance_t *vf) -{ - vf->config=config; - vf->query_format=query_format; - vf->filter=filter; - - switch(vf->priv->mode) { - case 0: - vf->priv->pack[0] = vf->priv->pack[1] = pack_nn; - break; - case 1: - vf->priv->pack[0] = pack_li_0; - vf->priv->pack[1] = pack_li_1; - break; - } - - return 1; -} - -#define OPT_BASE_STRUCT struct vf_priv_s -const vf_info_t vf_info_ilpack = { - .description = "4:2:0 planar -> 4:2:2 packed reinterlacer", - .name = "ilpack", - .open = vf_open, - .priv_size = sizeof(struct vf_priv_s), - .priv_defaults = &(const struct vf_priv_s){ - .mode = 1, - }, - .options = (const struct m_option[]){ - OPT_INTRANGE("mode", mode, 0, 0, 1), - {0} - }, -}; diff --git a/wscript_build.py b/wscript_build.py index f46843c714..8efaf554d3 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -306,7 +306,6 @@ def build(ctx): ( "video/filter/vf_format.c" ), ( "video/filter/vf_gradfun.c" ), ( "video/filter/vf_hqdn3d.c" ), - ( "video/filter/vf_ilpack.c" ), ( "video/filter/vf_lavfi.c", "libavfilter"), ( "video/filter/vf_mirror.c" ), ( "video/filter/vf_noformat.c" ), -- cgit v1.2.3