]> granicus.if.org Git - handbrake/commitdiff
libhb: Revise sharpen presets and tunes.
authorBradley Sepos <bradley@bradleysepos.com>
Thu, 1 Jun 2017 20:15:29 +0000 (16:15 -0400)
committerBradley Sepos <bradley@bradleysepos.com>
Thu, 1 Jun 2017 20:15:29 +0000 (16:15 -0400)
Adds verystrong presets to unsharp and lapsharp filters. Adds mediumfine and mediumcoarse tunes to unsharp filter. Fixes some values.

libhb/param.c

index 0e46684e5dd0850e65d012045caef557d30c3f22..af0297748288a86800aa1d61469580eda3e98be0 100644 (file)
@@ -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
         {