summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-02 14:14:07 +0200
committerwm4 <wm4@nowhere>2012-10-03 01:28:40 +0200
commite5afc1f405d0c45a4d712807aa8f30fffc71c6d6 (patch)
treedb545383b339cb174759f1ea4b63ed2ea59d5cc1 /libmpcodecs
parentf9f6ded36c72cbc8264325d505267a6d897b0c87 (diff)
downloadmpv-e5afc1f405d0c45a4d712807aa8f30fffc71c6d6.tar.bz2
mpv-e5afc1f405d0c45a4d712807aa8f30fffc71c6d6.tar.xz
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
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/cmmx.h202
-rw-r--r--libmpcodecs/vd_null.c56
-rw-r--r--libmpcodecs/vf.c99
-rw-r--r--libmpcodecs/vf_1bpp.c207
-rw-r--r--libmpcodecs/vf_2xsai.c336
-rw-r--r--libmpcodecs/vf_blackframe.c148
-rw-r--r--libmpcodecs/vf_bmovl.c496
-rw-r--r--libmpcodecs/vf_boxblur.c214
-rw-r--r--libmpcodecs/vf_cropdetect.c200
-rw-r--r--libmpcodecs/vf_decimate.c198
-rw-r--r--libmpcodecs/vf_denoise3d.c268
-rw-r--r--libmpcodecs/vf_detc.c458
-rw-r--r--libmpcodecs/vf_dint.c214
-rw-r--r--libmpcodecs/vf_dvbscale.c67
-rw-r--r--libmpcodecs/vf_eq.c258
-rw-r--r--libmpcodecs/vf_field.c89
-rw-r--r--libmpcodecs/vf_fil.c116
-rw-r--r--libmpcodecs/vf_filmdint.c1442
-rw-r--r--libmpcodecs/vf_fixpts.c136
-rw-r--r--libmpcodecs/vf_framestep.c203
-rw-r--r--libmpcodecs/vf_fspp.c2112
-rw-r--r--libmpcodecs/vf_geq.c197
-rw-r--r--libmpcodecs/vf_halfpack.c254
-rw-r--r--libmpcodecs/vf_harddup.c92
-rw-r--r--libmpcodecs/vf_hue.c200
-rw-r--r--libmpcodecs/vf_il.c148
-rw-r--r--libmpcodecs/vf_ivtc.c555
-rw-r--r--libmpcodecs/vf_kerndeint.c345
-rw-r--r--libmpcodecs/vf_lavc.c173
-rw-r--r--libmpcodecs/vf_lavcdeint.c188
-rw-r--r--libmpcodecs/vf_mcdeint.c330
-rw-r--r--libmpcodecs/vf_ow.c322
-rw-r--r--libmpcodecs/vf_palette.c234
-rw-r--r--libmpcodecs/vf_perspective.c341
-rw-r--r--libmpcodecs/vf_pp7.c489
-rw-r--r--libmpcodecs/vf_qp.c177
-rw-r--r--libmpcodecs/vf_remove_logo.c908
-rw-r--r--libmpcodecs/vf_rgbtest.c171
-rw-r--r--libmpcodecs/vf_sab.c292
-rw-r--r--libmpcodecs/vf_smartblur.c236
-rw-r--r--libmpcodecs/vf_softskip.c102
-rw-r--r--libmpcodecs/vf_spp.c612
-rw-r--r--libmpcodecs/vf_telecine.c190
-rw-r--r--libmpcodecs/vf_test.c332
-rw-r--r--libmpcodecs/vf_tfields.c476
-rw-r--r--libmpcodecs/vf_tile.c332
-rw-r--r--libmpcodecs/vf_tinterlace.c235
-rw-r--r--libmpcodecs/vf_uspp.c384
-rw-r--r--libmpcodecs/vf_yuvcsp.c120
-rw-r--r--libmpcodecs/vf_yvu9.c104
-rw-r--r--libmpcodecs/vqf.h228
51 files changed, 1 insertions, 16285 deletions
diff --git a/libmpcodecs/cmmx.h b/libmpcodecs/cmmx.h
deleted file mode 100644
index 51ffd235bc..0000000000
--- a/libmpcodecs/cmmx.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * x86 MMX and MMX2 packed byte operations in portable C.
- * Extra instructions: pdiffub, pcmpzb, psumbw, pcmpgtub
- * Author: Zoltan Hidvegi
- *
- * 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.
- */
-
-#ifndef MPLAYER_CMMX_H
-#define MPLAYER_CMMX_H
-
-typedef unsigned long cmmx_t;
-
-#define ONE_BYTES (~(cmmx_t)0 / 255)
-#define SIGN_BITS (ONE_BYTES << 7)
-#define LOWBW_MASK (~(cmmx_t)0 / 257)
-
-static inline cmmx_t
-paddb(cmmx_t a, cmmx_t b)
-{
- return ((a & ~SIGN_BITS) + (b & ~SIGN_BITS)) ^ ((a^b) & SIGN_BITS);
-}
-
-static inline cmmx_t
-psubb(cmmx_t a, cmmx_t b)
-{
- return ((a | SIGN_BITS) - (b & ~SIGN_BITS)) ^ (~(a^b) & SIGN_BITS);
-}
-
-static inline cmmx_t
-paddusb(cmmx_t a, cmmx_t b)
-{
- cmmx_t s = (a & ~SIGN_BITS) + (b & ~SIGN_BITS);
- cmmx_t abs = (a | b) & SIGN_BITS;
- cmmx_t c = abs & (s | (a & b));
- return s | abs | (abs - (c >> 7));
-}
-
-static inline cmmx_t
-paddusb_s(cmmx_t a, cmmx_t b)
-{
- cmmx_t sum = a+b;
- cmmx_t ov = sum & SIGN_BITS;
- return sum + (sum ^ (ov - (ov>>7)));
-}
-
-static inline cmmx_t
-psubusb(cmmx_t a, cmmx_t b)
-{
- cmmx_t s = (a | SIGN_BITS) - (b & ~SIGN_BITS);
- cmmx_t anb = a & ~b;
- cmmx_t c = (anb | (s & ~(a^b))) & SIGN_BITS;
- return s & ((c & anb) | (c - (c >> 7)));
-}
-
-static inline cmmx_t
-psubusb_s(cmmx_t a, cmmx_t b)
-{
- cmmx_t d = (a|SIGN_BITS) - b;
- cmmx_t m = d & SIGN_BITS;
- return d & (m - (m>>7));
-}
-
-static inline cmmx_t
-pcmpgtub(cmmx_t b, cmmx_t a)
-{
- cmmx_t s = (a | SIGN_BITS) - (b & ~SIGN_BITS);
- cmmx_t ret = ((~a & b) | (~s & ~(a ^ b))) & SIGN_BITS;
- return ret | (ret - (ret >> 7));
-}
-
-static inline cmmx_t
-pdiffub(cmmx_t a, cmmx_t b)
-{
- cmmx_t xs = (~a ^ b) & SIGN_BITS;
- cmmx_t s = ((a | SIGN_BITS) - (b & ~SIGN_BITS)) ^ xs;
- cmmx_t gt = ((~a & b) | (s & xs)) & SIGN_BITS;
- cmmx_t gt7 = gt >> 7;
- return (s ^ gt ^ (gt - gt7)) + gt7;
-}
-
-static inline cmmx_t
-pdiffub_s(cmmx_t a, cmmx_t b)
-{
- cmmx_t d = (a|SIGN_BITS) - b;
- cmmx_t g = (~d & SIGN_BITS) >> 7;
- return (d ^ (SIGN_BITS-g)) + g;
-}
-
-static inline cmmx_t
-pmaxub(cmmx_t a, cmmx_t b)
-{
- return psubusb(a,b) + b;
-}
-
-static inline cmmx_t
-pminub(cmmx_t a, cmmx_t b)
-{
- return paddusb(a,~b) - ~b;
-}
-
-static inline cmmx_t
-pminub_s(cmmx_t a, cmmx_t b)
-{
- cmmx_t d = (a|SIGN_BITS) - b;
- cmmx_t m = ~SIGN_BITS + ((d&SIGN_BITS)>>7);
- return ((d&m) + b) & ~SIGN_BITS;
-}
-
-static inline cmmx_t
-pavgb(cmmx_t a, cmmx_t b)
-{
- cmmx_t ao = a & ONE_BYTES;
- cmmx_t bo = b & ONE_BYTES;
- return ((a^ao)>>1) + ((b^bo)>>1) + (ao|bo);
-}
-
-static inline cmmx_t
-pavgb_s(cmmx_t a, cmmx_t b)
-{
- return ((a+b+ONE_BYTES)>>1) & ~SIGN_BITS;
-}
-
-static inline cmmx_t
-p31avgb(cmmx_t a, cmmx_t b)
-{
- cmmx_t ao = a & (3*ONE_BYTES);
- cmmx_t bo = b & (3*ONE_BYTES);
- return 3*((a^ao)>>2) + ((b^bo)>>2) +
- (((3*ao+bo+2*ONE_BYTES)>>2) & (3*ONE_BYTES));
-}
-
-static inline cmmx_t
-p31avgb_s(cmmx_t a, cmmx_t b)
-{
- cmmx_t avg = ((a+b)>>1) & ~SIGN_BITS;
- return pavgb_s(avg, a);
-}
-
-static inline unsigned long
-psumbw(cmmx_t a)
-{
- cmmx_t t = (a & LOWBW_MASK) + ((a>>8) & LOWBW_MASK);
- unsigned long ret =
- (unsigned long)t + (unsigned long)(t >> (4*sizeof(cmmx_t)));
- if (sizeof(cmmx_t) > 4)
- ret += ret >> 16;
- return ret & 0xffff;
-}
-
-static inline unsigned long
-psumbw_s(cmmx_t a)
-{
- unsigned long ret =
- (unsigned long)a + (unsigned long)(a >> (4*sizeof(cmmx_t)));
- if (sizeof(cmmx_t) <= 4)
- return (ret & 0xff) + ((ret>>8) & 0xff);
- ret = (ret & 0xff00ff) + ((ret>>8) & 0xff00ff);
- ret += ret >> 16;
- return ret & 0xffff;
-}
-
-static inline unsigned long
-psadbw(cmmx_t a, cmmx_t b)
-{
- return psumbw(pdiffub(a,b));
-}
-
-static inline unsigned long
-psadbw_s(cmmx_t a, cmmx_t b)
-{
- return psumbw_s(pdiffub_s(a,b));
-}
-
-static inline cmmx_t
-pcmpzb(cmmx_t a)
-{
- cmmx_t ret = (((a | SIGN_BITS) - ONE_BYTES) | a) & SIGN_BITS;
- return ~(ret | (ret - (ret >> 7)));
-}
-
-static inline cmmx_t
-pcmpeqb(cmmx_t a, cmmx_t b)
-{
- return pcmpzb(a ^ b);
-}
-
-#endif /* MPLAYER_CMMX_H */
diff --git a/libmpcodecs/vd_null.c b/libmpcodecs/vd_null.c
deleted file mode 100644
index 894585b42f..0000000000
--- a/libmpcodecs/vd_null.c
+++ /dev/null
@@ -1,56 +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 <stdio.h>
-#include <stdlib.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "vd_internal.h"
-
-static const vd_info_t info =
-{
- "Null video decoder",
- "null",
- "A'rpi",
- "A'rpi",
- "no decoding"
-};
-
-LIBVD_EXTERN(null)
-
-// to set/get/query special features/parameters
-static int control(sh_video_t *sh,int cmd,void* arg,...){
- return CONTROL_UNKNOWN;
-}
-
-// init driver
-static int init(sh_video_t *sh){
- if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24)) return 0;
- return 1;
-}
-
-// uninit driver
-static void uninit(sh_video_t *sh){
-}
-
-// decode a frame
-static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
- return NULL;
-}
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index f847dd69b8..5ec7d19570 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -38,7 +38,6 @@
#include "libvo/fastmemcpy.h"
extern const vf_info_t vf_info_vo;
-extern const vf_info_t vf_info_bmovl;
extern const vf_info_t vf_info_crop;
extern const vf_info_t vf_info_expand;
extern const vf_info_t vf_info_pp;
@@ -48,161 +47,65 @@ extern const vf_info_t vf_info_noformat;
extern const vf_info_t vf_info_flip;
extern const vf_info_t vf_info_rotate;
extern const vf_info_t vf_info_mirror;
-extern const vf_info_t vf_info_palette;
-extern const vf_info_t vf_info_lavc;
-extern const vf_info_t vf_info_dvbscale;
-extern const vf_info_t vf_info_cropdetect;
-extern const vf_info_t vf_info_test;
extern const vf_info_t vf_info_noise;
-extern const vf_info_t vf_info_yvu9;
-extern const vf_info_t vf_info_lavcdeint;
-extern const vf_info_t vf_info_eq;
extern const vf_info_t vf_info_eq2;
extern const vf_info_t vf_info_gradfun;
-extern const vf_info_t vf_info_halfpack;
-extern const vf_info_t vf_info_dint;
-extern const vf_info_t vf_info_1bpp;
-extern const vf_info_t vf_info_2xsai;
extern const vf_info_t vf_info_unsharp;
extern const vf_info_t vf_info_swapuv;
-extern const vf_info_t vf_info_il;
-extern const vf_info_t vf_info_fil;
-extern const vf_info_t vf_info_boxblur;
-extern const vf_info_t vf_info_sab;
-extern const vf_info_t vf_info_smartblur;
-extern const vf_info_t vf_info_perspective;
extern const vf_info_t vf_info_down3dright;
-extern const vf_info_t vf_info_field;
-extern const vf_info_t vf_info_denoise3d;
extern const vf_info_t vf_info_hqdn3d;
-extern const vf_info_t vf_info_detc;
-extern const vf_info_t vf_info_telecine;
-extern const vf_info_t vf_info_tinterlace;
-extern const vf_info_t vf_info_tfields;
-extern const vf_info_t vf_info_ivtc;
extern const vf_info_t vf_info_ilpack;
extern const vf_info_t vf_info_dsize;
-extern const vf_info_t vf_info_decimate;
extern const vf_info_t vf_info_softpulldown;
extern const vf_info_t vf_info_pullup;
-extern const vf_info_t vf_info_filmdint;
-extern const vf_info_t vf_info_framestep;
-extern const vf_info_t vf_info_tile;
extern const vf_info_t vf_info_delogo;
-extern const vf_info_t vf_info_remove_logo;
-extern const vf_info_t vf_info_hue;
-extern const vf_info_t vf_info_spp;
-extern const vf_info_t vf_info_uspp;
-extern const vf_info_t vf_info_fspp;
-extern const vf_info_t vf_info_pp7;
-extern const vf_info_t vf_info_yuvcsp;
-extern const vf_info_t vf_info_kerndeint;
-extern const vf_info_t vf_info_rgbtest;
-extern const vf_info_t vf_info_qp;
extern const vf_info_t vf_info_phase;
extern const vf_info_t vf_info_divtc;
-extern const vf_info_t vf_info_harddup;
extern const vf_info_t vf_info_softskip;
extern const vf_info_t vf_info_screenshot;
extern const vf_info_t vf_info_screenshot_force;
extern const vf_info_t vf_info_ass;
-extern const vf_info_t vf_info_mcdeint;
extern const vf_info_t vf_info_yadif;
-extern const vf_info_t vf_info_blackframe;
-extern const vf_info_t vf_info_geq;
-extern const vf_info_t vf_info_ow;
-extern const vf_info_t vf_info_fixpts;
extern const vf_info_t vf_info_stereo3d;
extern const vf_info_t vf_info_dlopen;
// list of available filters:
static const vf_info_t *const filter_list[] = {
-#ifdef HAVE_POSIX_SELECT
- &vf_info_bmovl,
-#endif
&vf_info_crop,
&vf_info_expand,
&vf_info_scale,
-// &vf_info_osd,
&vf_info_vo,
&vf_info_format,
&vf_info_noformat,
&vf_info_flip,
&vf_info_rotate,
&vf_info_mirror,
- &vf_info_palette,
- &vf_info_pp7,
#ifdef CONFIG_LIBPOSTPROC
&vf_info_pp,
#endif
- &vf_info_lavc,
- &vf_info_lavcdeint,
+
&vf_info_screenshot,
&vf_info_screenshot_force,
- &vf_info_fspp,
- &vf_info_uspp,
- &vf_info_dvbscale,
- &vf_info_cropdetect,
- &vf_info_test,
&vf_info_noise,
- &vf_info_yvu9,
- &vf_info_eq,
&vf_info_eq2,
&vf_info_gradfun,
- &vf_info_halfpack,
- &vf_info_dint,
- &vf_info_1bpp,
- &vf_info_2xsai,
&vf_info_unsharp,
&vf_info_swapuv,
- &vf_info_il,
- &vf_info_fil,
- &vf_info_boxblur,
- &vf_info_sab,
- &vf_info_smartblur,
- &vf_info_perspective,
&vf_info_down3dright,
- &vf_info_field,
- &vf_info_denoise3d,
&vf_info_hqdn3d,
- &vf_info_detc,
- &vf_info_telecine,
- &vf_info_tinterlace,
- &vf_info_tfields,
- &vf_info_ivtc,
&vf_info_ilpack,
&vf_info_dsize,
- &vf_info_decimate,
&vf_info_softpulldown,
&vf_info_pullup,
- &vf_info_filmdint,
- &vf_info_framestep,
- &vf_info_tile,
&vf_info_delogo,
- &vf_info_remove_logo,
- &vf_info_hue,
-#ifdef CONFIG_FFMPEG_INTERNALS
- &vf_info_spp,
- &vf_info_mcdeint,
-#endif
- &vf_info_geq,
- &vf_info_qp,
- &vf_info_yuvcsp,
- &vf_info_kerndeint,
- &vf_info_rgbtest,
&vf_info_phase,
&vf_info_divtc,
- &vf_info_harddup,
- &vf_info_softskip,
#ifdef CONFIG_ASS
&vf_info_ass,
#endif
&vf_info_yadif,
- &vf_info_blackframe,
- &vf_info_ow,
- &vf_info_fixpts,
&vf_info_stereo3d,
&vf_info_dlopen,
NULL
diff --git a/libmpcodecs/vf_1bpp.c b/libmpcodecs/vf_1bpp.c
deleted file mode 100644
index 8d13735942..0000000000
--- a/libmpcodecs/vf_1bpp.c
+++ /dev/null
@@ -1,207 +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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "img_format.h"
-#include "mp_image.h"
-#include "vf.h"
-
-//===========================================================================//
-
-static const unsigned int bgr_list[]={
- IMGFMT_Y800,
- IMGFMT_Y8,
- IMGFMT_BGR8,
- IMGFMT_RGB8,
-
- IMGFMT_YVU9,
- IMGFMT_411P,
- IMGFMT_YV12,
- IMGFMT_I420,
- IMGFMT_IYUV,
- IMGFMT_422P,
- IMGFMT_444P,
-
- IMGFMT_YUY2,
- IMGFMT_BGR12,
- IMGFMT_RGB12,
- IMGFMT_BGR15,
- IMGFMT_RGB15,
- IMGFMT_BGR16,
- IMGFMT_RGB16,
-
- IMGFMT_BGR32,
- IMGFMT_RGB32,
-
-// IMGFMT_BGR24,
-// IMGFMT_RGB24,
- 0
-};
-
-static unsigned int find_best(struct vf_instance *vf){
- unsigned int best=0;
- int ret;
- const unsigned int* p=bgr_list;
- while(*p){
- ret=vf->next->query_format(vf->next,*p);
- mp_msg(MSGT_VFILTER,MSGL_V,"[%s] query(%s) -> %d\n",vf->info->name,vo_format_name(*p),ret&3);
- if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=*p; break;} // no conversion -> bingo!
- if(ret&VFCAP_CSP_SUPPORTED && !best) best=*p; // best with conversion
- ++p;
- }
- return best;
-}
-
-//===========================================================================//
-
-struct vf_priv_s {
- unsigned int fmt;
-};
-
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- if (!vf->priv->fmt)
- vf->priv->fmt=find_best(vf);
- if(!vf->priv->fmt){
- // no matching fmt, so force one...
- if(outfmt==IMGFMT_RGB8) vf->priv->fmt=IMGFMT_RGB32;
- else if(outfmt==IMGFMT_BGR8) vf->priv->fmt=IMGFMT_BGR32;
- else return 0;
- }
- return vf_next_config(vf,width,height,d_width,d_height,flags,vf->priv->fmt);
-}
-
-static const int bittab[8]={128,64,32,16,8,4,2,1};
-
-static void convert(mp_image_t *mpi, mp_image_t *dmpi, int value0, int value1,int bpp){
- int y;
- for(y=0;y<mpi->h;y++){
- unsigned char* src=mpi->planes[0]+mpi->stride[0]*y;
- switch(bpp){
- case 1: {
- unsigned char* dst=dmpi->planes[0]+dmpi->stride[0]*y;
- int x;
- for(x=0;x<mpi->w;x++)
- dst[x]=(src[x>>3]&bittab[x&7]) ? value1 : value0;
- break; }
- case 2: {
- uint16_t* dst=(uint16_t*)(dmpi->planes[0]+dmpi->stride[0]*y);
- int x;
- for(x=0;x<mpi->w;x++)
- dst[x]=(src[x>>3]&bittab[x&7]) ? value1 : value0;
- break; }
- case 4: {
- uint32_t* dst=(uint32_t*)(dmpi->planes[0]+dmpi->stride[0]*y);
- int x;
- for(x=0;x<mpi->w;x++)
- dst[x]=(src[x>>3]&bittab[x&7]) ? value1 : value0;
- break; }
- }
- }
-}
-
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
- mp_image_t *dmpi;
-
- // hope we'll get DR buffer:
- dmpi=vf_get_image(vf->next,vf->priv->fmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- mpi->w, mpi->h);
-
- switch(dmpi->imgfmt){
- case IMGFMT_Y800:
- case IMGFMT_Y8:
- case IMGFMT_BGR8:
- case IMGFMT_RGB8:
- convert(mpi,dmpi,0,255,1);
- break;
- case IMGFMT_YVU9:
- case IMGFMT_411P:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_422P:
- case IMGFMT_444P:
- convert(mpi,dmpi,0,255,1);
- memset(dmpi->planes[1],128,dmpi->stride[1]*dmpi->chroma_height);
- memset(dmpi->planes[2],128,dmpi->stride[2]*dmpi->chroma_height);
- break;
- case IMGFMT_YUY2:
- convert(mpi,dmpi,0x8000,0x80ff,2);
- break;
- case IMGFMT_BGR12:
- case IMGFMT_RGB12:
- convert(mpi,dmpi,0,0x0fff,2);
- break;
- case IMGFMT_BGR15:
- case IMGFMT_RGB15:
- convert(mpi,dmpi,0,0x7fff,2);
- break;
- case IMGFMT_BGR16:
- case IMGFMT_RGB16:
- convert(mpi,dmpi,0,0xffff,2);
- break;
- case IMGFMT_BGR32:
- case IMGFMT_RGB32:
- convert(mpi,dmpi,0,0x00ffffff,4);
- break;
- default:
- mp_msg(MSGT_VFILTER,MSGL_ERR,"Unhandled format: 0x%X\n",dmpi->imgfmt);
- return 0;
- }
-
- return vf_next_put_image(vf,dmpi, pts);
-}
-
-//===========================================================================//
-
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- int best;
- if(fmt!=IMGFMT_RGB1 && fmt!=IMGFMT_BGR1) return 0;
- best=find_best(vf);
- if(!best) return 0; // no match
- return vf->next->query_format(vf->next,best);
-}
-
-static int vf_open(vf_instance_t *vf, char *args){
- vf->config=config;
- vf->put_image=put_image;
- vf->query_format=query_format;
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
- return 1;
-}
-
-const vf_info_t vf_info_1bpp = {
- "1bpp bitmap -> YUV/BGR 8/15/16/32 conversion",
- "1bpp",
- "A'rpi",
- "",
- vf_open,
- NULL
-};
-
-//===========================================================================//
diff --git a/libmpcodecs/vf_2xsai.c b/libmpcodecs/vf_2xsai.c
deleted file mode 100644
index dc33d9fccf..0000000000
--- a/