Merge pull request #2647 from vbystricky:ipp_norm

pull/2646/merge
Alexander Alekhin 11 years ago committed by OpenCV Buildbot
commit ba0ab8edb0
  1. 45
      modules/core/src/stat.cpp

@ -2442,30 +2442,43 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
}
else
{
typedef IppStatus (CV_STDCALL* ippiNormRelFunc)(const void *, int, const void *, int, IppiSize, Ipp64f *, IppHintAlgorithm hint);
ippiNormRelFunc ippFunc =
typedef IppStatus (CV_STDCALL* ippiNormRelFuncNoHint)(const void *, int, const void *, int, IppiSize, Ipp64f *);
typedef IppStatus (CV_STDCALL* ippiNormRelFuncHint)(const void *, int, const void *, int, IppiSize, Ipp64f *, IppHintAlgorithm hint);
ippiNormRelFuncNoHint ippFuncNoHint =
normType == NORM_INF ?
(type == CV_8UC1 ? (ippiNormRelFunc)ippiNormRel_Inf_8u_C1R :
type == CV_16UC1 ? (ippiNormRelFunc)ippiNormRel_Inf_16u_C1R :
type == CV_16SC1 ? (ippiNormRelFunc)ippiNormRel_Inf_16s_C1R :
type == CV_32FC1 ? (ippiNormRelFunc)ippiNormRel_Inf_32f_C1R :
(type == CV_8UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_Inf_8u_C1R :
type == CV_16UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_Inf_16u_C1R :
type == CV_16SC1 ? (ippiNormRelFuncNoHint)ippiNormRel_Inf_16s_C1R :
type == CV_32FC1 ? (ippiNormRelFuncNoHint)ippiNormRel_Inf_32f_C1R :
0) :
normType == NORM_L1 ?
(type == CV_8UC1 ? (ippiNormRelFunc)ippiNormRel_L1_8u_C1R :
type == CV_16UC1 ? (ippiNormRelFunc)ippiNormRel_L1_16u_C1R :
type == CV_16SC1 ? (ippiNormRelFunc)ippiNormRel_L1_16s_C1R :
type == CV_32FC1 ? (ippiNormRelFunc)ippiNormRel_L1_32f_C1R :
(type == CV_8UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L1_8u_C1R :
type == CV_16UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L1_16u_C1R :
type == CV_16SC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L1_16s_C1R :
0) :
normType == NORM_L2 || normType == NORM_L2SQR ?
(type == CV_8UC1 ? (ippiNormRelFunc)ippiNormRel_L2_8u_C1R :
type == CV_16UC1 ? (ippiNormRelFunc)ippiNormRel_L2_16u_C1R :
type == CV_16SC1 ? (ippiNormRelFunc)ippiNormRel_L2_16s_C1R :
type == CV_32FC1 ? (ippiNormRelFunc)ippiNormRel_L2_32f_C1R :
(type == CV_8UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L2_8u_C1R :
type == CV_16UC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L2_16u_C1R :
type == CV_16SC1 ? (ippiNormRelFuncNoHint)ippiNormRel_L2_16s_C1R :
0) : 0;
if( ippFunc )
ippiNormRelFuncHint ippFuncHint =
normType == NORM_L1 ?
(type == CV_32FC1 ? (ippiNormRelFuncHint)ippiNormRel_L1_32f_C1R :
0) :
normType == NORM_L2 || normType == NORM_L2SQR ?
(type == CV_32FC1 ? (ippiNormRelFuncHint)ippiNormRel_L2_32f_C1R :
0) : 0;
if (ippFuncNoHint)
{
Ipp64f norm;
if( ippFuncNoHint(src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], sz, &norm) >= 0 )
return (double)norm;
setIppErrorStatus();
}
if (ippFuncHint)
{
Ipp64f norm;
if( ippFunc(src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], sz, &norm, ippAlgHintAccurate) >= 0 )
if( ippFuncHint(src1.data, (int)src1.step[0], src2.data, (int)src2.step[0], sz, &norm, ippAlgHintAccurate) >= 0 )
return (double)norm;
setIppErrorStatus();
}

Loading…
Cancel
Save