summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-06-19 13:06:01 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-06-21 23:52:35 +0200
commit0af81b16d80e94a8cb3d70622740f0bd99833b75 (patch)
tree1ba5cd15260707ec8e9739984158160c039a2e85
parentf1600ea9cf1664a094983cf75d63dc6ea09fe1b6 (diff)
downloadmpv-0af81b16d80e94a8cb3d70622740f0bd99833b75.tar.bz2
mpv-0af81b16d80e94a8cb3d70622740f0bd99833b75.tar.xz
vo_gpu_next: add --corner-rounding option
For better or worse.
-rw-r--r--DOCS/interface-changes.rst1
-rw-r--r--DOCS/man/options.rst6
-rw-r--r--video/out/vo_gpu_next.c6
3 files changed, 13 insertions, 0 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index eb1de6a17c..e476e8debb 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -77,6 +77,7 @@ Interface changes
`--gpu-shader-cache` is no longer required
- remove the `--tone-mapping-crosstalk` option
- add `--gamut-mapping-mode=perceptual|relative|saturation|absolute|linear`
+ - add `--corner-rounding` option
--- mpv 0.35.0 ---
- add the `--vo=gpu-next` video output driver, as well as the options
`--allow-delayed-peak-detect`, `--builtin-scalers`,
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index ed85c44eca..b4f0865cdc 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -5967,6 +5967,12 @@ them.
remaining quantization artifacts. Higher numbers add more noise. (Default
48)
+``--corner-rounding=<0..1>``
+ If set to a value above 0.0, the output will be rendered with rounded
+ corners, as if an alpha transparency mask had been applied. The value
+ indicates the relative fraction of the side length to round - a value of
+ 1.0 rounds the corners as much as possible. (``--vo=gpu-next`` only)
+
``--sharpen=<value>``
If set to a value other than 0, enable an unsharp masking filter. Positive
values will sharpen the image (but add more ringing and aliasing). Negative
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 825c93178b..48fcb8cc18 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -151,6 +151,8 @@ struct priv {
bool delayed_peak;
bool inter_preserve;
bool target_hint;
+
+ float corner_rounding;
};
static void update_render_options(struct vo *vo);
@@ -1815,6 +1817,9 @@ static void update_render_options(struct vo *vo)
p->params.disable_linear_scaling = !opts->linear_downscaling && !opts->linear_upscaling;
p->params.disable_fbos = opts->dumb_mode == 1;
p->params.blend_against_tiles = opts->alpha_mode == ALPHA_BLEND_TILES;
+#if PL_API_VER >= 277
+ p->params.corner_rounding = p->corner_rounding;
+#endif
// Map scaler options as best we can
p->params.upscaler = map_scaler(p, SCALER_SCALE);
@@ -1998,6 +2003,7 @@ const struct vo_driver video_out_gpu_next = {
.options = (const struct m_option[]) {
{"allow-delayed-peak-detect", OPT_BOOL(delayed_peak)},
+ {"corner-rounding", OPT_FLOAT(corner_rounding), M_RANGE(0, 1)},
{"interpolation-preserve", OPT_BOOL(inter_preserve)},
{"lut", OPT_STRING(lut.opt), .flags = M_OPT_FILE},
{"lut-type", OPT_CHOICE_C(lut.type, lut_types)},