[babl] Revert "Use absolute error instead of average error for path check"



commit 746a94f7c43ce7ece0c672013fc4a53e05c51d16
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Thu Feb 27 16:25:45 2014 -0800

    Revert "Use absolute error instead of average error for path check"
    
    I would still like to use absolute error in the future because it
    would remove the relationship between the number of zeros in the
    test pixels and the total error score, but we do not seem to be at
    a stage where that is practical yet (bug 725339).
    
    This reverts commit 56be40fbef61fd32672209d38a5e874fea603e82.
    
    Conflicts:
        babl/babl-fish-path.c

 babl/babl-fish-path.c |    6 +++---
 babl/babl-util.c      |   25 +++----------------------
 babl/babl-util.h      |   11 +++--------
 3 files changed, 9 insertions(+), 33 deletions(-)
---
diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c
index 2637cac..3b90edf 100644
--- a/babl/babl-fish-path.c
+++ b/babl/babl-fish-path.c
@@ -675,9 +675,9 @@ get_path_instrumentation (FishPathInstrumentation *fpi,
   babl_process (fpi->fish_destination_to_rgba,
                 fpi->destination, fpi->destination_rgba_double, fpi->num_test_pixels);
 
-  *path_error = babl_abs_error (fpi->destination_rgba_double,
-                                fpi->ref_destination_rgba_double,
-                                fpi->num_test_pixels * 4);
+  *path_error = babl_rel_avg_error (fpi->destination_rgba_double,
+                                    fpi->ref_destination_rgba_double,
+                                    fpi->num_test_pixels * 4);
 
 #if 0
   fpi->fish_rgba_to_source->fish.processings--;
diff --git a/babl/babl-util.c b/babl/babl-util.c
index f99b54b..92977ac 100644
--- a/babl/babl-util.c
+++ b/babl/babl-util.c
@@ -88,28 +88,9 @@ babl_process_cost (long ticks_start,
 }
 
 double
-babl_abs_error (const double *imgA,
-                const double *imgB,
-                long          samples)
-{
-  double abs_error = 0.0;
-  long   i;
-
-  for (i = 0; i < samples; i++)
-    {
-      double sample_error = fabs (imgA[i] - imgB[i]);
-
-      if (sample_error > abs_error)
-        abs_error = sample_error;
-    }
-
-  return abs_error;
-}
-
-double
-babl_rel_avg_error (const double *imgA,
-                    const double *imgB,
-                    long          samples)
+babl_rel_avg_error (double *imgA,
+                    double *imgB,
+                    long    samples)
 {
   double error = 0.0;
   long   i;
diff --git a/babl/babl-util.h b/babl/babl-util.h
index 8c49619..bdaeec8 100644
--- a/babl/babl-util.h
+++ b/babl/babl-util.h
@@ -27,12 +27,7 @@ babl_process_cost (long ticks_start,
                    long ticks_end);
 
 double
-babl_rel_avg_error (const double *imgA,
-                    const double *imgB,
-                    long          samples);
-
-double
-babl_abs_error     (const double *imgA,
-                    const double *imgB,
-                    long          samples);
+babl_rel_avg_error (double *imgA,
+                    double *imgB,
+                    long    samples);
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]