From 386b7d3366f1359a265da207a9cafa3edf553b64 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Mon, 7 Oct 2019 19:13:39 -0400 Subject: Reorganize and commit all the modified TACLeBench code and run scripts --- baseline/source/susan/ChangeLog.txt | 11 + baseline/source/susan/LICENSE | 14 + baseline/source/susan/input.c | 7292 ++++++++++++++++++++++++++++++++++ baseline/source/susan/math_private.h | 178 + baseline/source/susan/susan.c | 2014 ++++++++++ baseline/source/susan/wccfile.c | 79 + baseline/source/susan/wccfile.h | 24 + baseline/source/susan/wcclibm.c | 444 +++ baseline/source/susan/wcclibm.h | 53 + baseline/source/susan/wccmalloc.c | 51 + baseline/source/susan/wccmalloc.h | 10 + 11 files changed, 10170 insertions(+) create mode 100644 baseline/source/susan/ChangeLog.txt create mode 100644 baseline/source/susan/LICENSE create mode 100644 baseline/source/susan/input.c create mode 100644 baseline/source/susan/math_private.h create mode 100644 baseline/source/susan/susan.c create mode 100644 baseline/source/susan/wccfile.c create mode 100644 baseline/source/susan/wccfile.h create mode 100644 baseline/source/susan/wcclibm.c create mode 100644 baseline/source/susan/wcclibm.h create mode 100644 baseline/source/susan/wccmalloc.c create mode 100644 baseline/source/susan/wccmalloc.h (limited to 'baseline/source/susan') diff --git a/baseline/source/susan/ChangeLog.txt b/baseline/source/susan/ChangeLog.txt new file mode 100644 index 0000000..bb603df --- /dev/null +++ b/baseline/source/susan/ChangeLog.txt @@ -0,0 +1,11 @@ +2017-07-04 + - Removed self-assignment to avoid clangs self-assign warning. + - Introduced susan_initm susan_main and susan_return. + - Fix possible division by zero to please tacle-lint. + - Removed unused variables. + - Added prefix 'susan_'. + - Removed exit_on_error function. + - Removed PowerPC specific typedef. + +2017-08-18: + - Give explicit name to former anonymous struct to silence g++ warnings. diff --git a/baseline/source/susan/LICENSE b/baseline/source/susan/LICENSE new file mode 100644 index 0000000..18d5124 --- /dev/null +++ b/baseline/source/susan/LICENSE @@ -0,0 +1,14 @@ +This code is issued for research purposes only and remains the +property of the UK Secretary of State for Defence. This code must +not be passed on without this header information being kept +intact. This code must not be sold. + +A UK patent has been granted: "Method for digitally processing +images to determine the position of edges and/or corners therein for +guidance of unmanned vehicle", UK Patent 2272285. Proprietor: +Secretary of State for Defence, UK. 15 January 1997 + + +Source Code obtained from: + +http://www.fmrib.ox.ac.uk/~steve/susan/index.html diff --git a/baseline/source/susan/input.c b/baseline/source/susan/input.c new file mode 100644 index 0000000..4e6ba40 --- /dev/null +++ b/baseline/source/susan/input.c @@ -0,0 +1,7292 @@ +char susan_input[7292] = { 80, +53, +10, +35, +32, +67, +82, +69, +65, +84, +79, +82, +58, +32, +88, +86, +32, +86, +101, +114, +115, +105, +111, +110, +32, +51, +46, +49, +48, +97, +32, +32, +82, +101, +118, +58, +32, +49, +50, +47, +50, +57, +47, +57, +52, +32, +40, +80, +78, +71, +32, +112, +97, +116, +99, +104, +32, +49, +46, +50, +41, +10, +55, +54, +32, +57, +53, +10, +50, +53, +53, +10, +35, +36, +36, +36, +36, +38, +38, +36, +37, +37, +37, +38, +38, +36, +34, +38, +40, +41, +42, +40, +38, +36, +36, +35, +36, +35, +32, +35, +38, +42, +42, +38, +36, +36, +36, +37, +36, +35, +33, +33, +33, +32, +31, +33, +36, +39, +40, +36, +36, +34, +34, +36, +38, +39, +37, +36, +36, +35, +36, +39, +39, +37, +37, +39, +37, +38, +39, +40, +38, +37, +37, +33, +33, +32, +33, +34, +35, +35, +36, +36, +36, +37, +38, +37, +38, +38, +39, +41, +41, +40, +40, +43, +42, +41, +40, +39, +38, +35, +33, +35, +35, +37, +39, +38, +37, +36, +38, +36, +36, +34, +34, +38, +39, +39, +37, +36, +36, +34, +33, +34, +33, +35, +33, +36, +35, +35, +36, +36, +37, +33, +32, +36, +38, +38, +38, +39, +39, +38, +39, +37, +35, +36, +34, +35, +36, +37, +39, +38, +37, +34, +31, +34, +35, +35, +35, +35, +36, +38, +39, +39, +37, +38, +38, +40, +39, +40, +41, +43, +44, +42, +40, +39, +38, +42, +42, +39, +39, +36, +33, +33, +34, +36, +36, +35, +33, +33, +35, +37, +36, +34, +34, +31, +30, +32, +36, +42, +43, +43, +40, +36, +36, +36, +35, +34, +35, +33, +33, +30, +32, +34, +35, +35, +35, +36, +35, +37, +34, +34, +35, +36, +37, +37, +35, +36, +37, +39, +39, +38, +35, +35, +35, +35, +35, +36, +38, +37, +38, +38, +36, +35, +35, +36, +35, +35, +35, +35, +34, +34, +36, +36, +38, +40, +38, +37, +36, +34, +34, +35, +35, +36, +37, +37, +38, +38, +39, +39, +36, +35, +36, +35, +37, +36, +38, +39, +37, +38, +34, +33, +32, +33, +32, +28, +34, +40, +45, +44, +40, +38, +34, +30, +30, +33, +40, +45, +43, +41, +37, +37, +37, +36, +33, +31, +32, +31, +35, +35, +35, +35, +35, +38, +39, +39, +40, +39, +37, +37, +37, +35, +35, +37, +37, +36, +37, +37, +37, +38, +37, +38, +37, +37, +35, +35, +34, +35, +35, +35, +36, +39, +45, +43, +38, +39, +38, +36, +36, +36, +35, +37, +39, +38, +37, +37, +37, +39, +38, +37, +37, +35, +34, +34, +37, +39, +36, +37, +38, +39, +40, +41, +39, +36, +38, +39, +39, +39, +36, +33, +32, +30, +30, +31, +35, +35, +35, +35, +35, +39, +40, +38, +37, +40, +39, +38, +39, +39, +39, +38, +39, +39, +40, +40, +39, +41, +39, +41, +39, +38, +39, +38, +38, +36, +35, +36, +35, +37, +38, +38, +38, +40, +38, +39, +39, +36, +36, +33, +34, +36, +35, +37, +38, +39, +39, +38, +36, +32, +32, +35, +38, +38, +39, +38, +35, +35, +34, +37, +39, +38, +36, +35, +35, +33, +31, +30, +32, +36, +37, +38, +35, +35, +35, +35, +35, +39, +41, +42, +38, +33, +31, +33, +37, +36, +37, +38, +37, +37, +38, +39, +38, +38, +38, +38, +37, +38, +38, +39, +41, +41, +37, +39, +40, +42, +44, +43, +39, +42, +48, +45, +41, +39, +38, +38, +38, +38, +36, +37, +38, +39, +39, +39, +43, +41, +38, +37, +37, +38, +36, +34, +34, +34, +38, +41, +41, +38, +35, +35, +34, +35, +32, +30, +31, +33, +34, +35, +35, +35, +35, +35, +35, +39, +36, +35, +38, +41, +38, +32, +34, +38, +34, +38, +40, +39, +39, +36, +36, +39, +38, +39, +37, +38, +38, +36, +36, +35, +37, +38, +39, +38, +36, +38, +37, +35, +31, +35, +37, +40, +39, +35, +35, +36, +34, +36, +36, +38, +37, +38, +37, +37, +36, +37, +38, +37, +36, +35, +34, +34, +34, +37, +36, +37, +36, +34, +36, +36, +34, +31, +30, +33, +32, +33, +35, +35, +35, +35, +34, +27, +33, +39, +42, +41, +42, +44, +45, +42, +39, +41, +41, +42, +43, +42, +41, +40, +38, +37, +35, +37, +36, +36, +36, +37, +36, +36, +37, +37, +39, +43, +43, +43, +42, +39, +39, +39, +39, +40, +39, +38, +35, +34, +36, +37, +36, +37, +38, +38, +37, +36, +35, +35, +33, +35, +38, +38, +39, +41, +39, +38, +37, +38, +38, +36, +37, +36, +37, +37, +36, +36, +35, +35, +35, +35, +36, +42, +40, +41, +43, +42, +39, +37, +37, +37, +37, +39, +39, +38, +37, +35, +37, +36, +35, +36, +36, +39, +39, +36, +36, +34, +37, +40, +40, +40, +39, +41, +40, +39, +39, +39, +40, +38, +36, +34, +35, +37, +34, +36, +35, +35, +34, +33, +36, +36, +38, +39, +38, +37, +34, +34, +33, +34, +35, +36, +36, +35, +36, +35, +38, +39, +39, +40, +38, +37, +36, +36, +35, +35, +35, +35, +36, +36, +42, +45, +44, +43, +40, +38, +37, +36, +37, +37, +38, +38, +38, +38, +36, +35, +35, +34, +34, +36, +38, +36, +35, +38, +37, +37, +38, +38, +37, +38, +36, +33, +35, +37, +37, +38, +38, +41, +41, +41, +38, +35, +33, +30, +29, +32, +37, +39, +39, +38, +39, +38, +35, +34, +35, +35, +35, +35, +34, +35, +36, +36, +37, +38, +38, +38, +36, +35, +33, +34, +35, +35, +35, +35, +36, +36, +32, +33, +36, +38, +40, +42, +42, +39, +40, +41, +43, +42, +36, +33, +32, +33, +32, +35, +37, +41, +41, +39, +40, +37, +36, +38, +39, +41, +40, +40, +41, +39, +37, +37, +36, +37, +37, +36, +35, +37, +37, +39, +41, +41, +43, +41, +40, +40, +37, +37, +38, +38, +38, +38, +38, +36, +38, +37, +36, +39, +41, +41, +42, +41, +39, +38, +38, +36, +37, +37, +35, +35, +35, +36, +36, +33, +35, +37, +34, +35, +35, +35, +39, +38, +39, +41, +43, +43, +43, +42, +39, +38, +39, +37, +37, +38, +37, +36, +38, +38, +40, +38, +39, +39, +36, +35, +34, +33, +34, +36, +37, +38, +37, +37, +37, +36, +34, +34, +33, +34, +35, +38, +41, +38, +36, +37, +37, +37, +37, +39, +41, +40, +41, +42, +41, +40, +41, +41, +39, +40, +40, +39, +37, +37, +36, +38, +35, +35, +35, +36, +37, +45, +42, +40, +44, +45, +42, +43, +42, +42, +45, +47, +49, +51, +50, +51, +50, +49, +45, +45, +45, +43, +42, +42, +43, +41, +39, +40, +40, +40, +39, +38, +40, +40, +39, +39, +39, +38, +35, +33, +37, +41, +42, +39, +37, +37, +37, +38, +38, +36, +37, +35, +33, +32, +33, +34, +35, +35, +38, +39, +37, +38, +36, +35, +37, +38, +39, +42, +41, +38, +36, +34, +35, +35, +35, +35, +36, +39, +38, +36, +37, +37, +37, +36, +40, +42, +43, +47, +49, +48, +47, +44, +43, +47, +52, +55, +52, +47, +44, +42, +42, +42, +40, +40, +39, +38, +37, +37, +39, +38, +38, +38, +36, +33, +31, +34, +35, +38, +39, +38, +37, +38, +38, +37, +38, +37, +42, +46, +45, +42, +39, +39, +38, +34, +36, +39, +39, +37, +35, +36, +34, +37, +37, +36, +36, +39, +41, +42, +35, +35, +35, +35, +36, +40, +40, +38, +39, +39, +36, +36, +38, +39, +42, +46, +49, +50, +52, +52, +51, +51, +52, +54, +51, +50, +51, +52, +51, +47, +47, +46, +47, +45, +43, +43, +43, +43, +43, +42, +41, +41, +40, +40, +42, +46, +44, +41, +37, +36, +37, +39, +39, +38, +38, +39, +38, +38, +39, +37, +35, +35, +38, +38, +38, +36, +35, +35, +37, +35, +36, +38, +36, +38, +38, +39, +35, +35, +35, +36, +36, +39, +39, +40, +40, +39, +37, +38, +41, +39, +43, +46, +47, +49, +49, +49, +48, +48, +51, +52, +52, +53, +53, +52, +51, +52, +50, +48, +49, +48, +46, +47, +47, +44, +42, +43, +44, +43, +45, +48, +46, +45, +44, +42, +43, +46, +45, +44, +42, +41, +38, +39, +38, +37, +36, +35, +37, +35, +37, +36, +33, +31, +32, +38, +43, +42, +41, +39, +37, +38, +37, +37, +35, +35, +36, +36, +36, +38, +38, +36, +37, +39, +38, +39, +38, +39, +42, +47, +49, +46, +46, +47, +47, +46, +47, +49, +48, +48, +49, +51, +50, +49, +50, +51, +48, +46, +46, +47, +48, +47, +45, +43, +42, +44, +45, +47, +49, +51, +51, +51, +49, +47, +48, +47, +49, +46, +44, +40, +39, +40, +40, +39, +38, +40, +38, +39, +40, +39, +37, +36, +35, +33, +35, +34, +32, +33, +34, +38, +35, +36, +36, +36, +36, +35, +36, +38, +36, +37, +37, +37, +38, +38, +39, +43, +46, +51, +52, +50, +50, +48, +50, +49, +49, +50, +48, +50, +50, +49, +49, +51, +54, +54, +51, +51, +49, +47, +48, +52, +53, +51, +49, +46, +46, +43, +46, +45, +47, +50, +49, +47, +47, +46, +45, +48, +48, +45, +43, +44, +43, +43, +42, +41, +39, +39, +39, +37, +37, +34, +34, +32, +33, +35, +36, +39, +35, +36, +36, +36, +36, +40, +39, +36, +36, +35, +34, +33, +32, +37, +43, +51, +56, +54, +55, +56, +55, +52, +50, +49, +46, +46, +45, +47, +49, +51, +54, +54, +51, +49, +50, +50, +48, +47, +45, +46, +47, +50, +50, +48, +43, +42, +42, +43, +45, +47, +47, +48, +50, +49, +47, +47, +48, +49, +47, +48, +48, +47, +47, +45, +44, +42, +39, +38, +38, +38, +42, +41, +41, +39, +36, +35, +35, +35, +36, +36, +36, +34, +37, +37, +35, +36, +36, +35, +36, +37, +38, +41, +50, +67, +82, +84, +80, +80, +76, +75, +74, +71, +64, +61, +58, +54, +53, +54, +56, +56, +53, +51, +51, +49, +47, +49, +49, +48, +48, +47, +47, +48, +48, +47, +45, +46, +47, +46, +46, +45, +41, +42, +44, +44, +45, +45, +48, +47, +44, +42, +37, +35, +34, +32, +33, +37, +40, +37, +37, +36, +36, +37, +35, +35, +36, +36, +36, +37, +35, +37, +37, +37, +35, +35, +35, +37, +40, +41, +46, +58, +85, +119, +-119, +-123, +123, +115, +109, +110, +109, +107, +102, +95, +93, +88, +86, +86, +86, +86, +83, +77, +68, +64, +59, +58, +61, +61, +61, +58, +56, +51, +49, +51, +51, +50, +50, +45, +37, +41, +47, +50, +50, +53, +52, +49, +48, +45, +43, +42, +39, +38, +36, +38, +39, +39, +39, +38, +37, +36, +35, +35, +35, +36, +36, +34, +36, +36, +38, +39, +38, +37, +39, +41, +43, +47, +56, +79, +121, +-106, +-110, +-108, +-99, +-102, +-100, +-99, +-101, +-103, +-102, +-106, +-108, +-110, +-111, +-111, +-115, +-117, +-120, +-123, +-123, +-125, +-128, +127, +124, +118, +114, +119, +113, +104, +99, +100, +100, +97, +89, +83, +79, +76, +73, +69, +60, +52, +48, +47, +45, +46, +40, +37, +38, +38, +42, +45, +43, +42, +42, +39, +38, +39, +35, +35, +36, +36, +36, +37, +37, +40, +42, +42, +40, +39, +38, +40, +43, +49, +60, +83, +126, +-105, +-98, +-93, +-97, +-94, +-93, +-90, +-88, +-91, +-94, +-91, +-90, +-93, +-94, +-94, +-96, +-94, +-94, +-96, +-95, +-93, +-96, +-100, +-104, +-104, +-105, +-108, +-110, +-115, +-119, +-120, +-122, +-125, +127, +122, +118, +115, +118, +113, +97, +78, +59, +45, +48, +46, +40, +38, +38, +37, +38, +38, +35, +37, +37, +34, +32, +32, +35, +36, +36, +36, +36, +38, +39, +38, +37, +38, +35, +34, +36, +35, +37, +41, +51, +77, +120, +-100, +-91, +-96, +-95, +-93, +-92, +-89, +-90, +-92, +-92, +-93, +-93, +-91, +-90, +-91, +-94, +-94, +-94, +-93, +-92, +-93, +-95, +-95, +-93, +-94, +-94, +-91, +-92, +-94, +-93, +-91, +-92, +-91, +-92, +-96, +-97, +-99, +-105, +-112, +126, +95, +63, +43, +47, +42, +38, +38, +36, +36, +36, +38, +37, +37, +37, +36, +37, +38, +35, +36, +36, +36, +36, +39, +39, +39, +41, +38, +33, +35, +37, +39, +45, +51, +58, +80, +121, +-104, +-94, +-93, +-92, +-94, +-94, +-91, +-89, +-89, +-88, +-86, +-86, +-88, +-87, +-88, +-90, +-90, +-91, +-91, +-89, +-87, +-90, +-92, +-92, +-90, +-91, +-91, +-89, +-89, +-90, +-92, +-93, +-91, +-90, +-91, +-90, +-91, +-91, +-100, +-128, +88, +54, +44, +47, +48, +46, +43, +41, +36, +37, +40, +38, +40, +38, +38, +37, +39, +35, +36, +36, +36, +36, +38, +41, +39, +37, +35, +32, +34, +36, +38, +42, +47, +57, +82, +118, +-105, +-88, +-86, +-84, +-88, +-91, +-91, +-91, +-92, +-91, +-89, +-90, +-89, +-87, +-88, +-88, +-89, +-89, +-91, +-91, +-91, +-92, +-93, +-92, +-93, +-97, +-93, +-93, +-93, +-92, +-92, +-94, +-94, +-92, +-94, +-94, +-91, +-91, +-98, +-122, +96, +63, +53, +49, +44, +42, +42, +41, +38, +36, +37, +36, +37, +38, +39, +38, +40, +35, +36, +36, +36, +36, +34, +36, +35, +37, +39, +40, +43, +41, +41, +44, +48, +56, +83, +-127, +-99, +-89, +-88, +-87, +-88, +-89, +-87, +-89, +-90, +-90, +-89, +-91, +-91, +-89, +-87, +-88, +-87, +-89, +-88, +-89, +-88, +-90, +-89, +-87, +-88, +-92, +-91, +-88, +-89, +-88, +-87, +-89, +-91, +-93, +-95, +-97, +-94, +-93, +-99, +-125, +91, +59, +45, +45, +47, +43, +42, +39, +36, +36, +36, +40, +38, +39, +39, +37, +36, +36, +36, +36, +36, +36, +34, +37, +38, +39, +40, +43, +43, +43, +43, +40, +43, +56, +87, +-127, +-100, +-94, +-95, +-91, +-88, +-90, +-89, +-90, +-92, +-88, +-88, +-90, +-88, +-90, +-90, +-89, +-89, +-91, +-91, +-92, +-92, +-91, +-90, +-89, +-89, +-92, +-90, +-90, +-92, +-91, +-89, +-90, +-91, +-91, +-95, +-94, +-92, +-93, +-99, +-124, +92, +61, +48, +47, +49, +45, +44, +41, +38, +37, +37, +38, +34, +35, +35, +35, +35, +36, +36, +36, +36, +36, +40, +39, +36, +34, +35, +35, +37, +37, +40, +49, +56, +62, +89, +-124, +-99, +-93, +-88, +-88, +-92, +-90, +-87, +-88, +-89, +-87, +-88, +-89, +-88, +-87, +-88, +-89, +-89, +-87, +-88, +-88, +-87, +-89, +-92, +-91, +-92, +-92, +-91, +-91, +-90, +-89, +-89, +-89, +-90, +-92, +-93, +-91, +-87, +-86, +-96, +-127, +90, +60, +45, +44, +43, +36, +36, +37, +39, +38, +40, +40, +37, +36, +36, +33, +35, +36, +36, +36, +36, +36, +34, +34, +34, +33, +34, +34, +35, +37, +40, +42, +41, +50, +80, +-127, +-96, +-92, +-89, +-85, +-88, +-91, +-88, +-88, +-89, +-87, +-90, +-90, +-89, +-89, +-90, +-91, +-90, +-89, +-87, +-86, +-87, +-89, +-90, +-91, +-93, +-93, +-93, +-91, +-91, +-90, +-90, +-91, +-92, +-91, +-92, +-89, +-87, +-88, +-96, +-123, +96, +65, +48, +47, +45, +38, +37, +37, +37, +37, +39, +39, +37, +38, +36, +35, +35, +36, +36, +36, +36, +36, +40, +41, +40, +41, +42, +42, +41, +39, +39, +45, +53, +66, +100, +-111, +-86, +-86, +-87, +-80, +-86, +-92, +-88, +-86, +-87, +-84, +-83, +-86, +-86, +-85, +-85, +-86, +-84, +-84, +-88, +-90, +-87, +-88, +-88, +-88, +-88, +-90, +-89, +-89, +-89, +-89, +-89, +-88, +-87, +-88, +-90, +-87, +-88, +-90, +-98, +-127, +93, +69, +50, +50, +51, +43, +44, +43, +41, +37, +37, +40, +38, +38, +37, +36, +38, +36, +36, +36, +36, +36, +36, +38, +39, +40, +39, +40, +39, +42, +46, +49, +52, +62, +90, +-123, +-101, +-100, +-98, +-94, +-90, +-88, +-87, +-89, +-90, +-89, +-88, +-88, +-87, +-86, +-87, +-86, +-86, +-87, +-85, +-85, +-88, +-89, +-88, +-89, +-88, +-89, +-90, +-89, +-90, +-90, +-91, +-90, +-89, +-91, +-91, +-91, +-90, +-92, +-99, +-126, +93, +61, +45, +49, +48, +43, +41, +38, +37, +36, +38, +38, +37, +36, +35, +35, +39, +36, +36, +36, +36, +37, +41, +42, +40, +41, +41, +38, +40, +42, +42, +45, +50, +61, +91, +-121, +-94, +-93, +-96, +-94, +-94, +-93, +-91, +-91, +-93, +-90, +-88, +-92, +-90, +-87, +-87, +-89, +-88, +-87, +-89, +-89, +-90, +-93, +-96, +-94, +-91, +-89, +-88, +-88, +-90, +-90, +-89, +-91, +-92, +-93, +-91, +-91, +-92, +-91, +-101, +122, +84, +60, +48, +52, +46, +34, +36, +36, +37, +34, +34, +37, +34, +32, +33, +34, +37, +36, +36, +36, +37, +37, +36, +39, +39, +41, +40, +41, +40, +39, +42, +44, +49, +62, +92, +-124, +-96, +-84, +-81, +-86, +-87, +-89, +-90, +-91, +-92, +-90, +-88, +-89, +-91, +-90, +-89, +-89, +-89, +-90, +-89, +-86, +-88, +-89, +-89, +-90, +-88, +-90, +-91, +-91, +-92, +-92, +-92, +-91, +-91, +-93, +-95, +-94, +-93, +-93, +-101, +125, +86, +61, +47, +47, +49, +45, +44, +44, +43, +44, +45, +44, +42, +41, +38, +35, +38, +37, +37, +37, +37, +37, +39, +40, +40, +42, +44, +42, +43, +47, +45, +44, +50, +66, +99, +-111, +-93, +-97, +-96, +-92, +-89, +-89, +-89, +-87, +-88, +-86, +-87, +-90, +-88, +-88, +-88, +-87, +-87, +-88, +-91, +-93, +-91, +-92, +-89, +-86, +-84, +-83, +-83, +-87, +-90, +-91, +-90, +-91, +-92, +-93, +-94, +-97, +-96, +-97, +-107, +119, +79, +53, +39, +39, +38, +37, +40, +38, +38, +37, +38, +40, +41, +39, +38, +36, +36, +37, +37, +37, +37, +37, +40, +39, +40, +40, +40, +40, +38, +39, +43, +44, +48, +59, +95, +-121, +-103, +-96, +-95, +-97, +-94, +-92, +-90, +-90, +-90, +-88, +-85, +-88, +-89, +-88, +-89, +-91, +-92, +-92, +-91, +-90, +-88, +-88, +-88, +-90, +-91, +-92, +-91, +-89, +-93, +-93, +-92, +-92, +-91, +-93, +-94, +-94, +-94, +-93, +-105, +118, +79, +52, +38, +36, +40, +41, +41, +42, +39, +38, +40, +40, +39, +39, +39, +37, +38, +37, +37, +37, +37, +37, +41, +42, +40, +41, +43, +43, +45, +43, +42, +43, +47, +62, +95, +-120, +-93, +-92, +-96, +-92, +-94, +-92, +-91, +-88, +-88, +-89, +-90, +-91, +-88, +-88, +-89, +-88, +-91, +-93, +-92, +-91, +-90, +-89, +-90, +-89, +-91, +-90, +-90, +-94, +-95, +-95, +-94, +-91, +-87, +-83, +-87, +-88, +-89, +-94, +-106, +117, +79, +60, +51, +45, +40, +37, +38, +38, +36, +34, +33, +34, +34, +33, +35, +37, +36, +37, +37, +37, +37, +37, +36, +40, +38, +39, +40, +41, +38, +40, +43, +48, +52, +62, +96, +-120, +-103, +-99, +-94, +-95, +-93, +-92, +-90, +-89, +-90, +-91, +-90, +-92, +-95, +-95, +-94, +-94, +-92, +-92, +-93, +-93, +-92, +-91, +-90, +-92, +-94, +-93, +-92, +-89, +-91, +-89, +-87, +-88, +-91, +-97, +-98, +-95, +-94, +-94, +-104, +123, +86, +61, +48, +46, +47, +40, +38, +37, +34, +36, +35, +39, +41, +40, +39, +37, +37, +37, +37, +37, +37, +37, +39, +39, +40, +39, +40, +42, +41, +40, +43, +42, +43, +52, +85, +125, +-106, +-92, +-98, +-96, +-84, +-82, +-87, +-86, +-85, +-86, +-86, +-90, +-88, +-88, +-87, +-87, +-92, +-93, +-93, +-93, +-90, +-91, +-92, +-89, +-89, +-89, +-89, +-91, +-91, +-93, +-93, +-94, +-93, +-92, +-94, +-94, +-91, +-92, +-100, +123, +79, +57, +47, +45, +47, +40, +37, +36, +35, +38, +37, +39, +40, +38, +39, +36, +35, +37, +37, +37, +37, +37, +41, +38, +33, +31, +37, +44, +44, +44, +46, +48, +52, +64, +96, +-117, +-98, +-103, +-99, +-97, +-96, +-97, +-97, +-94, +-89, +-85, +-90, +-91, +-89, +-89, +-89, +-88, +-87, +-86, +-90, +-92, +-91, +-93, +-91, +-92, +-92, +-91, +-93, +-92, +-92, +-92, +-91, +-94, +-94, +-94, +-95, +-93, +-98, +-102, +-110, +117, +83, +55, +40, +46, +48, +44, +42, +39, +40, +37, +39, +40, +38, +38, +38, +39, +42, +37, +37, +37, +37, +38, +39, +40, +41, +41, +41, +41, +40, +42, +46, +47, +52, +65, +102, +-114, +-102, +-97, +-100, +-95, +-83, +-88, +-91, +-89, +-91, +-91, +-89, +-89, +-88, +-90, +-89, +-88, +-88, +-88, +-89, +-92, +-90, +-90, +-90, +-90, +-92, +-94, +-95, +-94, +-93, +-92, +-90, +-90, +-92, +-92, +-94, +-92, +-92, +-96, +-108, +116, +76, +57, +50, +47, +42, +38, +41, +42, +41, +37, +36, +37, +36, +36, +37, +35, +35, +37, +37, +37, +37, +38, +39, +40, +41, +39, +41, +40, +36, +34, +37, +39, +42, +61, +100, +-113, +-90, +-97, +-96, +-90, +-87, +-88, +-90, +-91, +-93, +-89, +-91, +-91, +-90, +-90, +-91, +-91, +-89, +-87, +-90, +-91, +-89, +-90, +-89, +-90, +-90, +-92, +-92, +-92, +-91, +-91, +-89, +-90, +-92, +-90, +-92, +-93, +-93, +-96, +-107, +119, +81, +48, +37, +40, +44, +45, +41, +40, +38, +36, +37, +38, +37, +37, +37, +36, +35, +37, +37, +37, +37, +39, +47, +50, +45, +40, +41, +40, +41, +42, +44, +48, +53, +64, +98, +-116, +-95, +-96, +-97, +-87, +-83, +-87, +-87, +-88, +-87, +-86, +-86, +-87, +-91, +-95, +-94, +-92, +-88, +-89, +-90, +-90, +-88, +-87, +-88, +-90, +-94, +-92, +-93, +-91, +-89, +-89, +-87, +-86, +-87, +-90, +-92, +-92, +-91, +-92, +-100, +125, +79, +52, +51, +54, +50, +47, +47, +47, +46, +45, +46, +44, +40, +36, +34, +34, +34, +37, +37, +37, +37, +38, +41, +42, +42, +39, +39, +37, +35, +39, +46, +52, +53, +68, +101, +-119, +-101, +-101, +-101, +-93, +-90, +-89, +-88, +-88, +-88, +-85, +-89, +-90, +-89, +-91, +-93, +-92, +-90, +-90, +-90, +-91, +-91, +-90, +-91, +-93, +-91, +-92, +-92, +-89, +-90, +-91, +-92, +-95, +-95, +-94, +-95, +-95, +-96, +-97, +-110, +116, +81, +54, +48, +52, +51, +49, +45, +47, +46, +43, +44, +43, +38, +35, +35, +34, +36, +37, +37, +37, +37, +39, +43, +43, +41, +40, +42, +41, +41, +40, +40, +44, +50, +68, +106, +-112, +-93, +-93, +-95, +-92, +-94, +-93, +-90, +-89, +-90, +-88, +-90, +-89, +-88, +-89, +-89, +-89, +-86, +-88, +-91, +-92, +-92, +-91, +-92, +-91, +-91, +-92, +-91, +-92, +-90, +-90, +-91, +-88, +-87, +-90, +-92, +-91, +-91, +-92, +-104, +121, +80, +54, +43, +45, +46, +41, +41, +40, +38, +38, +38, +37, +37, +37, +37, +39, +40, +37, +37, +37, +37, +37, +39, +39, +40, +38, +40, +41, +40, +41, +43, +46, +52, +69, +105, +-112, +-92, +-95, +-94, +-90, +-94, +-94, +-92, +-91, +-90, +-91, +-90, +-90, +-90, +-90, +-89, +-88, +-89, +-90, +-90, +-93, +-94, +-93, +-92, +-91, +-91, +-92, +-94, +-91, +-91, +-89, +-89, +-93, +-95, +-96, +-97, +-96, +-96, +-96, +-106, +121, +86, +54, +47, +53, +50, +48, +43, +40, +39, +37, +40, +40, +38, +38, +36, +37, +37, +37, +37, +37, +37, +37, +39, +38, +38, +38, +38, +37, +37, +39, +41, +42, +45, +62, +104, +-112, +-93, +-87, +-91, +-92, +-92, +-91, +-89, +-91, +-89, +-90, +-88, +-86, +-88, +-90, +-91, +-91, +-90, +-91, +-91, +-91, +-90, +-89, +-90, +-89, +-90, +-93, +-91, +-92, +-92, +-91, +-92, +-91, +-91, +-94, +-94, +-92, +-93, +-92, +-103, +124, +92, +65, +49, +47, +45, +39, +40, +40, +40, +37, +37, +37, +37, +41, +41, +38, +38, +37, +37, +37, +37, +38, +46, +42, +42, +40, +41, +41, +37, +39, +43, +49, +59, +78, +112, +-105, +-88, +-94, +-93, +-96, +-95, +-92, +-90, +-88, +-90, +-91, +-90, +-88, +-89, +-90, +-89, +-90, +-91, +-90, +-91, +-93, +-93, +-92, +-92, +-91, +-91, +-90, +-92, +-92, +-92, +-93, +-92, +-92, +-92, +-94, +-94, +-94, +-94, +-93, +-107, +116, +77, +48, +43, +47, +43, +41, +40, +39, +38, +38, +42, +40, +38, +37, +34, +34, +34, +36, +37, +37, +37, +37, +41, +41, +38, +38, +39, +40, +39, +39, +40, +40, +45, +63, +102, +-117, +-98, +-92, +-88, +-87, +-91, +-90, +-89, +-90, +-91, +-93, +-90, +-83, +-85, +-87, +-88, +-90, +-91, +-93, +-92, +-93, +-91, +-89, +-89, +-89, +-91, +-94, +-92, +-91, +-90, +-92, +-92, +-92, +-93, +-91, +-89, +-90, +-89, +-87, +-99, +126, +86, +54, +43, +45, +46, +42, +40, +38, +36, +34, +34, +36, +34, +35, +34, +35, +36, +36, +37, +37, +37, +38, +43, +40, +38, +38, +40, +41, +40, +41, +41, +42, +50, +74, +113, +-113, +-98, +-95, +-88, +-88, +-90, +-91, +-90, +-90, +-92, +-91, +-88, +-86, +-87, +-86, +-86, +-89, +-91, +-92, +-92, +-91, +-88, +-90, +-93, +-95, +-97, +-97, +-95, +-94, +-93, +-92, +-92, +-92, +-93, +-94, +-94, +-96, +-95, +-96, +-111, +111, +73, +42, +39, +50, +45, +41, +40, +38, +38, +39, +41, +38, +35, +35, +33, +30, +28, +36, +37, +37, +37, +37, +37, +40, +38, +40, +41, +41, +43, +42, +40, +42, +49, +74, +119, +-100, +-88, +-94, +-93, +-90, +-94, +-94, +-91, +-89, +-89, +-90, +-89, +-88, +-93, +-94, +-91, +-89, +-87, +-90, +-96, +-98, +-96, +-94, +-94, +-92, +-92, +-92, +-89, +-88, +-89, +-91, +-90, +-89, +-88, +-86, +-87, +-90, +-93, +-95, +-110, +113, +79, +59, +52, +43, +38, +38, +38, +41, +41, +39, +41, +42, +41, +40, +40, +40, +39, +37, +37, +37, +37, +37, +39, +38, +40, +40, +42, +40, +41, +43, +47, +50, +53, +74, +112, +-114, +-99, +-95, +-92, +-94, +-95, +-95, +-92, +-90, +-91, +-88, +-85, +-89, +-88, +-87, +-88, +-89, +-89, +-91, +-91, +-90, +-88, +-91, +-94, +-93, +-93, +-93, +-94, +-93, +-91, +-90, +-90, +-92, +-93, +-94, +-92, +-94, +-94, +-95, +-110, +113, +78, +52, +46, +49, +45, +43, +42, +43, +41, +39, +41, +40, +38, +38, +35, +37, +39, +37, +37, +37, +37, +37, +35, +38, +38, +41, +42, +39, +42, +43, +44, +46, +55, +80, +119, +-108, +-99, +-95, +-91, +-90, +-95, +-95, +-92, +-90, +-94, +-94, +-89, +-88, +-92, +-91, +-91, +-93, +-93, +-93, +-93, +-91, +-89, +-90, +-93, +-91, +-89, +-88, +-89, +-88, +-89, +-92, +-93, +-93, +-93, +-92, +-92, +-95, +-95, +-97, +-113, +108, +67, +48, +46, +41, +41, +42, +39, +39, +37, +36, +38, +38, +36, +37, +39, +38, +39, +37, +37, +37, +37, +36, +32, +34, +36, +38, +38, +38, +38, +41, +42, +44, +50, +67, +115, +-98, +-89, +-94, +-93, +-87, +-86, +-91, +-90, +-92, +-93, +-92, +-89, +-91, +-92, +-90, +-92, +-92, +-91, +-90, +-90, +-89, +-87, +-90, +-93, +-92, +-92, +-95, +-94, +-94, +-93, +-91, +-92, +-94, +-95, +-96, +-93, +-93, +-92, +-95, +-112, +107, +73, +56, +45, +45, +44, +41, +41, +39, +38, +37, +39, +39, +37, +38, +37, +39, +41, +37, +37, +37, +37, +37, +40, +39, +41, +42, +42, +39, +39, +43, +47, +49, +56, +76, +112, +-112, +-102, +-90, +-78, +-88, +-93, +-92, +-92, +-90, +-89, +-91, +-88, +-86, +-90, +-88, +-87, +-89, +-91, +-90, +-90, +-89, +-90, +-90, +-88, +-90, +-89, +-89, +-89, +-87, +-90, +-91, +-90, +-90, +-88, +-90, +-92, +-93, +-93, +-97, +-112, +108, +71, +52, +48, +51, +48, +45, +40, +40, +41, +42, +42, +41, +39, +41, +42, +39, +37, +37, +37, +37, +37, +37, +38, +39, +40, +40, +40, +40, +42, +45, +46, +45, +51, +72, +121, +-98, +-99, +-100, +-95, +-93, +-96, +-95, +-93, +-90, +-90, +-87, +-89, +-89, +-90, +-89, +-90, +-90, +-89, +-92, +-94, +-90, +-91, +-91, +-91, +-90, +-89, +-90, +-88, +-90, +-92, +-91, +-92, +-93, +-94, +-96, +-94, +-94, +-95, +-97, +-113, +106, +71, +52, +48, +46, +45, +45, +41, +37, +33, +33, +35, +35, +37, +38, +37, +36, +35, +37, +37, +37, +37, +37, +37, +37, +38, +39, +39, +39, +40, +42, +40, +42, +50, +73, +114, +-107, +-96, +-100, +-97, +-100, +-103, +-101, +-97, +-92, +-89, +-89, +-87, +-85, +-88, +-89, +-87, +-87, +-88, +-88, +-89, +-91, +-92, +-89, +-86, +-86, +-84, +-86, +-86, +-90, +-94, +-94, +-93, +-93, +-94, +-94, +-93, +-92, +-94, +-99, +-115, +106, +72, +60, +59, +57, +55, +48, +42, +39, +37, +37, +39, +37, +37, +38, +37, +35, +33, +37, +37, +37, +37, +38, +45, +43, +42, +39, +36, +35, +34, +38, +40, +42, +50, +76, +115, +-110, +-97, +-89, +-88, +-92, +-95, +-94, +-91, +-90, +-88, +-86, +-87, +-88, +-87, +-86, +-88, +-88, +-88, +-91, +-90, +-89, +-90, +-89, +-89, +-91, +-90, +-91, +-90, +-91, +-93, +-93, +-93, +-95, +-97, +-96, +-92, +-94, +-97, +-100, +-118, +106, +72, +54, +50, +48, +47, +46, +44, +40, +36, +38, +40, +42, +41, +40, +38, +36, +38, +37, +37, +37, +37, +37, +39, +41, +41, +41, +40, +41, +45, +47, +47, +46, +53, +77, +119, +-102, +-90, +-94, +-89, +-88, +-94, +-90, +-87, +-86, +-85, +-87, +-87, +-85, +-86, +-86, +-87, +-88, +-90, +-90, +-91, +-91, +-91, +-93, +-91, +-91, +-92, +-93, +-93, +-92, +-94, +-93, +-90, +-91, +-92, +-92, +-91, +-94, +-96, +-95, +-105, +114, +74, +57, +51, +50, +53, +47, +42, +39, +37, +41, +46, +46, +43, +40, +35, +31, +29, +37, +37, +37, +37, +38, +39, +37, +38, +39, +40, +41, +40, +43, +46, +48, +57, +89, +-126, +-102, +-97, +-96, +-93, +-96, +-92, +-89, +-89, +-91, +-94, +-90, +-91, +-90, +-88, +-88, +-90, +-90, +-90, +-92, +-93, +-93, +-92, +-90, +-89, +-90, +-89, +-91, +-93, +-91, +-92, +-93, +-92, +-94, +-95, +-92, +-92, +-95, +-99, +-100, +-116, +103, +70, +54, +52, +54, +49, +46, +43, +40, +36, +35, +39, +41, +37, +38, +38, +38, +37, +37, +37, +37, +38, +38, +42, +43, +41, +41, +41, +45, +45, +44, +44, +46, +56, +86, +119, +-113, +-96, +-91, +-78, +-83, +-90, +-90, +-90, +-89, +-91, +-92, +-92, +-90, +-88, +-89, +-91, +-91, +-90, +-89, +-89, +-88, +-88, +-90, +-90, +-92, +-92, +-92, +-90, +-90, +-94, +-93, +-91, +-91, +-92, +-94, +-91, +-90, +-95, +-100, +-121, +91, +58, +49, +49, +47, +45, +44, +44, +43, +41, +40, +40, +37, +35, +35, +36, +35, +34, +37, +37, +38, +38, +38, +42, +38, +37, +38, +37, +37, +40, +45, +45, +44, +54, +84, +123, +-106, +-96, +-95, +-96, +-99, +-97, +-96, +-92, +-91, +-92, +-91, +-92, +-95, +-94, +-93, +-92, +-91, +-89, +-91, +-92, +-91, +-91, +-92, +-94, +-92, +-88, +-89, +-91, +-91, +-93, +-94, +-92, +-93, +-92, +-93, +-92, +-94, +-95, +-97, +-118, +95, +55, +33, +34, +37, +37, +34, +33, +33, +31, +34, +36, +36, +34, +35, +36, +37, +38, +37, +37, +38, +38, +38, +40, +40, +42, +43, +43, +41, +41, +40, +43, +43, +50, +77, +116, +-110, +-84, +-81, +-87, +-91, +-94, +-91, +-88, +-88, +-89, +-88, +-88, +-88, +-85, +-88, +-89, +-88, +-88, +-89, +-92, +-91, +-93, +-92, +-92, +-94, +-94, +-93, +-93, +-94, +-96, +-95, +-91, +-89, +-88, +-91, +-92, +-94, +-98, +-100, +-122, +91, +57, +43, +46, +41, +33, +36, +36, +38, +39, +39, +38, +33, +33, +34, +34, +34, +35, +37, +38, +38, +38, +39, +44, +43, +44, +45, +44, +40, +40, +42, +40, +46, +60, +93, +-127, +-103, +-88, +-87, +-94, +-93, +-96, +-97, +-94, +-89, +-90, +-89, +-88, +-90, +-90, +-91, +-92, +-90, +-90, +-91, +-93, +-94, +-94, +-94, +-94, +-93, +-91, +-94, +-96, +-95, +-98, +-97, +-94, +-94, +-95, +-99, +-98, +-95, +-95, +-101, +-121, +95, +58, +42, +39, +44, +44, +39, +37, +41, +42, +41, +41, +37, +33, +33, +32, +33, +33, +37, +38, +38, +38, +38, +39, +41, +44, +44, +47, +46, +44, +41, +39, +40, +52, +85, +127, +-102, +-88, +-82, +-87, +-92, +-94, +-91, +-90, +-91, +-92, +-91, +-89, +-91, +-92, +-91, +-89, +-87, +-86, +-89, +-91, +-92, +-93, +-93, +-92, +-95, +-98, +-95, +-90, +-87, +-90, +-92, +-93, +-94, +-98, +-99, +-97, +-97, +-96, +-98, +-114, +106, +65, +40, +42, +41, +39, +41, +41, +43, +46, +45, +43, +40, +38, +39, +40, +40, +39, +37, +38, +38, +38, +38, +34, +37, +39, +42, +42, +41, +42, +41, +42, +44, +58, +88, +124, +-109, +-98, +-95, +-96, +-97, +-95, +-95, +-95, +-96, +-94, +-91, +-90, +-92, +-91, +-90, +-90, +-89, +-87, +-89, +-92, +-94, +-95, +-96, +-95, +-94, +-94, +-97, +-98, +-97, +-97, +-96, +-95, +-96, +-95, +-98, +-99, +-98, +-97, +-100, +-121, +90, +52, +37, +36, +39, +41, +39, +39, +40, +38, +35, +33, +34, +35, +34, +36, +36, +35, +37, +38, +38, +38, +38, +40, +39, +40, +39, +40, +44, +46, +49, +53, +53, +53, +73, +108, +-114, +-96, +-96, +-99, +-100, +-99, +-96, +-94, +-95, +-93, +-89, +-84, +-88, +-91, +-91, +-93, +-97, +-97, +-98, +-97, +-93, +-92, +-92, +-92, +-95, +-95, +-94, +-92, +-91, +-94, +-96, +-96, +-94, +-94, +-94, +-92, +-93, +-94, +-96, +-115, +103, +64, +36, +38, +45, +42, +44, +41, +41, +41, +37, +38, +42, +45, +46, +43, +39, +33, +37, +38, +38, +38, +38, +42, +42, +38, +36, +35, +34, +36, +40, +39, +39, +49, +82, +-123, +-95, +-91, +-87, +-89, +-93, +-94, +-95, +-94, +-95, +-94, +-91, +-92, +-93, +-92, +-92, +-94, +-95, +-95, +-96, +-94, +-94, +-94, +-93, +-94, +-92, +-90, +-92, +-90, +-91, +-93, +-92, +-92, +-91, +-91, +-93, +-93, +-93, +-93, +-98, +-122, +90, +54, +40, +40, +41, +40, +38, +36, +36, +36, +39, +42, +43, +41, +38, +38, +36, +36, +37, +38, +38, +38, +38, +41, +40, +37, +36, +38, +42, +42, +41, +44, +41, +48, +73, +116, +-103, +-88, +-87, +-92, +-96, +-95, +-93, +-91, +-87, +-85, +-88, +-85, +-89, +-93, +-91, +-88, +-87, +-85, +-87, +-89, +-91, +-93, +-92, +-92, +-92, +-91, +-94, +-90, +-91, +-93, +-93, +-94, +-92, +-92, +-95, +-93, +-92, +-93, +-96, +-116, +104, +66, +40, +39, +37, +39, +42, +43, +43, +40, +38, +37, +36, +36, +34, +34, +35, +35, +37, +38, +38, +38, +38, +41, +41, +38, +37, +36, +35, +37, +42, +44, +46, +58, +91, +-120, +-98, +-99, +-94, +-89, +-93, +-92, +-92, +-93, +-93, +-93, +-91, +-89, +-88, +-85, +-86, +-88, +-89, +-87, +-89, +-88, +-90, +-94, +-93, +-94, +-94, +-91, +-90, +-86, +-90, +-94, +-94, +-96, +-95, +-95, +-94, +-93, +-92, +-91, +-97, +-123, +91, +58, +48, +52, +48, +44, +43, +43, +41, +36, +38, +42, +43, +39, +37, +34, +31, +32, +37, +38, +38, +38, +38, +41, +40, +37, +41, +42, +41, +43, +41, +39, +45, +60, +92, +-123, +-102, +-102, +-99, +-99, +-97, +-92, +-93, +-93, +-94, +-94, +-96, +-93, +-89, +-92, +-91, +-90, +-89, +-90, +-88, +-90, +-90, +-91, +-92, +-92, +-92, +-92, +-94, +-90, +-90, +-90, +-91, +-91, +-91, +-93, +-94, +-91, +-92, +-95, +-103, +-127, +92, +59, +49, +56, +53, +55, +51, +50, +48, +43, +39, +36, +35, +35, +34, +33, +34, +37, +37, +38, +38, +38, +38, +38, +39, +38, +40, +41, +40, +42, +45, +45, +47, +64, +100, +-118, +-104, +-102, +-93, +-95, +-92, +-96, +-97, +-96, +-96, +-94, +-92, +-89, +-90, +-93, +-93, +-96, +-97, +-94, +-96, +-96, +-97, +-98, +-97, +-96, +-94, +-94, +-95, +-92, +-95, +-94, +-94, +-95, +-94, +-95, +-96, +-95, +-94, +-94, +-97, +-118, +102, +70, +53, +53, +55, +52, +54, +52, +47, +41, +38, +39, +40, +36, +37, +37, +35, +36, +37, +38, +38, +38, +38, +40, +39, +40, +41, +39, +33, +33, +36, +40, +51, +64, +84, +125, +-102, +-87, +-81, +-92, +-98, +-101, +-98, +-97, +-95, +-95, +-95, +-94, +-94, +-98, +-97, +-94, +-93, +-93, +-93, +-92, +-91, +-92, +-93, +-93, +-93, +-93, +-95, +-94, +-94, +-96, +-94, +-91, +-91, +-95, +-94, +-95, +-98, +-98, +-102, +-119, +101, +71, +55, +47, +47, +48, +51, +52, +45, +38, +34, +30, +34, +34, +32, +34, +34, +37, +37, +37, +38, +38, +38, +41, +42, +41, +39, +41, +39, +37, +37, +37, +44, +66, +105, +-118, +-105, +-107, +-106, +-102, +-101, +-102, +-100, +-101, +-101, +-99, +-98, +-96, +-96, +-98, +-94, +-94, +-95, +-94, +-96, +-97, +-97, +-96, +-96, +-95, +-96, +-94, +-96, +-99, +-95, +-96, +-98, +-100, +-98, +-97, +-97, +-94, +-93, +-97, +-107, +123, +83, +54, +41, +45, +48, +45, +46, +44, +43, +40, +36, +39, +36, +37, +38, +40, +41, +40, +37, +37, +38, +38, +38, +40, +40, +43, +43, +41, +40, +42, +42, +40, +44, +61, +90, +121, +-122, +-121, +-117, +-113, +-111, +-108, +-104, +-104, +-105, +-106, +-106, +-102, +-103, +-106, +-106, +-107, +-106, +-106, +-104, +-103, +-101, +-100, +-99, +-98, +-99, +-100, +-101, +-98, +-95, +-94, +-94, +-93, +-95, +-95, +-97, +-97, +-98, +-97, +-97, +-115, +98, +58, +40, +42, +46, +46, +47, +48, +45, +43, +42, +40, +39, +36, +34, +35, +36, +38, +37, +37, +37, +38, +38, +37, +41, +41, +42, +43, +40, +41, +40, +40, +42, +51, +68, +78, +81, +81, +81, +85, +85, +87, +88, +89, +93, +96, +97, +100, +98, +101, +105, +109, +110, +113, +116, +116, +117, +118, +119, +120, +121, +126, +-126, +-126, +-123, +-120, +-118, +-117, +-115, +-114, +-113, +-110, +-106, +-108, +-115, +117, +81, +52, +40, +42, +47, +48, +48, +45, +42, +38, +34, +37, +34, +36, +37, +39, +39, +38, +37, +37, +37, +38, +38, +38, +37, +39, +41, +39, +42, +42, +40, +41, +43, +53, +69, +71, +66, +65, +61, +57, +57, +58, +60, +62, +65, +64, +68, +76, +71, +67, +68, +69, +75, +82, +87, +85, +85, +86, +87, +92, +94, +94, +96, +90, +91, +95, +101, +109, +109, +114, +115, +119, +123, +121, +117, +104, +77, +50, +37, +32, +30, +24, +27, +35, +39, +39, +36, +38, +36, +37, +36, +34, +33, +32, +37, +37, +37, +37, +38, +37, +41, +40, +41, +43, +41, +39, +38, +40, +43, +49, +53, +52, +50, +50, +51, +51, +52, +54, +49, +46, +50, +48, +47, +51, +51, +50, +48, +50, +50, +50, +50, +50, +51, +51, +52, +52, +56, +57, +58, +59, +57, +56, +56, +55, +52, +53, +56, +59, +60, +61, +62, +59, +54, +54, +51, +47, +50, +47, +45, +44, +43, +40, +37, +37, +37, +39, +43, +45, +43, +39, +36, +37, +37, +37, +39, +46, +41, +38, +40, +40, +39, +40, +40, +38, +43, +49, +54, +54, +52, +52, +49, +47, +47, +50, +48, +49, +52, +49, +50, +51, +48, +48, +49, +49, +49, +51, +50, +46, +46, +50, +49, +52, +52, +47, +48, +51, +52, +48, +50, +52, +47, +45, +46, +45, +48, +49, +50, +48, +44, +45, +48, +50, +47, +43, +44, +44, +44, +43, +43, +43, +41, +41, +41, +38, +36, +36, +36, +37, +37, +37, +37, +41, +41, +39, +38, +38, +36, +36, +37, +39, +44, +48, +50, +50, +50, +52, +52, +52, +52, +53, +50, +46, +46, +46, +42, +43, +46, +45, +44, +46, +46, +45, +43, +45, +46, +50, +51, +50, +51, +50, +49, +51, +51, +50, +51, +50, +49, +47, +49, +49, +50, +52, +50, +48, +45, +46, +47, +47, +48, +47, +45, +44, +45, +42, +38, +37, +35, +31, +29, +31, +33, +35, +36, +36, +37, +37, +37, +39, +39, +40, +41, +42, +39, +37, +37, +36, +40, +44, +48, +47, +45, +46, +49, +49, +49, +50, +47, +48, +49, +48, +45, +47, +47, +49, +51, +53, +51, +49, +48, +46, +44, +44, +43, +44, +46, +48, +49, +51, +51, +50, +49, +49, +48, +50, +54, +56, +49, +44, +43, +44, +44, +45, +45, +44, +45, +42, +40, +41, +42, +41, +38, +36, +37, +41, +46, +43, +40, +37, +36, +36, +37, +37, +37, +40, +41, +40, +39, +39, +36, +35, +37, +38, +41, +43, +45, +46, +46, +46, +47, +45, +41, +45, +46, +47, +48, +47, +45, +44, +45, +47, +46, +46, +46, +45, +46, +45, +43, +44, +44, +46, +51, +51, +47, +49, +46, +44, +43, +39, +39, +42, +46, +46, +46, +44, +43, +42, +42, +44, +44, +46, +46, +47, +45, +40, +37, +33, +35, +40, +45, +42, +42, +42, +38, +36, +36, +36, +36, +37, +38, +42, +42, +40, +39, +38, +38, +39, +40, +39, +38, +40, +40, +38, +37, +38, +40, +40, +38, +39, +39, +40, +39, +36, +34, +37, +40, +40, +41, +40, +38, +35, +36, +40, +39, +38, +36, +36, +37, +39, +40, +40, +40, +41, +42, +42, +42, +42, +40, +41, +41, +42, +45, +45, +42, +42, +40, +42, +46, +46, +44, +43, +41, +39, +37, +40, +41, +37, +35, +32, +30, +31, +36, +36, +36, +36, +37, +40, +40, +40, +39, +39, +38, +39, +41, +42, +40, +42, +42, +41, +38, +38, +42, +39, +37, +39, +37, +34, +35, +36, +39, +39, +41, +41, +39, +39, +36, +35, +35, +37, +41, +45, +48, +47, +48, +45, +42, +44, +41, +41, +42, +43, +42, +41, +40, +39, +37, +37, +37, +38, +38, +40, +41, +42, +40, +41, +40, +39, +40, +38, +37, +39, +41, +40, +37, +35, +32, +33, +36, +36, +36, +36, +36, +38, +39, +38, +37, +38, +37, +37, +40, +39, +43, +48, +48, +44, +39, +38, +40, +41, +41, +41, +42, +42, +39, +36, +35, +35, +34, +35, +36, +38, +38, +37, +39, +38, +36, +36, +37, +39, +40, +40, +38, +38, +37, +35, +36, +33, +34, +37, +36, +39, +39, +38, +37, +33, +30, +32, +33, +33, +35, +36, +36, +36, +37, +35, +37, +39, +40, +36, +35, +37, +36, +35, +36, +36, +36, +36, +35, +31, +34, +35, +37, +38, +37, +36, +39, +42, +41, +41, +40, +38, +36, +37, +38, +39, +40, +40, +37, +34, +34, +35, +37, +37, +39, +39, +38, +40, +39, +41, +43, +43, +43, +40, +39, +41, +41, +39, +35, +33, +34, +33, +36, +38, +40, +40, +39, +40, +37, +39, +37, +34, +33, +34, +35, +35, +35, +35, +33, +35, +34, +33, +34, +36, +37, +36, +35, +35, +34, +35, +36, +36, +36, +36, +36, +38, +39, +40, +40, +42, +41, +40, +43, +42, +39, +38, +35, +35, +34, +35, +37, +37, +37, +37, +38, +37, +35, +34, +36, +39, +40, +39, +40, +41, +40, +36, +37, +38, +34, +35, +36, +37, +39, +40, +37, +37, +37, +34, +34, +35, +35, +37, +37, +38, +39, +42, +44, +42, +40, +41, +40, +38, +35, +34, +34, +36, +36, +37, +39, +38, +40, +40, +38, +36, +33, +31, +36, +36, +36, +36, +36, +36, +36, +39, +41, +42, +41, +40, +38, +38, +37, +37, +41, +40, +39, +39, +37, +39, +38, +39, +37, +35, +35, +35, +36, +39, +38, +38, +38, +38, +39, +39, +39, +38, +38, +39, +40, +41, +41, +41, +38, +38, +37, +37, +36, +38, +40, +39, +37, +35, +37, +35, +33, +34, +35, +38, +36, +36, +38, +34, +33, +35, +36, +35, +37, +39, +38, +38, +38, +37, +34, +31, +36, +36, +36, +36, +36, +37, +41, +41, +39, +40, +39, +40, +41, +42, +40, +35, +35, +36, +34, +36, +38, +38, +39, +39, +39, +39, +38, +37, +38, +38, +36, +34, +35, +40, +44, +43, +46, +47, +40, +35, +36, +36, +37, +37, +35, +36, +37, +35, +36, +38, +38, +39, +39, +39, +40, +40, +38, +33, +32, +35, +36, +35, +32, +31, +32, +34, +34, +35, +38, +39, +38, +37, +35, +36, +36, +33, +36, +36, +36, +36, +36, +35, +31, +33, +36, +36, +37, +37, +37, +38, +38, +39, +41, +39, +36, +36, +36, +35, +37, +34, +34, +32, +32, +34, +35, +39, +38, +38, +39, +38, +38, +38, +38, +36, +33, +34, +33, +34, +34, +37, +40, +40, +40, +37, +35, +37, +38, +37, +35, +35, +36, +37, +38, +41, +43, +42, +37, +36, +40, +39, +41, +43, +41, +36, +32, +33, +36, +37, +40, +39, +36, +33, +36, +36, +36, +36, +37, +42, +42, +39, +35, +35, +35, +37, +37, +38, +39, +38, +40, +40, +39, +44, +44, +39, +40, +40, +42, +44, +42, +38, +38, +36, +35, +35, +35, +38, +38, +35, +33, +36, +35, +35, +37, +38, +39, +38, +38, +38, +37, +36, +33, +33, +33, +34, +37, +38, +39, +40, +36, +31, +33, +36, +34, +37, +35, +34, +36, +37, +38, +38, +37, +37, +35, +33, +35, +39, +36, +34, +36, +36, +36, +36, +36, +36, +35, +36, +36, +37, +35, +37, +38, +38, +40, +41, +42, +40, +41, +44, +42, +42, +40, +38, +39, +37, +36, +35, +35, +34, +33, +34, +35, +36, +36, +38, +37, +37, +36, +34, +36, +39, +40, +39, +38, +39, +37, +37, +36, +39, +40, +39, +39, +35, +37, +37, +36, +40, +41, +40, +37, +35, +36, +36, +37, +35, +35, +34, +32, +36, +34, +32, +31, +30, +31, +33, +36, +36, +36, +36, +37, +37, +37, +36, +35, +38, +39, +41, +40, +35, +36, +35, +35, +34, +34, +38, +38, +39, +40, +36, +35, +36, +35, +36, +36, +38, +36, +39, +41, +42, +41, +41, +40, +41, +41, +39, +38, +36, +37, +37, +35, +37, +40, +39, +37, +37, +37, +38, +39, +43, +44, +41, +39, +39, +42, +40, +36, +38, +34, +33, +36, +37, +41, +41, +41, +41, +41, +40, +40, +44, +41, +38, +36, +36, +36, +37, +37, +38, +39, +39, +38, +38, +37, +40, +40, +37, +38, +38, +37, +36, +36, +36, +35, +39, +39, +38, +41, +38, +37, +38, +39, +41, +40, +40, +41, +41, +41, +40, +37, +39, +40, +40, +39, +39, +36, +35, +35, +35, +35, +35, +34, +36, +35, +37, +40, +40, +40, +38, +36, +36, +35, +37, +36, +37, +38, +38, +38, +37, +37, +34, +31, +33, +32, +33, +33, +33, +35, +36}; diff --git a/baseline/source/susan/math_private.h b/baseline/source/susan/math_private.h new file mode 100644 index 0000000..58d4354 --- /dev/null +++ b/baseline/source/susan/math_private.h @@ -0,0 +1,178 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * from: @(#)fdlibm.h 5.1 93/09/24 + */ + +#ifndef _MATH_PRIVATE_H_ +#define _MATH_PRIVATE_H_ + +#include "wcclibm.h" + +//#include +//#include + +/* A representation of a double as a union. */ +union ieee754_double +{ + double d; + + /* This is the IEEE 754 double-precision format. */ + struct { + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:20; + unsigned int exponent:11; + unsigned int negative:1; + } ieee; + + /* This format makes it easier to see if a NaN is a signalling NaN. */ + struct { + /* Together these comprise the mantissa. */ + unsigned int mantissa1:32; + unsigned int mantissa0:19; + unsigned int quiet_nan:1; + unsigned int exponent:11; + unsigned int negative:1; + } ieee_nan; +}; + +/* The original fdlibm code used statements like: + n0 = ((*(int*)&one)>>29)^1; * index of high word * + ix0 = *(n0+(int*)&x); * high word of x * + ix1 = *((1-n0)+(int*)&x); * low word of x * + to dig two 32 bit words out of the 64 bit IEEE floating point + value. That is non-ANSI, and, moreover, the gcc instruction + scheduler gets it wrong. We instead use the following macros. + Unlike the original code, we determine the endianness at compile + time, not at run time; I don't see much benefit to selecting + endianness at run time. */ + +/* A union which permits us to convert between a double and two 32 bit + ints. */ + +/* #if __FLOAT_WORD_ORDER == BIG_ENDIAN */ +/* #warning USING Big Endian float word order */ +/* typedef union */ +/* { */ +/* double value; */ +/* struct */ +/* { */ +/* u_int16_t msw; */ +/* u_int16_t lsw; */ +/* } parts; */ +/* } ieeeDoubleShapeType; */ + +/* #endif */ + +/* #if __FLOAT_WORD_ORDER == LITTLE_ENDIAN */ +/* #warning USING Little Endian float word order */ + +typedef union +{ + double value; + struct + { + u_int16_t lsw; + u_int16_t msw; + } parts; +} ieeeDoubleShapeType; + +/* #endif */ + +/* Get two 32 bit ints from a double. */ + +#define EXTRACT_WORDS(ix0,ix1,d) \ +{ \ + ieeeDoubleShapeType ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ +} + +/* Get the more significant 32 bit int from a double. */ + +#define GET_HIGH_WORD(i,d) \ +{ \ + ieeeDoubleShapeType gh_u; \ + gh_u.value = (d); \ + (i) = gh_u.parts.msw; \ +} + +/* Get the less significant 32 bit int from a double. */ + +#define GET_LOW_WORD(i,d) \ +{ \ + ieeeDoubleShapeType gl_u; \ + gl_u.value = (d); \ + (i) = gl_u.parts.lsw; \ +} + +/* Set a double from two 32 bit ints. */ + +#define INSERT_WORDS(d,ix0,ix1) \ +{ \ + ieeeDoubleShapeType iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ +} + +/* Set the more significant 32 bits of a double from an int. */ + +#define SET_HIGH_WORD(d,v) \ +{ \ + ieeeDoubleShapeType sh_u; \ + sh_u.value = (d); \ + sh_u.parts.msw = (v); \ + (d) = sh_u.value; \ +} + +/* Set the less significant 32 bits of a double from an int. */ + +#define SET_LOW_WORD(d,v) \ +{ \ + ieeeDoubleShapeType sl_u; \ + sl_u.value = (d); \ + sl_u.parts.lsw = (v); \ + (d) = sl_u.value; \ +} + +/* A union which permits us to convert between a float and a 32 bit + int. */ + +typedef union +{ + float value; + u_int32_t word; +} ieee_float_shape_type; + +/* Get a 32 bit int from a float. */ + +#define GET_FLOAT_WORD(i,d) \ +{ \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = gf_u.word; \ +} + +/* Set a float from a 32 bit int. */ + +#define SET_FLOAT_WORD(d,i) \ +{ \ + ieee_float_shape_type sf_u; \ + sf_u.word = (i); \ + (d) = sf_u.value; \ +} + + +#endif /* _MATH_PRIVATE_H_ */ diff --git a/baseline/source/susan/susan.c b/baseline/source/susan/susan.c new file mode 100644 index 0000000..fb990b1 --- /dev/null +++ b/baseline/source/susan/susan.c @@ -0,0 +1,2014 @@ +/**********************************************************************\ + + SUSAN Version 2l by Stephen Smith + Oxford Centre for Functional Magnetic Resonance Imaging of the Brain, + Department of Clinical Neurology, Oxford University, Oxford, UK + (Previously in Computer Vision and Image Processing Group - now + Computer Vision and Electro Optics Group - DERA Chertsey, UK) + Email: steve@fmrib.ox.ac.uk + WWW: http://www.fmrib.ox.ac.uk/~steve + + (C) Crown Copyright (1995-1999), Defence Evaluation and Research Agency, + Farnborough, Hampshire, GU14 6TD, UK + DERA WWW site: + http://www.dera.gov.uk/ + DERA Computer Vision and Electro Optics Group WWW site: + http://www.dera.gov.uk/imageprocessing/dera/group_home.html + DERA Computer Vision and Electro Optics Group point of contact: + Dr. John Savage, jtsavage@dera.gov.uk, +44 1344 633203 + + A UK patent has been granted: "Method for digitally processing + images to determine the position of edges and/or corners therein for + guidance of unmanned vehicle", UK Patent 2272285. Proprietor: + Secretary of State for Defence, UK. 15 January 1997 + + This code is issued for research purposes only and remains the + property of the UK Secretary of State for Defence. This code must + not be passed on without this header information being kept + intact. This code must not be sold. + +\**********************************************************************/ + +/**********************************************************************\ + + SUSAN Version 2l + SUSAN = Smallest Univalue Segment Assimilating Nucleus + + Email: steve@fmrib.ox.ac.uk + WWW: http://www.fmrib.ox.ac.uk/~steve + + Related paper: + @article{Smith97, + author = "Smith, S.M. and Brady, J.M.", + title = "{SUSAN} - A New Approach to Low Level Image Processing", + journal = "Int. Journal of Computer Vision", + pages = "45--78", + volume = "23", + number = "1", + month = "May", + year = 1997} + + To be registered for automatic (bug) updates of SUSAN, send an email. + + Compile with: + gcc -O4 -o susan susan2l.c -lm + + See following section for different machine information. Please + report any bugs (and fixes). There are a few optional changes that + can be made in the "defines" section which follows shortly. + + Usage: type "susan" to get usage. Only PGM format files can be input + and output. Utilities such as the netpbm package and XV can be used + to convert to and from other formats. Any size of image can be + processed. + + This code is written using an emacs folding mode, making moving + around the different sections very easy. This is why there are + various marks within comments and why comments are indented. + + + SUSAN QUICK: + + This version of the SUSAN corner finder does not do all the + false-corner suppression and thus is faster and produced some false + positives, particularly on strong edges. However, because there are + less stages involving thresholds etc., the corners that are + correctly reported are usually more stable than those reported with + the full algorithm. Thus I recommend at least TRYING this algorithm + for applications where stability is important, e.g., tracking. + + THRESHOLDS: + + There are two thresholds which can be set at run-time. These are the + brightness threshold (t) and the distance threshold (d). + + SPATIAL CONTROL: d + + In SUSAN smoothing d controls the size of the Gaussian mask; its + default is 4.0. Increasing d gives more smoothing. In edge finding, + a fixed flat mask is used, either 37 pixels arranged in a "circle" + (default), or a 3 by 3 mask which gives finer detail. In corner + finding, only the larger 37 pixel mask is used; d is not + variable. In smoothing, the flat 3 by 3 mask can be used instead of + a larger Gaussian mask; this gives low smoothing and fast operation. + + BRIGHTNESS CONTROL: t + + In all three algorithms, t can be varied (default=20); this is the + main threshold to be varied. It determines the maximum difference in + greylevels between two pixels which allows them to be considered + part of the same "region" in the image. Thus it can be reduced to + give more edges or corners, i.e. to be more sensitive, and vice + versa. In smoothing, reducing t gives less smoothing, and vice + versa. Set t=10 for the test image available from the SUSAN web + page. + + ITERATIONS: + + With SUSAN smoothing, more smoothing can also be obtained by + iterating the algorithm several times. This has a different effect + from varying d or t. + + FIXED MASKS: + + 37 pixel mask: ooo 3 by 3 mask: ooo + ooooo ooo + ooooooo ooo + ooooooo + ooooooo + ooooo + ooo + + CORNER ATTRIBUTES dx, dy and I + (Only read this if you are interested in the C implementation or in + using corner attributes, e.g., for corner matching) + + Corners reported in the corner list have attributes associated with + them as well as positions. This is useful, for example, when + attempting to match corners from one image to another, as these + attributes can often be fairly unchanged between images. The + attributes are dx, dy and I. I is the value of image brightness at + the position of the corner. In the case of susan_corners_quick, dx + and dy are the first order derivatives (differentials) of the image + brightness in the x and y directions respectively, at the position + of the corner. In the case of normal susan corner finding, dx and dy + are scaled versions of the position of the centre of gravity of the + USAN with respect to the centre pixel (nucleus). + + BRIGHTNESS FUNCTION LUT IMPLEMENTATION: + (Only read this if you are interested in the C implementation) + + The SUSAN brightness function is implemented as a LUT + (Look-Up-Table) for speed. The resulting pointer-based code is a + little hard to follow, so here is a brief explanation. In + setup_brightness_lut() the LUT is setup. This mallocs enough space + for *bp and then repositions the pointer to the centre of the + malloced space. The SUSAN function e^-(x^6) or e^-(x^2) is + calculated and converted to a uchar in the range 0-100, for all + possible image brightness differences (including negative + ones). Thus bp[23] is the output for a brightness difference of 23 + greylevels. In the SUSAN algorithms this LUT is used as follows: + + p=in + (i-3)*x_size + j - 1; + p points to the first image pixel in the circular mask surrounding + point (x,y). + + cp=bp + in[i*x_size+j]; + cp points to a position in the LUT corresponding to the brightness + of the centre pixel (x,y). + + now for every pixel within the mask surrounding (x,y), + n+=*(cp-*p++); + the brightness difference function is found by moving the cp pointer + down by an amount equal to the value of the pixel pointed to by p, + thus subtracting the two brightness values and performing the + exponential function. This value is added to n, the running USAN + area. + + in SUSAN smoothing, the variable height mask is implemented by + multiplying the above by the moving mask pointer, reset for each new + centre pixel. + tmp = *dpt++ * *(cp-brightness); + +\**********************************************************************/ + +/**********************************************************************\ + + Success has been reported with the following: + + MACHINE OS COMPILER + + Sun 4.1.4 bundled C, gcc + + Next + + SGI IRIX SGI cc + + DEC Unix V3.2+ + + IBM RISC AIX gcc + + PC Borland 5.0 + + PC Linux gcc-2.6.3 + + PC Win32 Visual C++ 4.0 (Console Application) + + PC Win95 Visual C++ 5.0 (Console Application) + Thanks to Niu Yongsheng : + Use the FOPENB option below + + PC DOS djgpp gnu C + Thanks to Mark Pettovello : + Use the FOPENB option below + + HP HP-UX bundled cc + Thanks to Brian Dixon : + in ksh: + export CCOPTS="-Aa -D_HPUX_SOURCE | -lM" + cc -O3 -o susan susan2l.c + +\**********************************************************************/ + +/**********************************************************************\ + + SUSAN Version 2l, 12/2/99 + Changed GNUDOS option to FOPENB. + (Thanks to Niu Yongsheng .) + Took out redundant "sq=sq/2;". + + SUSAN Version 2k, 19/8/98: + In corner finding: + Changed if(yyx_size) etc. tests in smoothing. + Added a couple of free() calls for cgx and cgy. + (Thanks to geoffb@ucs.ed.ac.uk - Geoff Browitt.) + + SUSAN Version 2i, 21/7/97: + Added information about corner attributes. + + SUSAN Version 2h, 16/12/96: + Added principle (initial enhancement) option. + + SUSAN Version 2g, 2/7/96: + Minor superficial changes to code. + + SUSAN Version 2f, 16/1/96: + Added GNUDOS option (now called FOPENB; see options below). + + SUSAN Version 2e, 9/1/96: + Added -b option. + Fixed 1 pixel horizontal offset error for drawing edges. + + SUSAN Version 2d, 27/11/95: + Fixed loading of certain PGM files in get_image (again!) + + SUSAN Version 2c, 22/11/95: + Fixed loading of certain PGM files in get_image. + (Thanks to qu@San-Jose.ate.slb.com - Gongyuan Qu.) + + SUSAN Version 2b, 9/11/95: + removed "z==" error in edges routines. + + SUSAN Version 2a, 6/11/95: + Removed a few unnecessary variable declarations. + Added different machine information. + Changed "header" in get_image to char. + + SUSAN Version 2, 1/11/95: first combined version able to take any + image sizes. + + SUSAN "Versions 1", circa 1992: the various SUSAN algorithms were + developed during my doctorate within different programs and for + fixed image sizes. The algorithms themselves are virtually unaltered + between "versions 1" and the combined program, version 2. + +\**********************************************************************/ + +#include "../extra.h" +#include "wcclibm.h" +#include "wccfile.h" +#include "wccmalloc.h" + +#define EXP_A 184 +#define EXP_C 16249 + +float susan_expf(float y) +{ + union + { + float d; + struct + { +#ifdef LITTLE_ENDIAN + short j, i; +#else + short i, j; +#endif + } n; + } eco; + eco.n.i = EXP_A*(y) + (EXP_C); + eco.n.j = 0; + return eco.d; +} + +float susan_sqrtf(float val) +{ + float x = val/10; + + float dx; + + float diff; + float min_tol = 0.00001f; + + int i, flag; + + + flag = 0; + if (val == 0 ) x = 0; + else { + for (i=1;i<20;i++) + { + if (!flag) { + dx = (val - (x*x)) / (2.0f * x); + x = x + dx; + diff = val - (x*x); + if (fabs(diff) <= min_tol) flag = 1; + } + } + } + return (x); +} + +/* ********** Optional settings */ + +typedef int TOTAL_TYPE; + +#define SEVEN_SUPP /* size for non-max corner suppression; SEVEN_SUPP or FIVE_SUPP */ +#define MAX_CORNERS 15000 /* max corners per frame */ + +#define FTOI(a) ( (a) < 0 ? ((int)(a-0.5)) : ((int)(a+0.5)) ) +#define abs(a) ( (a) < 0 ? -a : a ) +typedef unsigned char uchar; +typedef struct {int x,y,info, dx, dy, I;} corner_rep; +typedef corner_rep CORNER_LIST[MAX_CORNERS]; + +extern char susan_input[7292]; +struct wccFILE susan_file; +float susan_dt; +int susan_bt; +int susan_principle_conf; +int susan_thin_post_proc; +int susan_three_by_three; +int susan_drawing_mode; +int susan_susan_quick; +int susan_max_no_corners; +int susan_max_no_edges; + +int susan_getint( struct wccFILE *fd ) +{ + int c, i; + char dummy[10000]; + + c = susan_wccfgetc(fd); + _Pragma( "loopbound min 1 max 4" ) + while (1) { /* find next integer */ + if (c=='#') /* if we're at a comment, read to end of line */ + susan_wccfgets(dummy,9000,fd); + if (c==EOFX) { + /* "Image is not binary PGM." */ + } + if (c>='0' && c<='9') + break; /* found what we were looking for */ + c = susan_wccfgetc(fd); + } + + /* we're at the start of a number, continue until we hit a non-number */ + i = 0; + _Pragma( "loopbound min 2 max 3" ) + while (1) { + i = (i*10) + (c - '0'); + c = susan_wccfgetc(fd); + if (c==EOFX) return (i); + if (c<'0' || c>'9') break; + } + + return (i); +} + + +void susan_get_image( struct wccFILE *fd, + unsigned char **in, int *x_size, int *y_size ) +{ + char header [100]; + + susan_wccfseek( fd, 0, WCCSEEK_SET ); + + /* {{{ read header */ + + header[0]=susan_wccfgetc( fd ); + header[1]=susan_wccfgetc( fd ); + if(!(header[0]=='P' && header[1]=='5')) { + /* "Image does not have binary PGM header." */ + } + + *x_size = susan_getint(fd); + *y_size = susan_getint(fd); + // dummy read + susan_getint(fd); + +/* }}} */ + + *in = (uchar *) susan_wccmalloc(*x_size * *y_size); + + if (susan_wccfread(*in,1,*x_size * *y_size,fd) == 0) { + /* "Image is wrong size.\n" */ + } +} + + +void susan_put_image( int x_size, int y_size ) +{ + int i; + _Pragma( "loopbound min 7220 max 7220" ) + for ( i = 0; i < x_size*y_size; i++ ) { + ; + } +} + + +void susan_int_to_uchar( char *r, uchar *in, int size ) +{ + int i, max_r=r[0], min_r=r[0]; + + _Pragma( "loopbound min 0 max 0" ) + for (i=0; i max_r ) + max_r=r[i]; + if ( r[i] < min_r ) + min_r=r[i]; + } + + if (max_r == min_r) { + /* Should not occur in TACLeBench. */ + _Pragma( "loopbound min 0 max 0" ) + for (i=0; ip[l+1]) { + tmp=p[l]; + p[l]=p[l+1]; + p[l+1]=tmp; + } + } + } + + return( (p[3]+p[4]) / 2 ); +} + + +/* this enlarges "in" so that borders can be dealt with easily */ +void susan_enlarge( uchar **in, uchar *tmp_image, + int *x_size, int *y_size, int border ) +{ + int i, j; + + _Pragma( "loopbound min 95 max 95" ) + for(i=0; i<*y_size; i++) { /* copy *in into tmp_image */ + susan_wccmemcpy( tmp_image+(i+border)*(*x_size+2*border)+border, + *in+i* *x_size, *x_size); + } + + _Pragma( "loopbound min 7 max 7" ) + for(i=0; i