summaryrefslogtreecommitdiffstats
path: root/video/zimg.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-31 16:45:28 +0100
committerwm4 <wm4@nowhere>2019-10-31 16:51:12 +0100
commita7230dfed0bf563fd9f4673c3020d1cf8461febf (patch)
treed34d333e6f627842aa55e4737a441710d700820d /video/zimg.h
parent2c43d2b75a88b8e0e8f0a715f993ffc1c8977d13 (diff)
downloadmpv-a7230dfed0bf563fd9f4673c3020d1cf8461febf.tar.bz2
mpv-a7230dfed0bf563fd9f4673c3020d1cf8461febf.tar.xz
sws_utils, zimg: destroy vo_x11 and vo_drm performance
Raise swscale and zimg default parameters. This restores screenshot quality settings (maybe) unset in the commit before. Also expose some more libswscale and zimg options. Since these options are also used for VOs like x11 and drm, this will make x11/drm/etc. much slower. For compensation, provide a profile that sets the old option values: sw-fast. I'm also enabling zimg here, just as an experiment. The core problem is that we have a single set of command line options which control the settings used for most swscale/zimg uses. This was done in the previous commit. It cannot differentiate between the VOs, which need to be realtime and may accept/require lower quality options, and things like screenshots or vo_image, which can be slower, but should not sacrifice quality by default. Should this have two sets of options or something similar to do the right thing depending on the code which calls libswscale? Maybe. Or should I just ignore the problem, make it someone else's problem (users who want to use software conversion VOs), provide a sub-optimal solution, and call it a day? Definitely, sounds good, pushing to master, goodbye.
Diffstat (limited to 'video/zimg.h')
-rw-r--r--video/zimg.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/video/zimg.h b/video/zimg.h
index 9fa247d061..0ef9c5a3a0 100644
--- a/video/zimg.h
+++ b/video/zimg.h
@@ -13,6 +13,15 @@ struct mpv_global;
bool mp_zimg_supports_in_format(int imgfmt);
bool mp_zimg_supports_out_format(int imgfmt);
+struct zimg_opts {
+ int scaler;
+ double scaler_params[2];
+ int scaler_chroma;
+ double scaler_chroma_params[2];
+ int dither;
+ int fast;
+};
+
struct mp_zimg_context {
// Can be set for verbose error printing.
struct mp_log *log;
@@ -20,12 +29,7 @@ struct mp_zimg_context {
// User configuration. Note: changing these requires calling mp_zimg_config()
// to update the filter graph. The first mp_zimg_convert() call (or if the
// image format changes) will do this automatically.
- zimg_resample_filter_e scaler;
- double scaler_params[2];
- zimg_resample_filter_e scaler_chroma;
- double scaler_chroma_params[2];
- zimg_dither_type_e dither;
- bool fast; // reduce quality for better performance
+ struct zimg_opts opts;
// Input/output parameters. Note: if these mismatch with the
// mp_zimg_convert() parameters, mp_zimg_config() will be called