summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2017-06-01 16:15:29 -0400
committerBradley Sepos <[email protected]>2017-06-01 16:15:29 -0400
commit822ce4df33f7550078688f86a68460bdfb4d2c90 (patch)
treeca36fac42f76b4179ae3e3e2ed59562544cd4fb8
parentce086e0db9813a093fcb89cd135d5313fdb8d550 (diff)
libhb: Revise sharpen presets and tunes.
Adds verystrong presets to unsharp and lapsharp filters. Adds mediumfine and mediumcoarse tunes to unsharp filter. Fixes some values.
-rw-r--r--libhb/param.c116
1 files changed, 106 insertions, 10 deletions
diff --git a/libhb/param.c b/libhb/param.c
index 0e46684e5..af0297748 100644
--- a/libhb/param.c
+++ b/libhb/param.c
@@ -78,16 +78,19 @@ static hb_filter_param_t unsharp_presets[] =
{ 4, "Medium", "medium", NULL },
{ 5, "Strong", "strong", NULL },
{ 6, "Stronger", "stronger", NULL },
+ { 7, "Very Strong", "verystrong", NULL },
{ 0, NULL, NULL, NULL }
};
static hb_filter_param_t unsharp_tunes[] =
{
- { 0, "None", "none", NULL },
- { 1, "Fine", "fine", NULL },
- { 2, "Medium", "medium", NULL },
- { 3, "Coarse", "coarse", NULL },
- { 0, NULL, NULL, NULL }
+ { 0, "None", "none", NULL },
+ { 1, "Fine", "fine", NULL },
+ { 2, "Medium-Fine", "mediumfine", NULL },
+ { 3, "Medium", "medium", NULL },
+ { 4, "Medium-Coarse", "mediumcoarse", NULL },
+ { 5, "Coarse", "coarse", NULL },
+ { 0, NULL, NULL, NULL }
};
static hb_filter_param_t lapsharp_presets[] =
@@ -98,6 +101,7 @@ static hb_filter_param_t lapsharp_presets[] =
{ 4, "Medium", "medium", NULL },
{ 5, "Strong", "strong", NULL },
{ 6, "Stronger", "stronger", NULL },
+ { 7, "Very Strong", "verystrong", NULL },
{ 0, NULL, NULL, NULL }
};
@@ -472,7 +476,8 @@ static hb_dict_t * generate_unsharp_settings(const char *preset,
!strcasecmp(preset, "light") ||
!strcasecmp(preset, "medium") ||
!strcasecmp(preset, "strong") ||
- !strcasecmp(preset, "stronger"))
+ !strcasecmp(preset, "stronger") ||
+ !strcasecmp(preset, "verystrong"))
{
double strength[2];
int size[2];
@@ -497,6 +502,10 @@ static hb_dict_t * generate_unsharp_settings(const char *preset,
{
strength[0] = strength[1] = 0.8;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = strength[1] = 1.2;
+ }
}
else if (!strcasecmp(tune, "fine"))
{
@@ -516,13 +525,42 @@ static hb_dict_t * generate_unsharp_settings(const char *preset,
}
else if (!strcasecmp(preset, "stronger"))
{
- strength[0] = 0.8; strength[1] = 0.5;
+ strength[0] = 1.2; strength[1] = 0.75;
+ }
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.5; strength[1] = 0.9;
+ }
+ }
+ else if (!strcasecmp(tune, "mediumfine"))
+ {
+ strength[0] = 0.275; strength[1] = 0.165;
+ size[0] = 7; size[1] = 5;
+ if (!strcasecmp(preset, "ultralight"))
+ {
+ strength[0] = 0.055; strength[1] = 0.033;
+ }
+ else if (!strcasecmp(preset, "light"))
+ {
+ strength[0] = 0.165; strength[1] = 0.1;
+ }
+ else if (!strcasecmp(preset, "strong"))
+ {
+ strength[0] = 0.55; strength[1] = 0.33;
+ }
+ else if (!strcasecmp(preset, "stronger"))
+ {
+ strength[0] = 0.9; strength[1] = 0.6;
+ }
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.35; strength[1] = 0.9;
}
}
else if (!strcasecmp(tune, "medium"))
{
strength[0] = 0.275; strength[1] = 0.165;
- size[0] = 7; size[1] = 5;
+ size[0] = 9; size[1] = 7;
if (!strcasecmp(preset, "ultralight"))
{
strength[0] = 0.055; strength[1] = 0.033;
@@ -539,11 +577,40 @@ static hb_dict_t * generate_unsharp_settings(const char *preset,
{
strength[0] = 0.9; strength[1] = 0.6;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.35; strength[1] = 0.9;
+ }
+ }
+ else if (!strcasecmp(tune, "mediumcoarse"))
+ {
+ strength[0] = 0.275; strength[1] = 0.165;
+ size[0] = 11; size[1] = 7;
+ if (!strcasecmp(preset, "ultralight"))
+ {
+ strength[0] = 0.055; strength[1] = 0.033;
+ }
+ else if (!strcasecmp(preset, "light"))
+ {
+ strength[0] = 0.165; strength[1] = 0.1;
+ }
+ else if (!strcasecmp(preset, "strong"))
+ {
+ strength[0] = 0.55; strength[1] = 0.33;
+ }
+ else if (!strcasecmp(preset, "stronger"))
+ {
+ strength[0] = 0.9; strength[1] = 0.6;
+ }
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.35; strength[1] = 0.9;
+ }
}
else if (!strcasecmp(tune, "coarse"))
{
strength[0] = 0.275; strength[1] = 0.165;
- size[0] = 13; size[1] = 9;
+ size[0] = 13; size[1] = 9;
if (!strcasecmp(preset, "ultralight"))
{
strength[0] = 0.055; strength[1] = 0.033;
@@ -560,6 +627,10 @@ static hb_dict_t * generate_unsharp_settings(const char *preset,
{
strength[0] = 0.9; strength[1] = 0.6;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.35; strength[1] = 0.9;
+ }
}
else
{
@@ -603,7 +674,8 @@ static hb_dict_t * generate_lapsharp_settings(const char *preset,
!strcasecmp(preset, "light") ||
!strcasecmp(preset, "medium") ||
!strcasecmp(preset, "strong") ||
- !strcasecmp(preset, "stronger"))
+ !strcasecmp(preset, "stronger") ||
+ !strcasecmp(preset, "verystrong"))
{
double strength[2];
const char *kernel_string[2];
@@ -628,6 +700,10 @@ static hb_dict_t * generate_lapsharp_settings(const char *preset,
{
strength[0] = strength[1] = 0.5;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = strength[1] = 1.1;
+ }
}
else if (!strcasecmp(tune, "film"))
{
@@ -649,6 +725,10 @@ static hb_dict_t * generate_lapsharp_settings(const char *preset,
{
strength[0] = 0.5; strength[1] = 0.3;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.1; strength[1] = 0.65;
+ }
}
else if (!strcasecmp(tune, "grain"))
{
@@ -670,6 +750,10 @@ static hb_dict_t * generate_lapsharp_settings(const char *preset,
{
strength[0] = 0.5; strength[1] = 0.25;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 1.1; strength[1] = 0.55;
+ }
}
else if (!strcasecmp(tune, "animation"))
{
@@ -691,6 +775,10 @@ static hb_dict_t * generate_lapsharp_settings(const char *preset,
{
strength[0] = 0.375; strength[1] = 0.225;
}
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = 0.75; strength[1] = 0.45;
+ }
}
else if (!strcasecmp(tune, "sprite"))
{
@@ -712,6 +800,14 @@ static hb_dict_t * generate_lapsharp_settings(const char *preset,
{
strength[0] = strength[1] = 0.375;
}
+ else if (!strcasecmp(preset, "stronger"))
+ {
+ strength[0] = strength[1] = 0.375;
+ }
+ else if (!strcasecmp(preset, "verystrong"))
+ {
+ strength[0] = strength[1] = 0.75;
+ }
}
else
{