Commit 76c21b73 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #16374 from alalek:imgproc_dispatch_sumpixels

parents 4d2da2de 09b3383a
...@@ -9,5 +9,6 @@ ocv_add_dispatched_file(color_yuv SSE2 SSE4_1 AVX2) ...@@ -9,5 +9,6 @@ ocv_add_dispatched_file(color_yuv SSE2 SSE4_1 AVX2)
ocv_add_dispatched_file(median_blur SSE2 SSE4_1 AVX2) ocv_add_dispatched_file(median_blur SSE2 SSE4_1 AVX2)
ocv_add_dispatched_file(morph SSE2 SSE4_1 AVX2) ocv_add_dispatched_file(morph SSE2 SSE4_1 AVX2)
ocv_add_dispatched_file(smooth SSE2 SSE4_1 AVX2) ocv_add_dispatched_file(smooth SSE2 SSE4_1 AVX2)
ocv_add_dispatched_file(sumpixels SSE2 AVX2 AVX512_SKX)
ocv_add_dispatched_file(undistort SSE2 AVX2) ocv_add_dispatched_file(undistort SSE2 AVX2)
ocv_define_module(imgproc opencv_core WRAP java python js) ocv_define_module(imgproc opencv_core WRAP java python js)
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
// It is subject to the license terms in the LICENSE file found in the top-level directory // It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html. // of this distribution and at http://opencv.org/license.html.
// //
// Copyright (C) 2019, Intel Corporation, all rights reserved. // Copyright (C) 2019-2020, Intel Corporation, all rights reserved.
#include "precomp.hpp"
#include "sumpixels.hpp"
#include "opencv2/core/hal/intrin.hpp" #include "opencv2/core/hal/intrin.hpp"
namespace cv { namespace hal {
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
namespace cv {
namespace { // Anonymous namespace to avoid exposing the implementation classes namespace { // Anonymous namespace to avoid exposing the implementation classes
// //
...@@ -432,16 +431,14 @@ __m512d IntegralCalculator < 4 > ::calculate_integral(const __m512i src_longs, c ...@@ -432,16 +431,14 @@ __m512d IntegralCalculator < 4 > ::calculate_integral(const __m512i src_longs, c
} // end of anonymous namespace } // end of anonymous namespace
namespace opt_AVX512_SKX { static
// This is the implementation for the external callers interface entry point.
// It should be the only function called into this file from outside
// Any new implementations should be directed from here
void calculate_integral_avx512(const uchar *src, size_t _srcstep, void calculate_integral_avx512(const uchar *src, size_t _srcstep,
double *sum, size_t _sumstep, double *sum, size_t _sumstep,
double *sqsum, size_t _sqsumstep, double *sqsum, size_t _sqsumstep,
int width, int height, int cn) int width, int height, int cn)
{ {
CV_INSTRUMENT_REGION();
switch(cn){ switch(cn){
case 1: { case 1: {
IntegralCalculator< 1 > calculator; IntegralCalculator< 1 > calculator;
...@@ -466,5 +463,5 @@ void calculate_integral_avx512(const uchar *src, size_t _srcstep, ...@@ -466,5 +463,5 @@ void calculate_integral_avx512(const uchar *src, size_t _srcstep,
} }
} // end namespace opt_AVX512_SXK CV_CPU_OPTIMIZATION_NAMESPACE_END
} // end namespace cv }} // end namespace cv::hal
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2019, Intel Corporation, all rights reserved.
#ifndef OPENCV_IMGPROC_SUM_PIXELS_HPP
#define OPENCV_IMGPROC_SUM_PIXELS_HPP
namespace cv
{
namespace opt_AVX512_SKX
{
#if CV_TRY_AVX512_SKX
void calculate_integral_avx512(
const uchar *src, size_t _srcstep,
double *sum, size_t _sumstep,
double *sqsum, size_t _sqsumstep,
int width, int height, int cn);
#endif
} // end namespace opt_AVX512_SKX
} // end namespace cv
#endif
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment