]> granicus.if.org Git - handbrake/commitdiff
libhb: Better prioritize NLMeans prefilter order.
authorBradley Sepos <bradley@bradleysepos.com>
Tue, 9 Jan 2018 10:10:36 +0000 (05:10 -0500)
committerBradley Sepos <bradley@bradleysepos.com>
Tue, 9 Jan 2018 10:10:36 +0000 (05:10 -0500)
libhb/nlmeans.c

index dd1fe5b3eaeb34386b9b92ab9858ff31bea0e624..2226ee919f4b56c483c7e4cf8a399a2a255a93ec 100644 (file)
@@ -612,7 +612,17 @@ static void nlmeans_prefilter(BorderedPlane *src,
         }
 
         // Filter plane; should already have at least 2px extra border on each side
-        if (filter_type & NLMEANS_PREFILTER_MODE_MEDIAN5X5)
+        if (filter_type & NLMEANS_PREFILTER_MODE_CSM3X3)
+        {
+            // CSM 3x3
+            nlmeans_filter_csm(image, image_pre, w, h, border, 3);
+        }
+        else if (filter_type & NLMEANS_PREFILTER_MODE_CSM5X5)
+        {
+            // CSM 5x5
+            nlmeans_filter_csm(image, image_pre, w, h, border, 5);
+        }
+        else if (filter_type & NLMEANS_PREFILTER_MODE_MEDIAN5X5)
         {
             // Median 5x5
             nlmeans_filter_median(image, image_pre, w, h, border, 5);
@@ -632,16 +642,6 @@ static void nlmeans_prefilter(BorderedPlane *src,
             // Mean 3x3
             nlmeans_filter_mean(image, image_pre, w, h, border, 3);
         }
-        else if (filter_type & NLMEANS_PREFILTER_MODE_CSM3X3)
-        {
-            // CSM 3x3
-            nlmeans_filter_csm(image, image_pre, w, h, border, 3);
-        }
-        else if (filter_type & NLMEANS_PREFILTER_MODE_CSM5X5)
-        {
-            // CSM 5x5
-            nlmeans_filter_csm(image, image_pre, w, h, border, 5);
-        }
 
         // Restore edges
         if (filter_type & NLMEANS_PREFILTER_MODE_EDGEBOOST)