mirror of
https://github.com/mpv-player/mpv
synced 2024-12-17 12:25:03 +00:00
vo_opengl: add ginseng upscaler
This is a variation of ewa_lanczos that is sinc-windowed instead of jinc-windowed. Results are pretty similar, but the logic is simpler. This could potentially replace the ugly ewa_lanczos code. It's hard to tell, but from comparing stills I think this one has slightly less ringing than regular ewa_lanczos.
This commit is contained in:
parent
4356e893a1
commit
885c2fff70
@ -337,7 +337,7 @@ Available video output drivers are:
|
||||
Set radius for filters listed below, must be a float number between 1.0
|
||||
and 16.0. Defaults to be 3.0 if not specified.
|
||||
|
||||
``sinc``, ``lanczos``, ``ewa_lanczos``, ``blackman``, ``gaussian``
|
||||
``sinc``, ``lanczos``, ``ewa_lanczos``, ``ginseng``, ``blackman``, ``gaussian``
|
||||
|
||||
Note that depending on filter implementation details and video scaling
|
||||
ratio, the radius that actually being used might be different
|
||||
|
@ -294,6 +294,16 @@ static double lanczos(kernel *k, double x)
|
||||
return radius * sin(pix) * sin(pix / radius) / (pix * pix);
|
||||
}
|
||||
|
||||
static double ginseng(kernel *k, double x)
|
||||
{
|
||||
double radius = k->radius;
|
||||
if (fabs(x) < 1e-8)
|
||||
return 1.0;
|
||||
if (fabs(x) >= radius)
|
||||
return 0.0;
|
||||
return jinc(k, x) * sinc(k, x / radius);
|
||||
}
|
||||
|
||||
static double ewa_lanczos(kernel *k, double x)
|
||||
{
|
||||
double radius = k->radius;
|
||||
@ -365,6 +375,7 @@ const struct filter_kernel mp_filter_kernels[] = {
|
||||
{"gaussian", -1, gaussian, .params = {28.85390081777927, NAN} },
|
||||
{"sinc", -1, sinc},
|
||||
{"ewa_lanczos", -1, ewa_lanczos, .polar = true},
|
||||
{"ginseng", -1, ginseng, .polar = true},
|
||||
{"lanczos", -1, lanczos},
|
||||
{"blackman", -1, blackman},
|
||||
{0}
|
||||
|
Loading…
Reference in New Issue
Block a user