summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video_shaders.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-09-16 13:31:25 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-09-16 14:33:45 +0200
commit06e65778beac1e6f110466b34b5ceb6a8d1ddb42 (patch)
tree81f4a55398f3eea285374412e0b14f145e51476e /video/out/gpu/video_shaders.c
parent87162f0722dfcf6f71276e1ccadb81d7b58f721b (diff)
downloadmpv-06e65778beac1e6f110466b34b5ceb6a8d1ddb42.tar.bz2
mpv-06e65778beac1e6f110466b34b5ceb6a8d1ddb42.tar.xz
filter_kernels: properly sharpen/blur filter radius
We currently always scaled the window to the size of the configured radius. However, this is wrong - we should instead be scaling it to the size of the sharpened/blurred kernel. Since the window is always stretched to the configured size of the filter, we can accomplish this easily by just multiplying the blur value into the filter radius directly, and then using that adjusted radius in place of `f.radius` everywhere. On a side note, this gives a very minor performance boost to ewa_lanczossharp for no downside.
Diffstat (limited to 'video/out/gpu/video_shaders.c')
-rw-r--r--video/out/gpu/video_shaders.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c
index 4b4c13bd84..1957797692 100644
--- a/video/out/gpu/video_shaders.c
+++ b/video/out/gpu/video_shaders.c
@@ -103,7 +103,7 @@ void pass_sample_separated_gen(struct gl_shader_cache *sc, struct scaler *scaler
static void polar_sample(struct gl_shader_cache *sc, struct scaler *scaler,
int x, int y, int components, bool planar)
{
- double radius = scaler->kernel->f.radius * scaler->kernel->filter_scale;
+ double radius = scaler->kernel->radius * scaler->kernel->filter_scale;
double radius_cutoff = scaler->kernel->radius_cutoff;
// Since we can't know the subpixel position in advance, assume a