From e5afc1f405d0c45a4d712807aa8f30fffc71c6d6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Oct 2012 14:14:07 +0200 Subject: Remove useless video filters Most of these have very limited actual use, or are even entirely useless. They only serve to bloat the codebase and to make life harder. Drowning users in tons of barely useful filters isn't exactly helpful either. Some of these filters were redundant or marked as obsolete. The dlopen and lua (to be added soon) video filters provide ways to add custom filters. Detailed listing for each filter with reasons (with contributions from divVerent and lachs0r): 1bpp: Replaced by "scale". 2xsai: Pixel art scaling algorithm, useless with lossy video. blackframe: Not very useful. Apparently one use is combining it with scripts, that pass the bmovl: Weirdly complex and insane (using FIFO commands), questionable use. cropdetect: Only sort-of useful when used with scripts, and then it will be very fragile. It's probably better to use the dlopen rectangle filter, or to implement the common use-case in a better way. decimate: Not needed/useful with modern video codecs, is an encoding-only filter. denoise3d: "hqdn3d" is better. detc: Some of the worse deteleciners. dint: Useless, actually crashes. (On an assert in vf.c that is disabled by default in mplayer-svn.) dvbscale: Not even practical, and the same effect can be achieved through other means. eq: Worse/older version of eq2. field: Limited use, available as dlopen filter. fil: Quoting the manpage: This filter is very similar to the il filter but much faster, the main disadvantage is that it does not always work. Especially if combined with other filters it may produce randomly messed up images, so be happy if it works but do not complain if it does not for your combination of filters. filmdint: Kind of redundant with pullup, and slightly worse. fixpts: Never useful. (Most if not all filters have been fixed for PTS.) framestep: Questionable use. For things like creating thumbnails, ffmpeg or --sstep should be used. geq: Limited use, will be redundant with the "lua" filter. halfpack: Useless, probably redundant with "scale". harddup: Useless. hue: Most VOs support this. il: Useless. ivtc: Another of the worse deteleciners. kerndeint: A bad deinterlacer. lavc: For DVB output devices. We removed that support. lavcdeint: A bad deinterlacer, was already deprecated. Still available as --vf=pp=fd. mcdeint: A broken deinterlacer that uses lavc internals. ow: Very slow, barely any quality benefit over "hqdn3d". palette: Done by "scale". perspective: Files with incorrect perspective are extremely rare. About the only real-world use for this is keystone correction, which is usually done in hardware by the projector or by graphics drivers/compositors. pp7: Another useless postprocessing filter with bad and complicated code. Use libpostprocess with "pp" instead. qp: Useless. remove-logo: Redundant with delogo, which is better and more practical. rgbtest: Useless. sab, smartblur, boxblur: Blur filters, redundant to "unsharp". softskip: Does nothing. spp, fspp, uspp: Useless postprocessing filters. "spp" needs ffmpeg internals. "fspp" is the optimized version of the "spp" filter (???), while "uspp" is the slow version (????). Use libpostprocess with "pp" instead. telecine: Evil and useless. Available as dlopen filter for testing purposes. test: Useless. tfields: Useless, probably. tile: Questionable use. Available as dlopen filter. tinterlace: Evil and useless. yuvcsp: Probably useless. yvu9: Redundant with "scale". Also remove the following left-over files: vd_null.c, vqf.h --- libmpcodecs/vf_framestep.c | 203 --------------------------------------------- 1 file changed, 203 deletions(-) delete mode 100644 libmpcodecs/vf_framestep.c (limited to 'libmpcodecs/vf_framestep.c') diff --git a/libmpcodecs/vf_framestep.c b/libmpcodecs/vf_framestep.c deleted file mode 100644 index d6aad9a90a..0000000000 --- a/libmpcodecs/vf_framestep.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * filter to ouput only 1 every n frame, or only the I (key)frame - * - * The parameters are: - * - * [I] | [i]num - * - * if you call the filter with I (uppercase) as the parameter - * ... -vf framestep=I ... - * then ONLY the keyframes are outputted. - * For DVD it means, generally, one every 15 frames (IBBPBBPBBPBBPBB), for avi it means - * every scene change or every keyint value (see -lavcopts). - * - * if you call the filter with the i (lowercase) - * ... -vf framestep=i ... - * then a I! followed by a cr is printed when a key frame (eg Intra frame) is - * found, leaving the current line of mplayer, where you got the time, in - * seconds, and frame of the key. Use this information to split the AVI. - * - * After the i or alone you can put a positive number and only one frame every - * x (the number you set) is passed on the filter chain, limiting the output - * of the frame. - * - * Example - * ... -vf framestep=i20 ... - * Dump one every 20 frames, printing on the console when a I-Frame is encounter. - * - * ... -vf framestep=25 - * Dump one every 25 frames. - * - * If you call the filter without parameter it does nothing (except using memory - * and resource of your system,. of course). - * - * This filter doesn' t work like the option -sstep seconds. - * - * The -sstep seek to the new position, without decoding all frames but, - * expecially on avi file coded whith mpeg4 (lavc or xvid or divx), the - * seek is not always too much precise. - * - * This filter simply discard the unwanted frames, so you are very precise in - * counting the frame but sometime you use a lot of CPU for nothing. - * - * As usual it depends on what you're doing. - * - * copyright (c) 2003 Daniele Forghieri ( guru@digitalfantasy.it ) - * - * 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 "config.h" -#include "mp_msg.h" -#include "cpudetect.h" - -#include "img_format.h" -#include "mp_image.h" -#include "vf.h" - -/* Uncomment if you want to print some info on the format */ -// #define DUMP_FORMAT_DATA - -/* Private data */ -struct vf_priv_s { - /* Current frame */ - int frame_cur; - /* Frame output step, 0 = all */ - int frame_step; - /* Only I-Frame (2), print on I-Frame (1) */ - int dump_iframe; -}; - -/* Filter handler */ -static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) -{ - mp_image_t *dmpi; - struct vf_priv_s *priv; - int skip; - - priv = vf->priv; - - /* Print the 'I' if is a intra frame. The \n advance the current line so you got the - * current file time (in second) and the frame number on the console ;-) - */ - if (priv->dump_iframe) { - if (mpi->pict_type == 1) { - mp_msg(MSGT_VFILTER, MSGL_INFO, "I!\n"); - } - } - - /* decide if frame must be shown */ - if (priv->dump_iframe == 2) { - /* Only key frame */ - skip = mpi->pict_type == 1 ? 0 : 1; - } - else { - /* Only 1 every frame_step */ - skip = 0; - if ((priv->frame_step != 0) && ((priv->frame_cur % priv->frame_step) != 0)) { - skip = 1; - } - } - /* Increment current frame */ - ++priv->frame_cur; - - if (skip == 0) { - /* Get image, export type (we don't modify tghe image) */ - dmpi=vf_get_image(vf->next, mpi->imgfmt, - MP_IMGTYPE_EXPORT, 0, - mpi->w, mpi->h); - /* Copy only the pointer ( MP_IMGTYPE_EXPORT ! ) */ - dmpi->planes[0] = mpi->planes[0]; - dmpi->planes[1] = mpi->planes[1]; - dmpi->planes[2] = mpi->planes[2]; - - dmpi->stride[0] = mpi->stride[0]; - dmpi->stride[1] = mpi->stride[1]; - dmpi->stride[2] = mpi->stride[2]; - - dmpi->width = mpi->width; - dmpi->height = mpi->height; - - /* Chain to next filter / output ... */ - return vf_next_put_image(vf, dmpi, pts); - } - - /* Skip the frame */ - return 0; -} - -static void uninit(struct vf_instance *vf) -{ - /* Free private data */ - free(vf->priv); -} - -/* Main entry funct for the filter */ -static int vf_open(vf_instance_t *vf, char *args) -{ - struct vf_priv_s *p; - - vf->put_image = put_image; - vf->uninit = uninit; - vf->default_reqs = VFCAP_ACCEPT_STRIDE; - vf->priv = p = calloc(1, sizeof(struct vf_priv_s)); - if (p == NULL) { - return 0; - } - - if (args != NULL) { -#ifdef DUMP_FORMAT_DATA - if (*args == 'd') { - p->dump_iframe = 3; - } - else -#endif - if (*args == 'I') { - /* Dump only KEY (ie INTRA) frame */ - p->dump_iframe = 2; - } - else { - if (*args == 'i') { - /* Print a 'I!' when a i-frame is encounter */ - p->dump_iframe = 1; - ++args; - } - - if (*args != '\0') { - p->frame_step = atoi(args); - if (p->frame_step <= 0) { - mp_tmsg(MSGT_VFILTER, MSGL_WARN, "[VF_FRAMESTEP] Error parsing argument.\n"); - return 0; - } - } - } - } - return 1; -} - -const vf_info_t vf_info_framestep = { - "Dump one every n / key frames", - "framestep", - "Daniele Forghieri", - "", - vf_open, - NULL -}; -- cgit v1.2.3