X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilter.cc;h=c9876c05b16d150748a3fb0cdd17e6d5b2c9d5e9;hb=10a0dd6c5153019e0b17793c812f1653f26e0960;hp=640a531e8aeb7185471c472542af2fed8e3fdbb0;hpb=3e56e4126ec8199f15e03c213b37f39d72c27cc3;p=dcpomatic.git diff --git a/src/lib/filter.cc b/src/lib/filter.cc index 640a531e8..c9876c05b 100644 --- a/src/lib/filter.cc +++ b/src/lib/filter.cc @@ -24,7 +24,6 @@ #include "filter.h" extern "C" { #include -#include } #include "i18n.h" @@ -36,15 +35,13 @@ vector Filter::_filters; /** @param i Our id. * @param n User-visible name. * @param c User-visible category. - * @param v String for a FFmpeg video filter descriptor, or "". - * @param p String for a FFmpeg post-processing descriptor, or "". + * @param v String for a FFmpeg video filter descriptor. */ -Filter::Filter (string i, string n, string c, string v, string p) +Filter::Filter (string i, string n, string c, string v) : _id (i) , _name (n) , _category (c) , _vf (v) - , _pp (p) { } @@ -64,76 +61,42 @@ void Filter::setup_filters () { /* Note: "none" is a magic id name, so don't use it here */ - - maybe_add (N_("pphb"), _("Horizontal deblocking filter"), _("De-blocking"), N_(""), N_("hb")); - maybe_add (N_("ppvb"), _("Vertical deblocking filter"), _("De-blocking"), N_(""), N_("vb")); - maybe_add (N_("ppha"), _("Horizontal deblocking filter A"), _("De-blocking"), N_(""), N_("ha")); - maybe_add (N_("ppva"), _("Vertical deblocking filter A"), _("De-blocking"), N_(""), N_("va")); - maybe_add (N_("pph1"), _("Experimental horizontal deblocking filter 1"), _("De-blocking"), N_(""), N_("h1")); - maybe_add (N_("pphv"), _("Experimental vertical deblocking filter 1"), _("De-blocking"), N_(""), N_("v1")); - maybe_add (N_("ppdr"), _("Deringing filter"), _("Misc"), N_(""), N_("dr")); - maybe_add (N_("pplb"), _("Linear blend deinterlacer"), _("De-interlacing"), N_(""), N_("lb")); - maybe_add (N_("ppli"), _("Linear interpolating deinterlacer"), _("De-interlacing"), N_(""), N_("li")); - maybe_add (N_("ppci"), _("Cubic interpolating deinterlacer"), _("De-interlacing"), N_(""), N_("ci")); - maybe_add (N_("ppmd"), _("Median deinterlacer"), _("De-interlacing"), N_(""), N_("md")); - maybe_add (N_("ppfd"), _("FFMPEG deinterlacer"), _("De-interlacing"), N_(""), N_("fd")); - maybe_add (N_("ppl5"), _("FIR low-pass deinterlacer"), _("De-interlacing"), N_(""), N_("l5")); - maybe_add (N_("mcdeint"), _("Motion compensating deinterlacer"), _("De-interlacing"), N_("mcdeint"), N_("")); - maybe_add (N_("kerndeint"), _("Kernel deinterlacer"), _("De-interlacing"), N_("kerndeint"), N_("")); - maybe_add (N_("yadif"), _("Yet Another Deinterlacing Filter"), _("De-interlacing"), N_("yadif"), N_("")); - maybe_add (N_("pptn"), _("Temporal noise reducer"), _("Noise reduction"), N_(""), N_("tn")); - maybe_add (N_("ppfq"), _("Force quantizer"), _("Misc"), N_(""), N_("fq")); - maybe_add (N_("gradfun"), _("Gradient debander"), _("Misc"), N_("gradfun"), N_("")); - maybe_add (N_("unsharp"), _("Unsharp mask and Gaussian blur"), _("Misc"), N_("unsharp"), N_("")); - maybe_add (N_("denoise3d"), _("3D denoiser"), _("Noise reduction"), N_("denoise3d"), N_("")); - maybe_add (N_("hqdn3d"), _("High quality 3D denoiser"), _("Noise reduction"), N_("hqdn3d"), N_("")); - maybe_add (N_("telecine"), _("Telecine filter"), _("Misc"), N_("telecine"), N_("")); - maybe_add (N_("ow"), _("Overcomplete wavelet denoiser"), _("Noise reduction"), N_("mp=ow"), N_("")); + + maybe_add (N_("mcdeint"), _("Motion compensating deinterlacer"), _("De-interlacing"), N_("mcdeint")); + maybe_add (N_("kerndeint"), _("Kernel deinterlacer"), _("De-interlacing"), N_("kerndeint")); + maybe_add (N_("yadif"), _("Yet Another Deinterlacing Filter"), _("De-interlacing"), N_("yadif")); + maybe_add (N_("gradfun"), _("Gradient debander"), _("Misc"), N_("gradfun")); + maybe_add (N_("unsharp"), _("Unsharp mask and Gaussian blur"), _("Misc"), N_("unsharp")); + maybe_add (N_("denoise3d"), _("3D denoiser"), _("Noise reduction"), N_("denoise3d")); + maybe_add (N_("hqdn3d"), _("High quality 3D denoiser"), _("Noise reduction"), N_("hqdn3d")); + maybe_add (N_("telecine"), _("Telecine filter"), _("Misc"), N_("telecine")); + maybe_add (N_("ow"), _("Overcomplete wavelet denoiser"), _("Noise reduction"), N_("mp=ow")); } void -Filter::maybe_add (string i, string n, string c, string v, string p) +Filter::maybe_add (string i, string n, string c, string v) { - if (!v.empty ()) { - if (avfilter_get_by_name (i.c_str())) { - _filters.push_back (new Filter (i, n, c, v, p)); - } - } else if (!p.empty ()) { - pp_mode* m = pp_get_mode_by_name_and_quality (p.c_str(), PP_QUALITY_MAX); - if (m) { - _filters.push_back (new Filter (i, n, c, v, p)); - pp_free_mode (m); - } + if (avfilter_get_by_name (i.c_str())) { + _filters.push_back (new Filter (i, n, c, v)); } } /** @param filters Set of filters. - * @return A pair; .first is a string to pass to FFmpeg for the video filters, - * .second is a string to pass for the post-processors. + * @return String to pass to FFmpeg for the video filters. */ -pair -Filter::ffmpeg_strings (vector const & filters) +string +Filter::ffmpeg_string (vector const & filters) { string vf; - string pp; for (vector::const_iterator i = filters.begin(); i != filters.end(); ++i) { - if (!(*i)->vf().empty ()) { - if (!vf.empty ()) { - vf += N_(","); - } - vf += (*i)->vf (); - } - - if (!(*i)->pp().empty ()) { - if (!pp.empty()) { - pp += N_(","); - } - pp += (*i)->pp (); + if (!vf.empty ()) { + vf += N_(","); } + vf += (*i)->vf (); } - return make_pair (vf, pp); + return vf; } /** @param d Our id.