From e37930b64998db9e893389745bffe91aeb9cc160 Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Mon, 31 Oct 2011 07:04:52 +0000 Subject: [PATCH] Optimized version of Sum functions added --- modules/core/src/stat.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 60da0a53a..15424b595 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -193,12 +193,19 @@ static int sum64f( const double* src, const uchar* mask, double* dst, int len, i typedef int (*SumFunc)(const uchar*, const uchar* mask, uchar*, int, int); +#ifdef HAVE_TEGRA_OPTIMIZATION +static SumFunc sumTab[] = +{ + (SumFunc)tegra::sum8u, (SumFunc)sum8s, (SumFunc)sum16u, (SumFunc)sum16s, + (SumFunc)sum32s, (SumFunc)tegra::sum32f, (SumFunc)sum64f, 0 +}; +#else static SumFunc sumTab[] = { (SumFunc)sum8u, (SumFunc)sum8s, (SumFunc)sum16u, (SumFunc)sum16s, (SumFunc)sum32s, (SumFunc)sum32f, (SumFunc)sum64f, 0 }; - +#endif template static int countNonZero_(const T* src, int len )