Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filters: add ewa_lanczosradius and missing polar bc-splines #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,19 @@ const struct pl_filter_config pl_filter_ewa_lanczossharp = {
.recommended = PL_FILTER_UPSCALING,
};

const struct pl_filter_config pl_filter_ewa_lanczosradius = {
.name = "ewa_lanczosradius",
.description = "Sharpened Jinc, radius 3",
.kernel = &pl_filter_function_jinc,
.window = &pl_filter_function_jinc,
.radius = 3.0,
// Similar to above, but sharpened to fit the third zero crossing
// at a radius of exactly 3
.blur = 0.92640757661460680516125,
.polar = true,
.allowed = PL_FILTER_SCALING,
};

const struct pl_filter_config pl_filter_ewa_lanczos4sharpest = {
.name = "ewa_lanczos4sharpest",
.description = "Sharpened Jinc-AR, 4 taps",
Expand Down Expand Up @@ -909,6 +922,33 @@ const struct pl_filter_config pl_filter_robidouxsharp = {
.allowed = PL_FILTER_ALL,
};

const struct pl_filter_config pl_filter_ewa_hermite = {
.name = "ewa_hermite",
.description = "EWA Hermite",
.kernel = &pl_filter_function_cubic,
.params = {0.0, 0.0},
.polar = true,
.allowed = PL_FILTER_SCALING,
};

const struct pl_filter_config pl_filter_ewa_mitchell = {
.name = "ewa_mitchell",
.description = "EWA Mitchell-Netravali",
.kernel = &pl_filter_function_cubic,
.params = {1/3.0, 1/3.0},
.polar = true,
.allowed = PL_FILTER_SCALING,
};

const struct pl_filter_config pl_filter_ewa_catmull_rom = {
.name = "ewa_catmull_rom",
.description = "EWA Catmull-Rom",
.kernel = &pl_filter_function_cubic,
.params = {0.0, 0.5},
.polar = true,
.allowed = PL_FILTER_SCALING,
};

const struct pl_filter_config pl_filter_ewa_robidoux = {
.name = "ewa_robidoux",
.description = "EWA Robidoux",
Expand Down Expand Up @@ -948,6 +988,7 @@ const struct pl_filter_config * const pl_filter_configs[] = {
&pl_filter_lanczos,
&pl_filter_ewa_lanczos,
&pl_filter_ewa_lanczossharp,
&pl_filter_ewa_lanczosradius,
&pl_filter_ewa_lanczos4sharpest,
&pl_filter_bicubic,
&filter_cubic, // pseudo-alias (frame mixing only)
Expand All @@ -965,6 +1006,9 @@ const struct pl_filter_config * const pl_filter_configs[] = {
&pl_filter_catmull_rom,
&pl_filter_robidoux,
&pl_filter_robidouxsharp,
&pl_filter_ewa_hermite,
&pl_filter_ewa_mitchell,
&pl_filter_ewa_catmull_rom,
&pl_filter_ewa_robidoux,
&pl_filter_ewa_robidouxsharp,

Expand Down
4 changes: 4 additions & 0 deletions src/filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static inline float pl_filter_radius_bound(const struct pl_filter_config *c)
{"lanczos", &pl_filter_lanczos, "Lanczos"}, \
{"ewa_lanczos", &pl_filter_ewa_lanczos, "Jinc (EWA Lanczos)"}, \
{"ewa_lanczossharp", &pl_filter_ewa_lanczossharp, "Sharpened Jinc"}, \
{"ewa_lanczosradius", &pl_filter_ewa_lanczosradius, "Sharpened Jinc, radius 3"}, \
{"ewa_lanczos4sharpest",&pl_filter_ewa_lanczos4sharpest, "Sharpened Jinc-AR, 4 taps"},\
{"gaussian", &pl_filter_gaussian, "Gaussian"}, \
{"spline16", &pl_filter_spline16, "Spline (2 taps)"}, \
Expand All @@ -50,6 +51,9 @@ static inline float pl_filter_radius_bound(const struct pl_filter_config *c)
{"catmull_rom", &pl_filter_catmull_rom, "Catmull-Rom"}, \
{"robidoux", &pl_filter_robidoux, "Robidoux"}, \
{"robidouxsharp", &pl_filter_robidouxsharp, "RobidouxSharp"}, \
{"ewa_hermite", &pl_filter_ewa_hermite, "EWA Hermite"}, \
{"ewa_mitchell", &pl_filter_ewa_mitchell, "EWA Mitchell"}, \
{"ewa_catmull_rom", &pl_filter_ewa_catmull_rom, "EWA Catmull-Rom"}, \
{"ewa_robidoux", &pl_filter_ewa_robidoux, "EWA Robidoux"}, \
{"ewa_robidouxsharp", &pl_filter_ewa_robidouxsharp, "EWA RobidouxSharp"}, \
\
Expand Down
1 change: 1 addition & 0 deletions src/include/libplacebo/filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ PL_API extern const struct pl_filter_config pl_filter_ginseng; // sinc-jinc
PL_API extern const struct pl_filter_config pl_filter_ewa_jinc; // unwindowed
PL_API extern const struct pl_filter_config pl_filter_ewa_lanczos; // jinc-jinc
PL_API extern const struct pl_filter_config pl_filter_ewa_lanczossharp;
PL_API extern const struct pl_filter_config pl_filter_ewa_lanczosradius;
PL_API extern const struct pl_filter_config pl_filter_ewa_lanczos4sharpest;
PL_API extern const struct pl_filter_config pl_filter_ewa_ginseng; // jinc-sinc
PL_API extern const struct pl_filter_config pl_filter_ewa_hann; // jinc-hann
Expand Down