summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2019-03-13 17:36:43 -0400
committerBradley Sepos <[email protected]>2019-03-28 11:57:39 -0400
commit6995834f5ef106a5f67194d16f8b0f041040b448 (patch)
tree9c60bc15982cffa965899251fe8db5146c017e72
parentd416fb7abbb8419ef24f73c43ae0f8af5f18e71c (diff)
libhb: Tweak Chroma Smooth filter presets and tunes.
The initial tunes were too weak.
-rw-r--r--libhb/chroma_smooth.c4
-rw-r--r--libhb/param.c148
2 files changed, 30 insertions, 122 deletions
diff --git a/libhb/chroma_smooth.c b/libhb/chroma_smooth.c
index e27ecaa77..ec1c2ecd9 100644
--- a/libhb/chroma_smooth.c
+++ b/libhb/chroma_smooth.c
@@ -226,8 +226,8 @@ static int chroma_smooth_init(hb_filter_object_t *filter,
}
// Sanitize
- if (ctx->strength < 0) ctx->strength = 0;
- if (ctx->strength > 1.5) ctx->strength = 1.5;
+ if (ctx->strength < 0) ctx->strength = 0;
+ if (ctx->strength > 3) ctx->strength = 3;
if (ctx->size % 2 == 0) ctx->size--;
if (ctx->size < CHROMA_SMOOTH_SIZE_MIN) ctx->size = CHROMA_SMOOTH_SIZE_MIN;
if (ctx->size > CHROMA_SMOOTH_SIZE_MAX) ctx->size = CHROMA_SMOOTH_SIZE_MAX;
diff --git a/libhb/param.c b/libhb/param.c
index c7f9ae052..8c6210720 100644
--- a/libhb/param.c
+++ b/libhb/param.c
@@ -513,155 +513,63 @@ static hb_dict_t * generate_chroma_smooth_settings(const char *preset,
double strength;
int size;
- if (tune == NULL || !strcasecmp(tune, "none"))
+ // Strength
+ if ((tune == NULL || !strcasecmp(tune, "none")) ||
+ (!strcasecmp(tune, "tiny")) ||
+ (!strcasecmp(tune, "small")) ||
+ (!strcasecmp(tune, "medium")) ||
+ (!strcasecmp(tune, "wide")) ||
+ (!strcasecmp(tune, "verywide")))
{
- strength = 0.25;
- size = 7;
+ strength = 1.2;
if (!strcasecmp(preset, "ultralight"))
{
- strength = 0.05;
+ strength = 0.4;
}
else if (!strcasecmp(preset, "light"))
{
- strength = 0.15;
+ strength = 0.8;
}
else if (!strcasecmp(preset, "strong"))
{
- strength = 0.5;
+ strength = 1.6;
}
else if (!strcasecmp(preset, "stronger"))
{
- strength = 0.8;
+ strength = 2.0;
}
else if (!strcasecmp(preset, "verystrong"))
{
- strength = 1.2;
+ strength = 2.4;
}
}
- else if (!strcasecmp(tune, "tiny"))
+ else
{
- strength = 0.4;
- size = 3;
- if (!strcasecmp(preset, "ultralight"))
- {
- strength = 0.15;
- }
- else if (!strcasecmp(preset, "light"))
- {
- strength = 0.25;
- }
- else if (!strcasecmp(preset, "strong"))
- {
- strength = 0.8;
- }
- else if (!strcasecmp(preset, "stronger"))
- {
- strength = 1.2;
- }
- else if (!strcasecmp(preset, "verystrong"))
- {
- strength = 1.5;
- }
+ fprintf(stderr, "Unrecognized chroma smooth tune (%s).\n", tune);
+ return NULL;
+ }
+
+ // Size
+ if (!strcasecmp(tune, "tiny"))
+ {
+ size = 3;
}
else if (!strcasecmp(tune, "small"))
{
- strength = 0.275;
- size = 7;
- if (!strcasecmp(preset, "ultralight"))
- {
- strength = 0.055;
- }
- else if (!strcasecmp(preset, "light"))
- {
- strength = 0.165;
- }
- else if (!strcasecmp(preset, "strong"))
- {
- strength = 0.55;
- }
- else if (!strcasecmp(preset, "stronger"))
- {
- strength = 0.9;
- }
- else if (!strcasecmp(preset, "verystrong"))
- {
- strength = 1.35;
- }
+ size = 5;
}
- else if (!strcasecmp(tune, "medium"))
+ else if ((tune == NULL || !strcasecmp(tune, "none")) ||
+ (!strcasecmp(tune, "medium")))
{
- strength = 0.275;
- size = 9;
- if (!strcasecmp(preset, "ultralight"))
- {
- strength = 0.055;
- }
- else if (!strcasecmp(preset, "light"))
- {
- strength = 0.165;
- }
- else if (!strcasecmp(preset, "strong"))
- {
- strength = 0.55;
- }
- else if (!strcasecmp(preset, "stronger"))
- {
- strength = 0.9;
- }
- else if (!strcasecmp(preset, "verystrong"))
- {
- strength = 1.35;
- }
+ size = 7;
}
else if (!strcasecmp(tune, "wide"))
{
- strength = 0.275;
- size = 11;
- if (!strcasecmp(preset, "ultralight"))
- {
- strength = 0.055;
- }
- else if (!strcasecmp(preset, "light"))
- {
- strength = 0.165;
- }
- else if (!strcasecmp(preset, "strong"))
- {
- strength = 0.55;
- }
- else if (!strcasecmp(preset, "stronger"))
- {
- strength = 0.9;
- }
- else if (!strcasecmp(preset, "verystrong"))
- {
- strength = 1.35;
- }
+ size = 9;
}
else if (!strcasecmp(tune, "verywide"))
{
- strength = 0.275;
- size = 13;
- if (!strcasecmp(preset, "ultralight"))
- {
- strength = 0.055;
- }
- else if (!strcasecmp(preset, "light"))
- {
- strength = 0.165;
- }
- else if (!strcasecmp(preset, "strong"))
- {
- strength = 0.55;
- }
- else if (!strcasecmp(preset, "stronger"))
- {
- strength = 0.9;
- }
- else if (!strcasecmp(preset, "verystrong"))
- {
- strength = 1.35;
- }
+ size = 11;
}
else
{